@@ -793,20 +793,6 @@ static void vivi_stop_generating(struct vivi_dev *dev)
kthread_stop(dma_q->kthread);
dma_q->kthread = NULL;
}
-
- /*
- * Typical driver might need to wait here until dma engine stops.
- * In this case we can abort imiedetly, so it's just a noop.
- */
-
- /* Release all active buffers */
- while (!list_empty(&dma_q->active)) {
- struct vivi_buffer *buf;
- buf = list_entry(dma_q->active.next, struct vivi_buffer, list);
- list_del(&buf->list);
- vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
- dprintk(dev, 2, "[%p/%d] done\n", buf, buf->vb.v4l2_buf.index);
- }
}
/* ------------------------------------------------------------------
Videobuf operations
@@ -914,6 +900,13 @@ static int stop_streaming(struct vb2_queue *vq)
return 0;
}
+static void reinit_streaming(struct vb2_queue *vq)
+{
+ struct vivi_dev *dev = vb2_get_drv_priv(vq);
+
+ INIT_LIST_HEAD(&dev->vidq.active);
+}
+
static void vivi_lock(struct vb2_queue *vq)
{
struct vivi_dev *dev = vb2_get_drv_priv(vq);
@@ -933,6 +926,7 @@ static const struct vb2_ops vivi_video_qops = {
.buf_queue = buffer_queue,
.start_streaming = start_streaming,
.stop_streaming = stop_streaming,
+ .reinit_streaming = reinit_streaming,
.wait_prepare = vivi_unlock,
.wait_finish = vivi_lock,
};