MLK-20326-4: ISI: enable alpha insertion for mem2mem
Enable global alpha insertion for memory to memory function of ISI Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
This commit is contained in:
parent
81aabc880c
commit
c9357f5816
|
@ -679,6 +679,18 @@ void mxc_isi_m2m_channel_set_filp(struct mxc_isi_dev *mxc_isi)
|
||||||
writel(val, mxc_isi->regs + CHNL_IMG_CTRL);
|
writel(val, mxc_isi->regs + CHNL_IMG_CTRL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mxc_isi_m2m_channel_set_alpha(struct mxc_isi_dev *mxc_isi)
|
||||||
|
{
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
val = readl(mxc_isi->regs + CHNL_IMG_CTRL);
|
||||||
|
val &= ~(CHNL_IMG_CTRL_GBL_ALPHA_VAL_MASK | CHNL_IMG_CTRL_GBL_ALPHA_EN_MASK);
|
||||||
|
val |= ((mxc_isi->m2m.alpha << CHNL_IMG_CTRL_GBL_ALPHA_VAL_OFFSET) |
|
||||||
|
(CHNL_IMG_CTRL_GBL_ALPHA_EN_ENABLE << CHNL_IMG_CTRL_GBL_ALPHA_EN_OFFSET));
|
||||||
|
|
||||||
|
writel(val, mxc_isi->regs + CHNL_IMG_CTRL);
|
||||||
|
}
|
||||||
|
|
||||||
void mxc_isi_m2m_channel_init(struct mxc_isi_dev *mxc_isi)
|
void mxc_isi_m2m_channel_init(struct mxc_isi_dev *mxc_isi)
|
||||||
{
|
{
|
||||||
u32 val;
|
u32 val;
|
||||||
|
@ -714,6 +726,9 @@ void mxc_isi_m2m_channel_config(struct mxc_isi_dev *mxc_isi)
|
||||||
|
|
||||||
/* Horizonal and Vertical flip */
|
/* Horizonal and Vertical flip */
|
||||||
mxc_isi_m2m_channel_set_filp(mxc_isi);
|
mxc_isi_m2m_channel_set_filp(mxc_isi);
|
||||||
|
|
||||||
|
if (mxc_isi->m2m.alphaen)
|
||||||
|
mxc_isi_m2m_channel_set_alpha(mxc_isi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mxc_isi_m2m_channel_enable(struct mxc_isi_dev *mxc_isi)
|
void mxc_isi_m2m_channel_enable(struct mxc_isi_dev *mxc_isi)
|
||||||
|
|
|
@ -886,6 +886,13 @@ static int mxc_isi_m2m_s_ctrl(struct v4l2_ctrl *ctrl)
|
||||||
mxc_isi->m2m.vflip = (ctrl->val > 0) ? 1 : 0;
|
mxc_isi->m2m.vflip = (ctrl->val > 0) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case V4L2_CID_ALPHA_COMPONENT:
|
||||||
|
if (ctrl->val < 0 || ctrl->val > 255)
|
||||||
|
return -EINVAL;
|
||||||
|
mxc_isi->m2m.alpha = ctrl->val;
|
||||||
|
mxc_isi->m2m.alphaen = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dev_err(&mxc_isi->pdev->dev, "%s: Not support %d CID\n", __func__, ctrl->id);
|
dev_err(&mxc_isi->pdev->dev, "%s: Not support %d CID\n", __func__, ctrl->id);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -914,6 +921,8 @@ static int mxc_isi_m2m_ctrls_create(struct mxc_isi_dev *mxc_isi)
|
||||||
V4L2_CID_HFLIP, 0, 1, 1, 0);
|
V4L2_CID_HFLIP, 0, 1, 1, 0);
|
||||||
ctrls->vflip = v4l2_ctrl_new_std(handler, &mxc_isi_m2m_ctrl_ops,
|
ctrls->vflip = v4l2_ctrl_new_std(handler, &mxc_isi_m2m_ctrl_ops,
|
||||||
V4L2_CID_VFLIP, 0, 1, 1, 0);
|
V4L2_CID_VFLIP, 0, 1, 1, 0);
|
||||||
|
ctrls->alpha = v4l2_ctrl_new_std(handler, &mxc_isi_m2m_ctrl_ops,
|
||||||
|
V4L2_CID_ALPHA_COMPONENT, 0, 0xff, 1, 0);
|
||||||
|
|
||||||
if (!handler->error)
|
if (!handler->error)
|
||||||
ctrls->ready = true;
|
ctrls->ready = true;
|
||||||
|
|
Loading…
Reference in a new issue