[PATCH v1 2/2] v4l: vivi: adapt to out-of-order buffer dequeuing in videobuf.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make vivi use new videobuf helpers for finishing processing a buffer and
checking for consumers.

Signed-off-by: Pawel Osciak <p.osciak@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
---
 drivers/media/video/vivi.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index cdbe703..4a91761 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -630,13 +630,13 @@ static void vivi_thread_tick(struct vivi_fh *fh)
 		goto unlock;
 	}
 
-	buf = list_entry(dma_q->active.next,
-			 struct vivi_buffer, vb.queue);
-
-	/* Nobody is waiting on this buffer, return */
-	if (!waitqueue_active(&buf->vb.done))
+	if (!videobuf_has_consumers(&fh->vb_vidq)) {
+		dprintk(dev, 1, "No consumers\n");
 		goto unlock;
+	}
 
+	buf = list_entry(dma_q->active.next,
+			 struct vivi_buffer, vb.queue);
 	list_del(&buf->vb.queue);
 
 	do_gettimeofday(&buf->vb.ts);
@@ -645,11 +645,12 @@ static void vivi_thread_tick(struct vivi_fh *fh)
 	vivi_fillbuff(fh, buf);
 	dprintk(dev, 1, "filled buffer %p\n", buf);
 
-	wake_up(&buf->vb.done);
-	dprintk(dev, 2, "[%p/%d] wakeup\n", buf, buf->vb. i);
-unlock:
 	spin_unlock_irqrestore(&dev->slock, flags);
+	videobuf_buf_finish(&fh->vb_vidq, &buf->vb);
 	return;
+
+unlock:
+	spin_unlock_irqrestore(&dev->slock, flags);
 }
 
 #define frames_to_ms(frames)					\
-- 
1.7.1.rc1.12.ga601

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux