diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2016-06-20 11:04:38 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-06-28 18:34:33 +0300 |
commit | d05a331029d31836053a934365056616b0142898 (patch) | |
tree | a98252b9628e1fe1cd4a480548b2db131d0be875 /drivers/media/platform/vsp1/vsp1_rpf.c | |
parent | 07a23c611778ab009b46b7b44b98e96157bb075f (diff) | |
download | linux-d05a331029d31836053a934365056616b0142898.tar.xz |
[media] v4l: vsp1: rwpf: Support runtime modification of controls
Allow reconfiguration of the alpha value at runtime.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_rpf.c')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_rpf.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c index b8e801edf84c..4258c7208877 100644 --- a/drivers/media/platform/vsp1/vsp1_rpf.c +++ b/drivers/media/platform/vsp1/vsp1_rpf.c @@ -73,8 +73,15 @@ static void rpf_configure(struct vsp1_entity *entity, u32 pstride; u32 infmt; - if (!full) + if (!full) { + vsp1_rpf_write(rpf, dl, VI6_RPF_VRTCOL_SET, + rpf->alpha << VI6_RPF_VRTCOL_SET_LAYA_SHIFT); + vsp1_rpf_write(rpf, dl, VI6_RPF_MULT_ALPHA, rpf->mult_alpha | + (rpf->alpha << VI6_RPF_MULT_ALPHA_RATIO_SHIFT)); + + vsp1_pipeline_propagate_alpha(pipe, dl, rpf->alpha); return; + } /* Source size, stride and crop offsets. * @@ -171,9 +178,6 @@ static void rpf_configure(struct vsp1_entity *entity, (fmtinfo->alpha ? VI6_RPF_ALPH_SEL_ASEL_PACKED : VI6_RPF_ALPH_SEL_ASEL_FIXED)); - vsp1_rpf_write(rpf, dl, VI6_RPF_VRTCOL_SET, - rpf->alpha << VI6_RPF_VRTCOL_SET_LAYA_SHIFT); - if (entity->vsp1->info->gen == 3) { u32 mult; @@ -191,8 +195,7 @@ static void rpf_configure(struct vsp1_entity *entity, mult = VI6_RPF_MULT_ALPHA_A_MMD_RATIO | (premultiplied ? VI6_RPF_MULT_ALPHA_P_MMD_RATIO : - VI6_RPF_MULT_ALPHA_P_MMD_NONE) - | (rpf->alpha << VI6_RPF_MULT_ALPHA_RATIO_SHIFT); + VI6_RPF_MULT_ALPHA_P_MMD_NONE); } else { /* When the input doesn't contain an alpha channel the * global alpha value is applied in the unpacking unit, @@ -203,11 +206,9 @@ static void rpf_configure(struct vsp1_entity *entity, | VI6_RPF_MULT_ALPHA_P_MMD_NONE; } - vsp1_rpf_write(rpf, dl, VI6_RPF_MULT_ALPHA, mult); + rpf->mult_alpha = mult; } - vsp1_pipeline_propagate_alpha(pipe, dl, rpf->alpha); - vsp1_rpf_write(rpf, dl, VI6_RPF_MSK_CTRL, 0); vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL, 0); @@ -253,6 +254,8 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index) goto error; } + v4l2_ctrl_handler_setup(&rpf->ctrls); + return rpf; error: |