aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-10-23 12:59:08 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2015-09-15 11:00:58 +0200
commit1226d64344e7fc12ad73f2264081400bde0239d5 (patch)
tree0942b9e5cb7d542fc1eaa321edee2293b9f604c0
parent803a6efcb714b02228f878a463a49325a8531431 (diff)
vb2: update the buf_prepare/finish documentationvb2-cpu-access
Document how the new vb2_plane_begin/end_cpu_access() functions should be used in buf_prepare/finish. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--include/media/videobuf2-core.h35
1 files changed, 22 insertions, 13 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 59b8a1a97ee5..a2ab4e749b2a 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -273,21 +273,30 @@ struct vb2_buffer {
* perform any initialization required before each
* hardware operation in this callback; drivers can
* access/modify the buffer here as it is still synced for
- * the CPU; drivers that support VIDIOC_CREATE_BUFS must
- * also validate the buffer size; if an error is returned,
- * the buffer will not be queued in driver; optional.
+ * the CPU, provided you bracket the cpu access part with
+ * @vb2_plane_begin_cpu_access and @vb2_plane_end_cpu_access;
+ * when using videobuf2-vmalloc.h you can postpone the call
+ * to @vb2_plane_end_cpu_access to @buf_finish; drivers
+ * that support VIDIOC_CREATE_BUFS must also validate
+ * the buffer size; if an error is returned, the buffer
+ * will not be queued in driver; optional.
* @buf_finish: called before every dequeue of the buffer back to
* userspace; the buffer is synced for the CPU, so drivers
- * can access/modify the buffer contents; drivers may
- * perform any operations required before userspace
- * accesses the buffer; optional. The buffer state can be
- * one of the following: DONE and ERROR occur while
- * streaming is in progress, and the PREPARED state occurs
- * when the queue has been canceled and all pending
- * buffers are being returned to their default DEQUEUED
- * state. Typically you only have to do something if the
- * state is VB2_BUF_STATE_DONE, since in all other cases
- * the buffer contents will be ignored anyway.
+ * can access/modify the buffer contents provided you
+ * bracket the cpu access part with
+ * @vb2_plane_begin_cpu_access and @vb2_plane_end_cpu_access;
+ * when using videobuf2-vmalloc.h you can call
+ * @vb2_plane_end_cpu_access here to bracket a corresponding
+ * @vb2_plane_begin_cpu_access call in @buf_prepare;
+ * drivers may perform any operations required before
+ * userspace accesses the buffer; optional. The buffer
+ * state can be one of the following: DONE and ERROR
+ * occur while streaming is in progress, and the PREPARED
+ * state occurs when the queue has been canceled and all
+ * pending buffers are being returned to their default
+ * DEQUEUED state. Typically you only have to do something
+ * if the state is VB2_BUF_STATE_DONE, since in all other
+ * cases the buffer contents will be ignored anyway.
* @buf_cleanup: called once before the buffer is freed; drivers may
* perform any additional cleanup; optional.
* @start_streaming: called once to enter 'streaming' state; the driver may

Privacy Policy