[media] solo6x10: fix sequence handling
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 15 Mar 2013 16:16:49 +0000 (13:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 25 Mar 2013 11:49:48 +0000 (08:49 -0300)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/media/solo6x10/solo6x10.h
drivers/staging/media/solo6x10/v4l2-enc.c
drivers/staging/media/solo6x10/v4l2.c

index 6c00f07cd2dd3109539113e5c693686340fbd3a0..94ac294fb04836f8db6736ef55eef8cb12b7ed7e 100644 (file)
@@ -173,6 +173,7 @@ struct solo_enc_dev {
 
        u32                     fmt;
        enum solo_enc_types     type;
+       u32                     sequence;
        struct vb2_queue        vidq;
        struct list_head        vidq_active;
        int                     desc_count;
@@ -267,6 +268,7 @@ struct solo_dev {
        /* Buffer handling */
        struct vb2_queue        vidq;
        struct vb2_alloc_ctx    *alloc_ctx;
+       u32                     sequence;
        struct task_struct      *kthread;
        struct mutex            lock;
        spinlock_t              slock;
index f804c936471c300fccaa897ae4031625801c5455..4fbfb351d373be443a9cb9501a40e8675a130570 100644 (file)
@@ -269,6 +269,7 @@ static int solo_enc_on(struct solo_enc_dev *solo_enc)
        /* Make sure to do a bandwidth check */
        if (solo_enc->bw_weight > solo_dev->enc_bw_remain)
                return -EBUSY;
+       solo_enc->sequence = 0;
        solo_dev->enc_bw_remain -= solo_enc->bw_weight;
 
        if (solo_enc->type == SOLO_ENC_TYPE_EXT)
@@ -522,7 +523,7 @@ static int solo_enc_fillbuf(struct solo_enc_dev *solo_enc,
                ret = solo_fill_jpeg(solo_enc, vb, vh);
 
        if (!ret) {
-               vb->v4l2_buf.sequence++;
+               vb->v4l2_buf.sequence = solo_enc->sequence++;
                vb->v4l2_buf.timestamp.tv_sec = vh->sec;
                vb->v4l2_buf.timestamp.tv_usec = vh->usec;
        }
index b5643ab3b9a15e9737eb756afa502ed398f7fb78..02749a3c1d8faacbd7b0e1847f766fc4527bb492 100644 (file)
@@ -224,7 +224,7 @@ finish_buf:
        if (!error) {
                vb2_set_plane_payload(vb, 0,
                        solo_vlines(solo_dev) * solo_bytesperline(solo_dev));
-               vb->v4l2_buf.sequence++;
+               vb->v4l2_buf.sequence = solo_dev->sequence++;
                v4l2_get_timestamp(&vb->v4l2_buf.timestamp);
        }
 
@@ -332,6 +332,7 @@ static int solo_start_streaming(struct vb2_queue *q, unsigned int count)
 {
        struct solo_dev *solo_dev = vb2_get_drv_priv(q);
 
+       solo_dev->sequence = 0;
        return solo_start_thread(solo_dev);
 }