|
@@ -1199,6 +1199,30 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(vb2_buffer_done);
|
|
EXPORT_SYMBOL_GPL(vb2_buffer_done);
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * vb2_discard_done() - discard all buffers marked as DONE
|
|
|
|
+ * @q: videobuf2 queue
|
|
|
|
+ *
|
|
|
|
+ * This function is intended to be used with suspend/resume operations. It
|
|
|
|
+ * discards all 'done' buffers as they would be too old to be requested after
|
|
|
|
+ * resume.
|
|
|
|
+ *
|
|
|
|
+ * Drivers must stop the hardware and synchronize with interrupt handlers and/or
|
|
|
|
+ * delayed works before calling this function to make sure no buffer will be
|
|
|
|
+ * touched by the driver and/or hardware.
|
|
|
|
+ */
|
|
|
|
+void vb2_discard_done(struct vb2_queue *q)
|
|
|
|
+{
|
|
|
|
+ struct vb2_buffer *vb;
|
|
|
|
+ unsigned long flags;
|
|
|
|
+
|
|
|
|
+ spin_lock_irqsave(&q->done_lock, flags);
|
|
|
|
+ list_for_each_entry(vb, &q->done_list, done_entry)
|
|
|
|
+ vb->state = VB2_BUF_STATE_ERROR;
|
|
|
|
+ spin_unlock_irqrestore(&q->done_lock, flags);
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL_GPL(vb2_discard_done);
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* __fill_vb2_buffer() - fill a vb2_buffer with information provided in a
|
|
* __fill_vb2_buffer() - fill a vb2_buffer with information provided in a
|
|
* v4l2_buffer by the userspace. The caller has already verified that struct
|
|
* v4l2_buffer by the userspace. The caller has already verified that struct
|