diff options
author | Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> | 2018-05-18 16:42:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-25 19:03:16 -0400 |
commit | 46ce3639a579c29dc3166a9a66522f72f11f560c (patch) | |
tree | 13bb07c31eb5edde959931cf7ef23d5b2f6bd5bc /drivers/media/platform/vsp1/vsp1_lut.c | |
parent | 2d9445db0ee9d8695ab3dadb614829b70e43b61f (diff) | |
download | blackbird-obmc-linux-46ce3639a579c29dc3166a9a66522f72f11f560c.tar.gz blackbird-obmc-linux-46ce3639a579c29dc3166a9a66522f72f11f560c.zip |
media: vsp1: Refactor display list configure operations
The entities provide a single .configure operation which configures the
object into the target display list, based on the vsp1_entity_params
selection.
Split the configure function into three parts, '.configure_stream()',
'.configure_frame()', and '.configure_partition()' to facilitate
splitting the configuration of each parameter class into separate
display list bodies.
[laurent.pinchart+renesas@ideasonboard.com: Blank line reformatting, remote unneeded local variable initialization]
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_lut.c')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_lut.c | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_lut.c b/drivers/media/platform/vsp1/vsp1_lut.c index b3ea90172439..1b62f54dc302 100644 --- a/drivers/media/platform/vsp1/vsp1_lut.c +++ b/drivers/media/platform/vsp1/vsp1_lut.c @@ -145,37 +145,33 @@ static const struct v4l2_subdev_ops lut_ops = { * VSP1 Entity Operations */ -static void lut_configure(struct vsp1_entity *entity, - struct vsp1_pipeline *pipe, - struct vsp1_dl_list *dl, - enum vsp1_entity_params params) +static void lut_configure_stream(struct vsp1_entity *entity, + struct vsp1_pipeline *pipe, + struct vsp1_dl_list *dl) { struct vsp1_lut *lut = to_lut(&entity->subdev); - struct vsp1_dl_body *dlb; - unsigned long flags; - - switch (params) { - case VSP1_ENTITY_PARAMS_INIT: - vsp1_lut_write(lut, dl, VI6_LUT_CTRL, VI6_LUT_CTRL_EN); - break; - case VSP1_ENTITY_PARAMS_PARTITION: - break; + vsp1_lut_write(lut, dl, VI6_LUT_CTRL, VI6_LUT_CTRL_EN); +} - case VSP1_ENTITY_PARAMS_RUNTIME: - spin_lock_irqsave(&lut->lock, flags); - dlb = lut->lut; - lut->lut = NULL; - spin_unlock_irqrestore(&lut->lock, flags); +static void lut_configure_frame(struct vsp1_entity *entity, + struct vsp1_pipeline *pipe, + struct vsp1_dl_list *dl) +{ + struct vsp1_lut *lut = to_lut(&entity->subdev); + struct vsp1_dl_body *dlb; + unsigned long flags; - if (dlb) { - vsp1_dl_list_add_body(dl, dlb); + spin_lock_irqsave(&lut->lock, flags); + dlb = lut->lut; + lut->lut = NULL; + spin_unlock_irqrestore(&lut->lock, flags); - /* Release our local reference. */ - vsp1_dl_body_put(dlb); - } + if (dlb) { + vsp1_dl_list_add_body(dl, dlb); - break; + /* Release our local reference. */ + vsp1_dl_body_put(dlb); } } @@ -187,7 +183,8 @@ static void lut_destroy(struct vsp1_entity *entity) } static const struct vsp1_entity_operations lut_entity_ops = { - .configure = lut_configure, + .configure_stream = lut_configure_stream, + .configure_frame = lut_configure_frame, .destroy = lut_destroy, }; |