blob: 6dd2d7fea7144502bb271ab2e156d028332cafcb [file] [log] [blame]
Alexandre Courbotcbb6a7f2018-05-21 04:54:54 -04001.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-or-later WITH no-invariant-sections
2
3.. _media_request_ioc_queue:
4
5*****************************
6ioctl MEDIA_REQUEST_IOC_QUEUE
7*****************************
8
9Name
10====
11
12MEDIA_REQUEST_IOC_QUEUE - Queue a request
13
14
15Synopsis
16========
17
18.. c:function:: int ioctl( int request_fd, MEDIA_REQUEST_IOC_QUEUE )
19 :name: MEDIA_REQUEST_IOC_QUEUE
20
21
22Arguments
23=========
24
25``request_fd``
26 File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
27
28
29Description
30===========
31
32If the media device supports :ref:`requests <media-request-api>`, then
33this request ioctl can be used to queue a previously allocated request.
34
35If the request was successfully queued, then the file descriptor can be
36:ref:`polled <request-func-poll>` to wait for the request to complete.
37
38If the request was already queued before, then ``EBUSY`` is returned.
39Other errors can be returned if the contents of the request contained
40invalid or inconsistent data, see the next section for a list of
41common error codes. On error both the request and driver state are unchanged.
42
Alexandre Courbotcbb6a7f2018-05-21 04:54:54 -040043Once a request is queued, then the driver is required to gracefully handle
44errors that occur when the request is applied to the hardware. The
45exception is the ``EIO`` error which signals a fatal error that requires
46the application to stop streaming to reset the hardware state.
47
48It is not allowed to mix queuing requests with queuing buffers directly
Hans Verkuil15cd4422018-09-01 07:29:14 -040049(without a request). ``EBUSY`` will be returned if the first buffer was
Alexandre Courbotcbb6a7f2018-05-21 04:54:54 -040050queued directly and you next try to queue a request, or vice versa.
51
52A request must contain at least one buffer, otherwise this ioctl will
53return an ``ENOENT`` error.
54
55Return Value
56============
57
58On success 0 is returned, on error -1 and the ``errno`` variable is set
59appropriately. The generic error codes are described at the
60:ref:`Generic Error Codes <gen-errors>` chapter.
61
62EBUSY
Hans Verkuil15cd4422018-09-01 07:29:14 -040063 The request was already queued or the application queued the first
64 buffer directly, but later attempted to use a request. It is not permitted
65 to mix the two APIs.
Alexandre Courbotcbb6a7f2018-05-21 04:54:54 -040066ENOENT
67 The request did not contain any buffers. All requests are required
Hans Verkuild4215ed2018-08-28 05:11:04 -040068 to have at least one buffer. This can also be returned if some required
69 configuration is missing in the request.
Alexandre Courbotcbb6a7f2018-05-21 04:54:54 -040070ENOMEM
71 Out of memory when allocating internal data structures for this
72 request.
73EINVAL
74 The request has invalid data.
75EIO
76 The hardware is in a bad state. To recover, the application needs to
77 stop streaming to reset the hardware state and then try to restart
78 streaming.