diff mbox

[v2,07/23] v4l: vsp1: Release buffers at stream stop

Message ID 1403567669-18539-8-git-send-email-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart June 23, 2014, 11:54 p.m. UTC
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 mark 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>
---
 drivers/media/platform/vsp1/vsp1_video.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Sergei Shtylyov June 24, 2014, noon UTC | #1
Hello.

On 06/24/2014 03:54 AM, Laurent Pinchart wrote:

> 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 mark releasing all buffers queued on the IRQ queue in the

    Mark releasing?

> stop_stream operation handler and marking them as erroneous.

> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart July 1, 2014, 7:16 a.m. UTC | #2
Hi Sergei,

On Tuesday 24 June 2014 16:00:45 Sergei Shtylyov wrote:
> Hello.
> 
> On 06/24/2014 03:54 AM, Laurent Pinchart wrote:
> > 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 mark releasing all buffers queued on the IRQ queue in the
> 
> Mark releasing?

I'll fix that, thank you.

> > stop_stream operation handler and marking them as erroneous.
> > 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
diff mbox

Patch

diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index c717e28..9bb156c 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -742,6 +742,7 @@  static void vsp1_video_stop_streaming(struct vb2_queue *vq)
 {
 	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 void vsp1_video_stop_streaming(struct vb2_queue *vq)
 
 	/* 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);
 }