diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-08-01 20:44:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-08-18 06:20:59 -0400 |
commit | 5548a382508f1f76320e1ed55524dda73234299d (patch) | |
tree | 61e6617bb9e72adb1c0b2dba6f0993b44d7e0df2 /include/media | |
parent | c09aada7ac8a8c03970bd2fb41176647da7cef99 (diff) |
[media] media: vb2: Clarify queue_setup() and buf_prepare() usage documentation
Explain how the two operations must handle formats and validate buffer
sizes when used with VIDIOC_CREATE_BUFS.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/videobuf2-core.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index d88a098d1aff..6781258d0b67 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -219,8 +219,9 @@ struct vb2_buffer { | |||
219 | * configured format and *num_buffers is the total number | 219 | * configured format and *num_buffers is the total number |
220 | * of buffers, that are being allocated. When called from | 220 | * of buffers, that are being allocated. When called from |
221 | * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the | 221 | * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the |
222 | * target frame format. In this case *num_buffers are being | 222 | * target frame format (if the format isn't valid the |
223 | * allocated additionally to q->num_buffers. | 223 | * callback must return -EINVAL). In this case *num_buffers |
224 | * are being allocated additionally to q->num_buffers. | ||
224 | * @wait_prepare: release any locks taken while calling vb2 functions; | 225 | * @wait_prepare: release any locks taken while calling vb2 functions; |
225 | * it is called before an ioctl needs to wait for a new | 226 | * it is called before an ioctl needs to wait for a new |
226 | * buffer to arrive; required to avoid a deadlock in | 227 | * buffer to arrive; required to avoid a deadlock in |
@@ -236,8 +237,10 @@ struct vb2_buffer { | |||
236 | * @buf_prepare: called every time the buffer is queued from userspace | 237 | * @buf_prepare: called every time the buffer is queued from userspace |
237 | * and from the VIDIOC_PREPARE_BUF ioctl; drivers may | 238 | * and from the VIDIOC_PREPARE_BUF ioctl; drivers may |
238 | * perform any initialization required before each hardware | 239 | * perform any initialization required before each hardware |
239 | * operation in this callback; if an error is returned, the | 240 | * operation in this callback; drivers that support |
240 | * buffer will not be queued in driver; optional | 241 | * VIDIOC_CREATE_BUFS must also validate the buffer size; |
242 | * if an error is returned, the buffer will not be queued | ||
243 | * in driver; optional | ||
241 | * @buf_finish: called before every dequeue of the buffer back to | 244 | * @buf_finish: called before every dequeue of the buffer back to |
242 | * userspace; drivers may perform any operations required | 245 | * userspace; drivers may perform any operations required |
243 | * before userspace accesses the buffer; optional | 246 | * before userspace accesses the buffer; optional |