diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-09-20 15:16:37 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-21 19:58:36 -0400 |
commit | 91235537bc4b53f0b6f953acf963bcbb6215c49c (patch) | |
tree | 3f9501a6d2613aa31894d61325372338f6f727a0 /Documentation/DocBook | |
parent | acf92046a0a666051f9c6b4a53d874c618203173 (diff) |
[media] DocBook media: improve the poll() documentation
The poll documentation was incomplete: document how events (POLLPRI)
are handled and fix the documentation of what poll does for display devices
and streaming I/O.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r-- | Documentation/DocBook/media/v4l/func-poll.xml | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Documentation/DocBook/media/v4l/func-poll.xml b/Documentation/DocBook/media/v4l/func-poll.xml index bd07104a35e9..4c73f115219b 100644 --- a/Documentation/DocBook/media/v4l/func-poll.xml +++ b/Documentation/DocBook/media/v4l/func-poll.xml | |||
@@ -29,9 +29,12 @@ can suspend execution until the driver has captured data or is ready | |||
29 | to accept data for output.</para> | 29 | to accept data for output.</para> |
30 | 30 | ||
31 | <para>When streaming I/O has been negotiated this function waits | 31 | <para>When streaming I/O has been negotiated this function waits |
32 | until a buffer has been filled or displayed and can be dequeued with | 32 | until a buffer has been filled by the capture device and can be dequeued |
33 | the &VIDIOC-DQBUF; ioctl. When buffers are already in the outgoing | 33 | with the &VIDIOC-DQBUF; ioctl. For output devices this function waits |
34 | queue of the driver the function returns immediately.</para> | 34 | until the device is ready to accept a new buffer to be queued up with |
35 | the &VIDIOC-QBUF; ioctl for display. When buffers are already in the outgoing | ||
36 | queue of the driver (capture) or the incoming queue isn't full (display) | ||
37 | the function returns immediately.</para> | ||
35 | 38 | ||
36 | <para>On success <function>poll()</function> returns the number of | 39 | <para>On success <function>poll()</function> returns the number of |
37 | file descriptors that have been selected (that is, file descriptors | 40 | file descriptors that have been selected (that is, file descriptors |
@@ -57,6 +60,10 @@ as well, but it sets the <constant>POLLOUT</constant> and | |||
57 | <constant>POLLWRNORM</constant> flags in the <structfield>revents</structfield> | 60 | <constant>POLLWRNORM</constant> flags in the <structfield>revents</structfield> |
58 | field.</para> | 61 | field.</para> |
59 | 62 | ||
63 | <para>If an event occurred (see &VIDIOC-DQEVENT;) then | ||
64 | <constant>POLLPRI</constant> will be set in the <structfield>revents</structfield> | ||
65 | field and <function>poll()</function> will return.</para> | ||
66 | |||
60 | <para>When use of the <function>read()</function> function has | 67 | <para>When use of the <function>read()</function> function has |
61 | been negotiated and the driver does not capture yet, the | 68 | been negotiated and the driver does not capture yet, the |
62 | <function>poll</function> function starts capturing. When that fails | 69 | <function>poll</function> function starts capturing. When that fails |
@@ -66,10 +73,18 @@ continuously (as opposed to, for example, still images) the function | |||
66 | may return immediately.</para> | 73 | may return immediately.</para> |
67 | 74 | ||
68 | <para>When use of the <function>write()</function> function has | 75 | <para>When use of the <function>write()</function> function has |
69 | been negotiated the <function>poll</function> function just waits | 76 | been negotiated and the driver does not stream yet, the |
77 | <function>poll</function> function starts streaming. When that fails | ||
78 | it returns a <constant>POLLERR</constant> as above. Otherwise it waits | ||
70 | until the driver is ready for a non-blocking | 79 | until the driver is ready for a non-blocking |
71 | <function>write()</function> call.</para> | 80 | <function>write()</function> call.</para> |
72 | 81 | ||
82 | <para>If the caller is only interested in events (just | ||
83 | <constant>POLLPRI</constant> is set in the <structfield>events</structfield> | ||
84 | field), then <function>poll()</function> will <emphasis>not</emphasis> | ||
85 | start streaming if the driver does not stream yet. This makes it | ||
86 | possible to just poll for events and not for buffers.</para> | ||
87 | |||
73 | <para>All drivers implementing the <function>read()</function> or | 88 | <para>All drivers implementing the <function>read()</function> or |
74 | <function>write()</function> function or streaming I/O must also | 89 | <function>write()</function> function or streaming I/O must also |
75 | support the <function>poll()</function> function.</para> | 90 | support the <function>poll()</function> function.</para> |