@@ -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) \