diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-06-23 17:15:02 -0300 |
---|---|---|
committer | Stephane Desneux <stephane.desneux@open.eurogiciel.org> | 2015-02-04 11:15:38 +0100 |
commit | 6675b5083e6f4e25f5db26989df514c1c9930e10 (patch) | |
tree | 989a5d1950745e0fd72252380e49aba90456e8cd | |
parent | 46117370f31bf9e15a1f5e6cf87cbb733011adaa (diff) | |
download | kernel-common-6675b5083e6f4e25f5db26989df514c1c9930e10.tar.gz kernel-common-6675b5083e6f4e25f5db26989df514c1c9930e10.tar.bz2 kernel-common-6675b5083e6f4e25f5db26989df514c1c9930e10.zip |
v4l: vsp1: Fix pipeline stop timeout
If the pipeline was already stopped when stopping the stream, no
frame end interrupt will be generated and the driver will time out
waiting for the pipeline to stop.
Fix this by setting the pipeline state to STOPPED when the pipeline is
idle waiting for frames to process, and to STOPPING at stream stop time
only when the pipeline is currently RUNNING.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 9b3e6e2abd7568f9458e927fc4e5eca1b3cde521)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_video.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index d7a1998f15a5..61ac316c55ca 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -471,7 +471,8 @@ static int vsp1_pipeline_stop(struct vsp1_pipeline *pipe) int ret; spin_lock_irqsave(&pipe->irqlock, flags); - pipe->state = VSP1_PIPELINE_STOPPING; + if (pipe->state == VSP1_PIPELINE_RUNNING) + pipe->state = VSP1_PIPELINE_STOPPING; spin_unlock_irqrestore(&pipe->irqlock, flags); ret = wait_event_timeout(pipe->wq, pipe->state == VSP1_PIPELINE_STOPPED, @@ -576,6 +577,7 @@ static void vsp1_video_frame_end(struct vsp1_pipeline *pipe, void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe) { + enum vsp1_pipeline_state state; unsigned long flags; unsigned int i; @@ -591,11 +593,13 @@ void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe) spin_lock_irqsave(&pipe->irqlock, flags); + state = pipe->state; + pipe->state = VSP1_PIPELINE_STOPPED; + /* If a stop has been requested, mark the pipeline as stopped and * return. */ - if (pipe->state == VSP1_PIPELINE_STOPPING) { - pipe->state = VSP1_PIPELINE_STOPPED; + if (state == VSP1_PIPELINE_STOPPING) { wake_up(&pipe->wq); goto done; } |