[media] media: blackfin: bfin_capture: make sure all buffers are returned on stop_str...
authorLad, Prabhakar <[email protected]>
Sun, 8 Mar 2015 14:40:45 +0000 (11:40 -0300)
committerMauro Carvalho Chehab <[email protected]>
Thu, 2 Apr 2015 21:11:33 +0000 (18:11 -0300)
In start_streaming() callback the buffer is removed from the
dma_queue list and assigned to cur_frm, this patch makes sure
that is returned to vb2 core with VB2_BUF_STATE_ERROR flag.

Signed-off-by: Lad, Prabhakar <[email protected]>
Tested-by: Scott Jiang <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
drivers/media/platform/blackfin/bfin_capture.c

index 2a9e93304a20d7f0ccf1790a371983d45ab51819..f2b1a23f26c41a8324f679923d7928900a094f77 100644 (file)
@@ -374,6 +374,9 @@ static void bcap_stop_streaming(struct vb2_queue *vq)
                                "stream off failed in subdev\n");
 
        /* release all active buffers */
+       if (bcap_dev->cur_frm)
+               vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR);
+
        while (!list_empty(&bcap_dev->dma_queue)) {
                bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
                                                struct bcap_buffer, list);