66 lines · plain
1.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later2.. c:namespace:: MC3 4.. _media_ioc_request_alloc:5 6*****************************7ioctl MEDIA_IOC_REQUEST_ALLOC8*****************************9 10Name11====12 13MEDIA_IOC_REQUEST_ALLOC - Allocate a request14 15Synopsis16========17 18.. c:macro:: MEDIA_IOC_REQUEST_ALLOC19 20``int ioctl(int fd, MEDIA_IOC_REQUEST_ALLOC, int *argp)``21 22Arguments23=========24 25``fd``26 File descriptor returned by :c:func:`open()`.27 28``argp``29 Pointer to an integer.30 31Description32===========33 34If the media device supports :ref:`requests <media-request-api>`, then35this ioctl can be used to allocate a request. If it is not supported, then36``errno`` is set to ``ENOTTY``. A request is accessed through a file descriptor37that is returned in ``*argp``.38 39If the request was successfully allocated, then the request file descriptor40can be passed to the :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`,41:ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`,42:ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` and43:ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctls.44 45In addition, the request can be queued by calling46:ref:`MEDIA_REQUEST_IOC_QUEUE` and re-initialized by calling47:ref:`MEDIA_REQUEST_IOC_REINIT`.48 49Finally, the file descriptor can be :ref:`polled <request-func-poll>` to wait50for the request to complete.51 52The request will remain allocated until all the file descriptors associated53with it are closed by :c:func:`close()` and the driver no54longer uses the request internally. See also55:ref:`here <media-request-life-time>` for more information.56 57Return Value58============59 60On success 0 is returned, on error -1 and the ``errno`` variable is set61appropriately. The generic error codes are described at the62:ref:`Generic Error Codes <gen-errors>` chapter.63 64ENOTTY65 The driver has no support for requests.66