summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-08-02 19:37:11 (GMT)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-19 11:01:23 (GMT)
commit3f725b7eee496d7d0e0daea94df23a8daafbec40 (patch)
treee7c7432e0ddd3338d06a0c51ee57678a5194ef65 /drivers
parent2f2db2f2061a88e959e3cbfd0518b72761fd7b36 (diff)
downloadlinux-3f725b7eee496d7d0e0daea94df23a8daafbec40.tar.xz
[media] v4l: vsp1: Decouple pipeline end of frame processing from vsp1_video
To make the pipeline structure and operations usable without video devices the frame end processing must be decoupled from struct vsp1_video. Implement this by calling the video frame end function indirectly through a function pointer in struct vsp1_pipeline. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/vsp1/vsp1_video.c25
-rw-r--r--drivers/media/platform/vsp1/vsp1_video.h2
2 files changed, 19 insertions, 8 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index 381447a..8f8ff44 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -633,8 +633,9 @@ vsp1_video_complete_buffer(struct vsp1_video *video)
}
static void vsp1_video_frame_end(struct vsp1_pipeline *pipe,
- struct vsp1_video *video)
+ struct vsp1_rwpf *rwpf)
{
+ struct vsp1_video *video = rwpf->video;
struct vsp1_vb2_buffer *buf;
unsigned long flags;
@@ -650,21 +651,28 @@ static void vsp1_video_frame_end(struct vsp1_pipeline *pipe,
spin_unlock_irqrestore(&pipe->irqlock, flags);
}
+static void vsp1_video_pipeline_frame_end(struct vsp1_pipeline *pipe)
+{
+ unsigned int i;
+
+ /* Complete buffers on all video nodes. */
+ for (i = 0; i < pipe->num_inputs; ++i)
+ vsp1_video_frame_end(pipe, pipe->inputs[i]);
+
+ if (!pipe->lif)
+ vsp1_video_frame_end(pipe, pipe->output);
+}
+
void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe)
{
enum vsp1_pipeline_state state;
unsigned long flags;
- unsigned int i;
if (pipe == NULL)
return;
- /* Complete buffers on all video nodes. */
- for (i = 0; i < pipe->num_inputs; ++i)
- vsp1_video_frame_end(pipe, pipe->inputs[i]->video);
-
- if (!pipe->lif)
- vsp1_video_frame_end(pipe, pipe->output->video);
+ /* Signal frame end to the pipeline handler. */
+ pipe->frame_end(pipe);
spin_lock_irqsave(&pipe->irqlock, flags);
@@ -1240,6 +1248,7 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
INIT_LIST_HEAD(&video->pipe.entities);
init_waitqueue_head(&video->pipe.wq);
video->pipe.state = VSP1_PIPELINE_STOPPED;
+ video->pipe.frame_end = vsp1_video_pipeline_frame_end;
/* Initialize the media entity... */
ret = media_entity_pads_init(&video->video.entity, 1, &video->pad);
diff --git a/drivers/media/platform/vsp1/vsp1_video.h b/drivers/media/platform/vsp1/vsp1_video.h
index e9d0e1a..b79fdaa 100644
--- a/drivers/media/platform/vsp1/vsp1_video.h
+++ b/drivers/media/platform/vsp1/vsp1_video.h
@@ -70,6 +70,8 @@ struct vsp1_pipeline {
enum vsp1_pipeline_state state;
wait_queue_head_t wq;
+ void (*frame_end)(struct vsp1_pipeline *pipe);
+
struct mutex lock;
unsigned int use_count;
unsigned int stream_count;