diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-08-01 21:44:38 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-08-18 07:20:59 -0300 |
commit | 5548a382508f1f76320e1ed55524dda73234299d (patch) | |
tree | 61e6617bb9e72adb1c0b2dba6f0993b44d7e0df2 /include | |
parent | c09aada7ac8a8c03970bd2fb41176647da7cef99 (diff) | |
download | op-kernel-dev-5548a382508f1f76320e1ed55524dda73234299d.zip op-kernel-dev-5548a382508f1f76320e1ed55524dda73234299d.tar.gz |
[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')
-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 d88a098..6781258 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -219,8 +219,9 @@ struct vb2_buffer { * configured format and *num_buffers is the total number * of buffers, that are being allocated. When called from * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the - * target frame format. In this case *num_buffers are being - * allocated additionally to q->num_buffers. + * target frame format (if the format isn't valid the + * callback must return -EINVAL). In this case *num_buffers + * are being allocated additionally to q->num_buffers. * @wait_prepare: release any locks taken while calling vb2 functions; * it is called before an ioctl needs to wait for a new * buffer to arrive; required to avoid a deadlock in @@ -236,8 +237,10 @@ struct vb2_buffer { * @buf_prepare: called every time the buffer is queued from userspace * and from the VIDIOC_PREPARE_BUF ioctl; drivers may * perform any initialization required before each hardware - * operation in this callback; if an error is returned, the - * buffer will not be queued in driver; optional + * operation in this callback; 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; drivers may perform any operations required * before userspace accesses the buffer; optional |