From: Laurent Pinchart Date: Fri, 2 Aug 2013 00:34:52 +0000 (-0300) Subject: upstream: [media] Documentation: media: Clarify the VIDIOC_CREATE_BUFS format require... X-Git-Tag: submit/tizen/20141121.110247~1998 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=baaa6b4f82aecf775bcb04b8a82c2735dc16f4b1;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] Documentation: media: Clarify the VIDIOC_CREATE_BUFS format requirements The VIDIOC_CREATE_BUFS ioctl takes a format argument that must contain a valid format supported by the driver. Clarify the documentation. Signed-off-by: Laurent Pinchart Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml index cd99436..9b700a5 100644 --- a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml +++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml @@ -62,18 +62,29 @@ addition to the VIDIOC_REQBUFS ioctl, when a tighter control over buffers is required. This ioctl can be called multiple times to create buffers of different sizes. - To allocate device buffers applications initialize relevant fields of -the v4l2_create_buffers structure. They set the -type field in the -&v4l2-format; structure, embedded in this -structure, to the respective stream or buffer type. -count must be set to the number of required buffers. -memory specifies the required I/O method. The -format field shall typically be filled in using -either the VIDIOC_TRY_FMT or -VIDIOC_G_FMT ioctl(). Additionally, applications can adjust -sizeimage fields to fit their specific needs. The -reserved array must be zeroed. + To allocate the device buffers applications must initialize the +relevant fields of the v4l2_create_buffers structure. +The count field must be set to the number of +requested buffers, the memory field specifies the +requested I/O method and the reserved array must be +zeroed. + + The format field specifies the image format +that the buffers must be able to handle. The application has to fill in this +&v4l2-format;. Usually this will be done using the +VIDIOC_TRY_FMT or VIDIOC_G_FMT ioctl() +to ensure that the requested format is supported by the driver. Unsupported +formats will result in an error. + + The buffers created by this ioctl will have as minimum size the size +defined by the format.pix.sizeimage field. If the +format.pix.sizeimage field is less than the minimum +required for the given format, then sizeimage will be +increased by the driver to that minimum to allocate the buffers. If it is +larger, then the value will be used as-is. The same applies to the +sizeimage field of the +v4l2_plane_pix_format structure in the case of +multiplanar formats. When the ioctl is called with a pointer to this structure the driver will attempt to allocate up to the requested number of buffers and store the @@ -144,9 +155,9 @@ mapped I/O. EINVAL - The buffer type (type field) or the -requested I/O method (memory) is not -supported. + The buffer type (format.type field), +requested I/O method (memory) or format +(format field) is not valid.