diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-11-17 18:10:26 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-04-14 00:56:14 +0300 |
commit | 7b905f0583b2e6fe1494a85303a89aa0cd30b0b3 (patch) | |
tree | a5da79d56457b44624280f2f2fb73a5e0937ab03 /drivers/media/platform/vsp1/vsp1_video.c | |
parent | b7e5107eebb73d27affed95c20cedbf4784bf17c (diff) | |
download | linux-7b905f0583b2e6fe1494a85303a89aa0cd30b0b3.tar.xz |
[media] v4l: vsp1: Create a new configure operation to setup modules
The subdev s_stream operation is abused as a generic way to setup
modules at every frame. Move the code out to a new VSP1 entity configure
operation.
Most modules now have an empty s_stream operation that can be removed.
The only exception is the WPF module that needs to perform hardware
configuration when stopping the stream. The code can be simplified
accordingly as we know that that operation never fails.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_video.c')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_video.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index d4a092c8ece3..a3f1145c8a79 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -591,7 +591,6 @@ static void vsp1_video_buffer_queue(struct vb2_buffer *vb) static int vsp1_video_setup_pipeline(struct vsp1_pipeline *pipe) { struct vsp1_entity *entity; - int ret; /* Prepare the display list. */ pipe->dl = vsp1_dl_list_get(pipe->output->dlm); @@ -619,18 +618,14 @@ static int vsp1_video_setup_pipeline(struct vsp1_pipeline *pipe) list_for_each_entry(entity, &pipe->entities, list_pipe) { vsp1_entity_route_setup(entity); - ret = v4l2_subdev_call(&entity->subdev, video, s_stream, 1); - if (ret < 0) - goto error; + if (entity->ops->configure) + entity->ops->configure(entity); } - return 0; + /* We know that the WPF s_stream operation never fails. */ + v4l2_subdev_call(&pipe->output->entity.subdev, video, s_stream, 1); -error: - vsp1_dl_list_put(pipe->dl); - pipe->dl = NULL; - - return ret; + return 0; } static int vsp1_video_start_streaming(struct vb2_queue *vq, unsigned int count) |