blob: c6424bb6132a7b5a1e659d220868cbba503fed85 [file] [log] [blame]
From e93307678a24edfd51417977b0c203f9de3f306b Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Date: Mon, 23 Jun 2014 16:57:22 -0300
Subject: [media] v4l: vsp1: Release buffers at stream stop
videobuf2 expects no buffer to be owned by the driver when the
stop_stream queue operation returns. As the vsp1 driver fails to do so,
a warning is generated at stream top time.
Fix this by releasing all buffers queued on the IRQ queue in the
stop_stream operation handler and marking them as erroneous.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 9df04e9d9ac6982d16a8a042c8274410ed29fb0e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
drivers/media/platform/vsp1/vsp1_video.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -742,6 +742,7 @@ static int vsp1_video_stop_streaming(str
{
struct vsp1_video *video = vb2_get_drv_priv(vq);
struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity);
+ struct vsp1_video_buffer *buffer;
unsigned long flags;
int ret;
@@ -759,6 +760,8 @@ static int vsp1_video_stop_streaming(str
/* Remove all buffers from the IRQ queue. */
spin_lock_irqsave(&video->irqlock, flags);
+ list_for_each_entry(buffer, &video->irqqueue, queue)
+ vb2_buffer_done(&buffer->buf, VB2_BUF_STATE_ERROR);
INIT_LIST_HEAD(&video->irqqueue);
spin_unlock_irqrestore(&video->irqlock, flags);