summaryrefslogtreecommitdiff
path: root/wiki/2016-10-miniperi/vsp2_running_count.patch
diff options
context:
space:
mode:
Diffstat (limited to 'wiki/2016-10-miniperi/vsp2_running_count.patch')
-rw-r--r--wiki/2016-10-miniperi/vsp2_running_count.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/wiki/2016-10-miniperi/vsp2_running_count.patch b/wiki/2016-10-miniperi/vsp2_running_count.patch
new file mode 100644
index 0000000..f6b0003
--- /dev/null
+++ b/wiki/2016-10-miniperi/vsp2_running_count.patch
@@ -0,0 +1,52 @@
+diff --git a/drv/vsp2_video.c b/drv/vsp2_video.c
+index 2946088..eacbb83 100755
+--- a/drv/vsp2_video.c
++++ b/drv/vsp2_video.c
+@@ -442,6 +442,7 @@ static void __vsp2_pipeline_cleanup(struct vsp2_pipeline *pipe)
+
+ INIT_LIST_HEAD(&pipe->entities);
+ pipe->state = VSP2_PIPELINE_STOPPED;
++ pipe->running_count = 0;
+ pipe->buffers_ready = 0;
+ pipe->num_video = 0;
+ pipe->num_inputs = 0;
+@@ -556,6 +557,7 @@ static void vsp2_pipeline_run(struct vsp2_pipeline *pipe)
+ vsp2_vspm_drv_entry(vsp2);
+
+ pipe->state = VSP2_PIPELINE_RUNNING;
++ pipe->running_count++;
+ pipe->buffers_ready = 0;
+ }
+
+@@ -675,7 +677,9 @@ void vsp2_pipeline_frame_end(struct vsp2_pipeline *pipe)
+ spin_lock_irqsave(&pipe->irqlock, flags);
+
+ state = pipe->state;
+- pipe->state = VSP2_PIPELINE_STOPPED;
++
++ if (--pipe->running_count == 0)
++ pipe->state = VSP2_PIPELINE_STOPPED;
+
+ /* If a stop has been requested, mark the pipeline as stopped and
+ * return.
+@@ -981,7 +985,7 @@ static int vsp2_video_stop_streaming(struct vb2_queue *vq)
+ int ret;
+
+ mutex_lock(&pipe->lock);
+- if (--pipe->stream_count == 0) {
++ if (--pipe->stream_count == pipe->num_inputs) {
+ /* Stop the pipeline. */
+ ret = vsp2_pipeline_stop(pipe);
+ if (ret == -ETIMEDOUT)
+diff --git a/drv/vsp2_video.h b/drv/vsp2_video.h
+index 90c3478..db67e66 100755
+--- a/drv/vsp2_video.h
++++ b/drv/vsp2_video.h
+@@ -120,6 +120,7 @@ struct vsp2_pipeline {
+ struct mutex lock;
+ unsigned int use_count;
+ unsigned int stream_count;
++ unsigned int running_count;
+ unsigned int buffers_ready;
+
+ unsigned int num_video;