diff options
Diffstat (limited to 'Documentation/media/uapi/v4l/vidioc-create-bufs.rst')
-rw-r--r-- | Documentation/media/uapi/v4l/vidioc-create-bufs.rst | 87 |
1 files changed, 31 insertions, 56 deletions
diff --git a/Documentation/media/uapi/v4l/vidioc-create-bufs.rst b/Documentation/media/uapi/v4l/vidioc-create-bufs.rst index abdc0b4d83d5..aaca12fca06e 100644 --- a/Documentation/media/uapi/v4l/vidioc-create-bufs.rst +++ b/Documentation/media/uapi/v4l/vidioc-create-bufs.rst @@ -15,7 +15,8 @@ VIDIOC_CREATE_BUFS - Create buffers for Memory Mapped or User Pointer or DMA Buf Synopsis ======== -.. cpp:function:: int ioctl( int fd, int request, struct v4l2_create_buffers *argp ) +.. c:function:: int ioctl( int fd, VIDIOC_CREATE_BUFS, struct v4l2_create_buffers *argp ) + :name: VIDIOC_CREATE_BUFS Arguments @@ -24,9 +25,6 @@ Arguments ``fd`` File descriptor returned by :ref:`open() <func-open>`. -``request`` - VIDIOC_CREATE_BUFS - ``argp`` @@ -41,14 +39,14 @@ over buffers is required. This ioctl can be called multiple times to create buffers of different sizes. To allocate the device buffers applications must initialize the relevant -fields of the :ref:`struct v4l2_create_buffers <v4l2-create-buffers>` structure. The +fields of the struct :c:type:`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 struct -:ref:`v4l2_format <v4l2-format>`. Usually this will be done using the +:c:type:`v4l2_format`. Usually this will be done using the :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` or :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctls to ensure that the requested format is supported by the driver. Based on the format's @@ -73,62 +71,39 @@ the ``index`` fields respectively. On return ``count`` can be smaller than the number requested. -.. _v4l2-create-buffers: +.. c:type:: v4l2_create_buffers + +.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| .. flat-table:: struct v4l2_create_buffers :header-rows: 0 :stub-columns: 0 :widths: 1 1 2 - - - .. row 1 - - - __u32 - - - ``index`` - - - The starting buffer index, returned by the driver. - - - .. row 2 - - - __u32 - - - ``count`` - - - The number of buffers requested or granted. If count == 0, then - :ref:`VIDIOC_CREATE_BUFS` will set ``index`` to the current number of - created buffers, and it will check the validity of ``memory`` and - ``format.type``. If those are invalid -1 is returned and errno is - set to ``EINVAL`` error code, otherwise :ref:`VIDIOC_CREATE_BUFS` returns - 0. It will never set errno to ``EBUSY`` error code in this particular - case. - - - .. row 3 - - - __u32 - - - ``memory`` - - - Applications set this field to ``V4L2_MEMORY_MMAP``, - ``V4L2_MEMORY_DMABUF`` or ``V4L2_MEMORY_USERPTR``. See - :ref:`v4l2-memory` - - - .. row 4 - - - struct :ref:`v4l2_format <v4l2-format>` - - - ``format`` - - - Filled in by the application, preserved by the driver. - - - .. row 5 - - - __u32 - - - ``reserved``\ [8] - - - A place holder for future extensions. Drivers and applications - must set the array to zero. + * - __u32 + - ``index`` + - The starting buffer index, returned by the driver. + * - __u32 + - ``count`` + - The number of buffers requested or granted. If count == 0, then + :ref:`VIDIOC_CREATE_BUFS` will set ``index`` to the current number of + created buffers, and it will check the validity of ``memory`` and + ``format.type``. If those are invalid -1 is returned and errno is + set to ``EINVAL`` error code, otherwise :ref:`VIDIOC_CREATE_BUFS` returns + 0. It will never set errno to ``EBUSY`` error code in this particular + case. + * - __u32 + - ``memory`` + - Applications set this field to ``V4L2_MEMORY_MMAP``, + ``V4L2_MEMORY_DMABUF`` or ``V4L2_MEMORY_USERPTR``. See + :c:type:`v4l2_memory` + * - struct :c:type:`v4l2_format` + - ``format`` + - Filled in by the application, preserved by the driver. + * - __u32 + - ``reserved``\ [8] + - A place holder for future extensions. Drivers and applications + must set the array to zero. Return Value |