summaryrefslogtreecommitdiffstats
path: root/Documentation/media
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2019-06-12 05:36:48 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-21 16:29:56 -0400
commit13d93380fca826e49c42e8d83fc8a077cabbe6b8 (patch)
treee663f9ad21ec99aaab3ca324eb597c6d5a36cd5d /Documentation/media
parentababd7612321bbe89abc87c607ca8d70702d9e56 (diff)
downloadlinux-13d93380fca826e49c42e8d83fc8a077cabbe6b8.tar.bz2
media: Clarify the meaning of file descriptors in VIDIOC_DQBUF
When the application calls VIDIOC_DQBUF with the DMABUF memory type, the v4l2_buffer structure (or v4l2_plane structures) are filled with DMA-buf file descriptors. However, the current documentation does not explain whether those are new file descriptors referring to the same DMA-bufs or just the same integers as passed to VIDIOC_QBUF back in time. Clarify the documentation that it's the latter. Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'Documentation/media')
-rw-r--r--Documentation/media/uapi/v4l/vidioc-qbuf.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/media/uapi/v4l/vidioc-qbuf.rst b/Documentation/media/uapi/v4l/vidioc-qbuf.rst
index dbf7b445a27b..407302d80684 100644
--- a/Documentation/media/uapi/v4l/vidioc-qbuf.rst
+++ b/Documentation/media/uapi/v4l/vidioc-qbuf.rst
@@ -139,6 +139,14 @@ may continue as normal, but should be aware that data in the dequeued
buffer might be corrupted. When using the multi-planar API, the planes
array must be passed in as well.
+If the application sets the ``memory`` field to ``V4L2_MEMORY_DMABUF`` to
+dequeue a :ref:`DMABUF <dmabuf>` buffer, the driver fills the ``m.fd`` field
+with a file descriptor numerically the same as the one given to ``VIDIOC_QBUF``
+when the buffer was enqueued. No new file descriptor is created at dequeue time
+and the value is only for the application convenience. When the multi-planar
+API is used the ``m.fd`` fields of the passed array of struct
+:c:type:`v4l2_plane` are filled instead.
+
By default ``VIDIOC_DQBUF`` blocks when no buffer is in the outgoing
queue. When the ``O_NONBLOCK`` flag was given to the
:ref:`open() <func-open>` function, ``VIDIOC_DQBUF`` returns