Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

int32_t ipu_disp_set_global_alpha ( ipu_channel_t  channel,
bool  enable,
uint8_t  alpha 
)

This function sets the foreground and background plane global alpha blending modes. This function also sets the DP graphic plane according to the parameter of IPUv3 DP channel.

Parameters:
channel IPUv3 DP channel
enable Boolean to enable or disable global alpha blending. If disabled, local blending is used.
alpha Global alpha value.
Returns:
Returns 0 on success or negative error code on fail

Definition at line 1442 of file ipu_disp.c.

{
      uint32_t reg;
      uint32_t flow;
      unsigned long lock_flags;
      bool bg_chan;

      if (channel == MEM_BG_SYNC || channel == MEM_FG_SYNC)
            flow = DP_SYNC;
      else if (channel == MEM_BG_ASYNC0 || channel == MEM_FG_ASYNC0)
            flow = DP_ASYNC0;
      else if (channel == MEM_BG_ASYNC1 || channel == MEM_FG_ASYNC1)
            flow = DP_ASYNC1;
      else
            return -EINVAL;

      if (channel == MEM_BG_SYNC || channel == MEM_BG_ASYNC0 ||
          channel == MEM_BG_ASYNC1)
            bg_chan = true;
      else
            bg_chan = false;

      if (!g_ipu_clk_enabled)
            clk_enable(g_ipu_clk);
      spin_lock_irqsave(&ipu_lock, lock_flags);

      if (bg_chan) {
            reg = __raw_readl(DP_COM_CONF(flow));
            __raw_writel(reg & ~DP_COM_CONF_GWSEL, DP_COM_CONF(flow));
      } else {
            reg = __raw_readl(DP_COM_CONF(flow));
            __raw_writel(reg | DP_COM_CONF_GWSEL, DP_COM_CONF(flow));
      }

      if (enable) {
            reg = __raw_readl(DP_GRAPH_WIND_CTRL(flow)) & 0x00FFFFFFL;
            __raw_writel(reg | ((uint32_t) alpha << 24),
                       DP_GRAPH_WIND_CTRL(flow));

            reg = __raw_readl(DP_COM_CONF(flow));
            __raw_writel(reg | DP_COM_CONF_GWAM, DP_COM_CONF(flow));
      } else {
            reg = __raw_readl(DP_COM_CONF(flow));
            __raw_writel(reg & ~DP_COM_CONF_GWAM, DP_COM_CONF(flow));
      }

      reg = __raw_readl(IPU_SRM_PRI2) | 0x8;
      __raw_writel(reg, IPU_SRM_PRI2);

      spin_unlock_irqrestore(&ipu_lock, lock_flags);
      if (!g_ipu_clk_enabled)
            clk_disable(g_ipu_clk);

      return 0;
}


Generated by  Doxygen 1.6.0   Back to index