[media] media: blackfin: bfin_capture: set v4l2 buffer sequence
authorLad, Prabhakar <prabhakar.csengg@gmail.com>
Sun, 8 Mar 2015 14:40:51 +0000 (11:40 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 2 Apr 2015 21:11:48 +0000 (18:11 -0300)
this patch adds support to set the v4l2 buffer sequence.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/blackfin/bfin_capture.c

index c3ede0d25808f3487cccd3c1f5e94fd4399ef752..306798eac666a8dec177d28ddbc025e163e2c9f7 100644 (file)
@@ -103,6 +103,8 @@ struct bcap_device {
        struct completion comp;
        /* prepare to stop */
        bool stop;
+       /* vb2 buffer sequence counter */
+       unsigned sequence;
 };
 
 static const struct bcap_format bcap_formats[] = {
@@ -333,6 +335,8 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
                goto err;
        }
 
+       bcap_dev->sequence = 0;
+
        reinit_completion(&bcap_dev->comp);
        bcap_dev->stop = false;
 
@@ -411,6 +415,7 @@ static irqreturn_t bcap_isr(int irq, void *dev_id)
                        vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
                        ppi->err = false;
                } else {
+                       vb->v4l2_buf.sequence = bcap_dev->sequence++;
                        vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
                }
                bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
This page took 0.0256 seconds and 5 git commands to generate.