[media] v4l: vsp1: Move frame sequence number from video node to pipeline
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 10 Apr 2016 05:59:04 +0000 (02:59 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 17 Jun 2016 11:15:10 +0000 (08:15 -0300)
The frame sequence number is global to the pipeline, there's no need to
store copies in each video node.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vsp1/vsp1_pipe.c
drivers/media/platform/vsp1/vsp1_pipe.h
drivers/media/platform/vsp1/vsp1_video.c
drivers/media/platform/vsp1/vsp1_video.h

index 0c1dc80eb3040ea4fa68abdced7faccea4a85946..be47c8a1a812635a37a3366af17bce84b4e4ab39 100644 (file)
@@ -286,6 +286,8 @@ void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe)
 
        if (pipe->frame_end)
                pipe->frame_end(pipe);
+
+       pipe->sequence++;
 }
 
 /*
index 7b56113511ddeb8bf8decdef897edf1e4510881e..febc62f99d6dcccbffd1a7c6ec958f2713f23c6e 100644 (file)
@@ -67,6 +67,7 @@ enum vsp1_pipeline_state {
  * @kref: pipeline reference count
  * @stream_count: number of streaming video nodes
  * @buffers_ready: bitmask of RPFs and WPFs with at least one buffer available
+ * @sequence: frame sequence number
  * @num_inputs: number of RPFs
  * @inputs: array of RPFs in the pipeline (indexed by RPF index)
  * @output: WPF at the output of the pipeline
@@ -90,6 +91,7 @@ struct vsp1_pipeline {
        struct kref kref;
        unsigned int stream_count;
        unsigned int buffers_ready;
+       unsigned int sequence;
 
        unsigned int num_inputs;
        struct vsp1_rwpf *inputs[VSP1_MAX_RPF];
index a9aec5c0bec68cab3172ec912997ce723b75d46b..34aa6427662d231642a8b85fcd08d1965a7faad6 100644 (file)
@@ -219,7 +219,7 @@ vsp1_video_complete_buffer(struct vsp1_video *video)
 
        spin_unlock_irqrestore(&video->irqlock, flags);
 
-       done->buf.sequence = video->sequence++;
+       done->buf.sequence = pipe->sequence;
        done->buf.vb2_buf.timestamp = ktime_get_ns();
        for (i = 0; i < done->buf.vb2_buf.num_planes; ++i)
                vb2_set_plane_payload(&done->buf.vb2_buf, i,
@@ -805,8 +805,6 @@ vsp1_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
        if (video->queue.owner && video->queue.owner != file->private_data)
                return -EBUSY;
 
-       video->sequence = 0;
-
        /* Get a pipeline for the video node and start streaming on it. No link
         * touching an entity in the pipeline can be activated or deactivated
         * once streaming is started.
index 867b00807c46e7357e8841868f94cb2e830d2937..1595fd587fbca4a499de7dd3334ed3e271846e16 100644 (file)
@@ -49,7 +49,6 @@ struct vsp1_video {
        void *alloc_ctx;
        spinlock_t irqlock;
        struct list_head irqqueue;
-       unsigned int sequence;
 };
 
 static inline struct vsp1_video *to_vsp1_video(struct video_device *vdev)