diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-04 15:59:37 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-04 15:59:37 +0200 |
commit | c1ece76719205690f4b448460d9b85c130e8021b (patch) | |
tree | 01072c593d53ef551788228ea28ce8bc87bc0e45 /Documentation/DocBook/media/v4l/vidioc-expbuf.xml | |
parent | Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kern... (diff) | |
parent | [media] cec: fix off-by-one memset (diff) | |
download | linux-c1ece76719205690f4b448460d9b85c130e8021b.tar.xz linux-c1ece76719205690f4b448460d9b85c130e8021b.zip |
Merge tag 'media/v4.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media DocBook removal and some fixups from Mauro Carvalho Chehab:
- removal of the media DocBook (since it's all in Sphinx now)
- videobuf2: Fix an allocation regression
- a few fixes related to the CEC drivers
* tag 'media/v4.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] cec: fix off-by-one memset
[media] staging: add MEDIA_SUPPORT dependency
[media] vivid: don't handle CEC_MSG_SET_STREAM_PATH
[media] media: adv7180: Fix broken interrupt register access
[media] vb2: Fix allocation size of dma_parms
[media] vim2m: copy the other colorspace-related fields as well
[media] adv7511: fix VIC autodetect
doc-rst: Remove the media docbook
Diffstat (limited to 'Documentation/DocBook/media/v4l/vidioc-expbuf.xml')
-rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-expbuf.xml | 205 |
1 files changed, 0 insertions, 205 deletions
diff --git a/Documentation/DocBook/media/v4l/vidioc-expbuf.xml b/Documentation/DocBook/media/v4l/vidioc-expbuf.xml deleted file mode 100644 index a6558a676ef3..000000000000 --- a/Documentation/DocBook/media/v4l/vidioc-expbuf.xml +++ /dev/null @@ -1,205 +0,0 @@ -<refentry id="vidioc-expbuf"> - - <refmeta> - <refentrytitle>ioctl VIDIOC_EXPBUF</refentrytitle> - &manvol; - </refmeta> - - <refnamediv> - <refname>VIDIOC_EXPBUF</refname> - <refpurpose>Export a buffer as a DMABUF file descriptor.</refpurpose> - </refnamediv> - - <refsynopsisdiv> - <funcsynopsis> - <funcprototype> - <funcdef>int <function>ioctl</function></funcdef> - <paramdef>int <parameter>fd</parameter></paramdef> - <paramdef>int <parameter>request</parameter></paramdef> - <paramdef>struct v4l2_exportbuffer *<parameter>argp</parameter></paramdef> - </funcprototype> - </funcsynopsis> - </refsynopsisdiv> - - <refsect1> - <title>Arguments</title> - - <variablelist> - <varlistentry> - <term><parameter>fd</parameter></term> - <listitem> - <para>&fd;</para> - </listitem> - </varlistentry> - <varlistentry> - <term><parameter>request</parameter></term> - <listitem> - <para>VIDIOC_EXPBUF</para> - </listitem> - </varlistentry> - <varlistentry> - <term><parameter>argp</parameter></term> - <listitem> - <para></para> - </listitem> - </varlistentry> - </variablelist> - </refsect1> - - <refsect1> - <title>Description</title> - -<para>This ioctl is an extension to the <link linkend="mmap">memory -mapping</link> I/O method, therefore it is available only for -<constant>V4L2_MEMORY_MMAP</constant> buffers. It can be used to export a -buffer as a DMABUF file at any time after buffers have been allocated with the -&VIDIOC-REQBUFS; ioctl.</para> - -<para> To export a buffer, applications fill &v4l2-exportbuffer;. The -<structfield>type</structfield> field is set to the same buffer type as was -previously used with &v4l2-requestbuffers; <structfield>type</structfield>. -Applications must also set the <structfield>index</structfield> field. Valid -index numbers range from zero to the number of buffers allocated with -&VIDIOC-REQBUFS; (&v4l2-requestbuffers; <structfield>count</structfield>) -minus one. For the multi-planar API, applications set the <structfield>plane</structfield> -field to the index of the plane to be exported. Valid planes -range from zero to the maximal number of valid planes for the currently active -format. For the single-planar API, applications must set <structfield>plane</structfield> -to zero. Additional flags may be posted in the <structfield>flags</structfield> -field. Refer to a manual for open() for details. -Currently only O_CLOEXEC, O_RDONLY, O_WRONLY, and O_RDWR are supported. All -other fields must be set to zero. -In the case of multi-planar API, every plane is exported separately using -multiple <constant>VIDIOC_EXPBUF</constant> calls.</para> - -<para>After calling <constant>VIDIOC_EXPBUF</constant> the <structfield>fd</structfield> -field will be set by a driver. This is a DMABUF file -descriptor. The application may pass it to other DMABUF-aware devices. Refer to -<link linkend="dmabuf">DMABUF importing</link> for details about importing -DMABUF files into V4L2 nodes. It is recommended to close a DMABUF file when it -is no longer used to allow the associated memory to be reclaimed.</para> - </refsect1> - - <refsect1> - <title>Examples</title> - - <example> - <title>Exporting a buffer.</title> - <programlisting> -int buffer_export(int v4lfd, &v4l2-buf-type; bt, int index, int *dmafd) -{ - &v4l2-exportbuffer; expbuf; - - memset(&expbuf, 0, sizeof(expbuf)); - expbuf.type = bt; - expbuf.index = index; - if (ioctl(v4lfd, &VIDIOC-EXPBUF;, &expbuf) == -1) { - perror("VIDIOC_EXPBUF"); - return -1; - } - - *dmafd = expbuf.fd; - - return 0; -} - </programlisting> - </example> - - <example> - <title>Exporting a buffer using the multi-planar API.</title> - <programlisting> -int buffer_export_mp(int v4lfd, &v4l2-buf-type; bt, int index, - int dmafd[], int n_planes) -{ - int i; - - for (i = 0; i < n_planes; ++i) { - &v4l2-exportbuffer; expbuf; - - memset(&expbuf, 0, sizeof(expbuf)); - expbuf.type = bt; - expbuf.index = index; - expbuf.plane = i; - if (ioctl(v4lfd, &VIDIOC-EXPBUF;, &expbuf) == -1) { - perror("VIDIOC_EXPBUF"); - while (i) - close(dmafd[--i]); - return -1; - } - dmafd[i] = expbuf.fd; - } - - return 0; -} - </programlisting> - </example> - - <table pgwide="1" frame="none" id="v4l2-exportbuffer"> - <title>struct <structname>v4l2_exportbuffer</structname></title> - <tgroup cols="3"> - &cs-str; - <tbody valign="top"> - <row> - <entry>__u32</entry> - <entry><structfield>type</structfield></entry> - <entry>Type of the buffer, same as &v4l2-format; -<structfield>type</structfield> or &v4l2-requestbuffers; -<structfield>type</structfield>, set by the application. See <xref -linkend="v4l2-buf-type" /></entry> - </row> - <row> - <entry>__u32</entry> - <entry><structfield>index</structfield></entry> - <entry>Number of the buffer, set by the application. This field is -only used for <link linkend="mmap">memory mapping</link> I/O and can range from -zero to the number of buffers allocated with the &VIDIOC-REQBUFS; and/or -&VIDIOC-CREATE-BUFS; ioctls. </entry> - </row> - <row> - <entry>__u32</entry> - <entry><structfield>plane</structfield></entry> - <entry>Index of the plane to be exported when using the -multi-planar API. Otherwise this value must be set to zero. </entry> - </row> - <row> - <entry>__u32</entry> - <entry><structfield>flags</structfield></entry> - <entry>Flags for the newly created file, currently only -<constant>O_CLOEXEC</constant>, <constant>O_RDONLY</constant>, <constant>O_WRONLY</constant>, -and <constant>O_RDWR</constant> are supported, refer to the manual -of open() for more details.</entry> - </row> - <row> - <entry>__s32</entry> - <entry><structfield>fd</structfield></entry> - <entry>The DMABUF file descriptor associated with a buffer. Set by - the driver.</entry> - </row> - <row> - <entry>__u32</entry> - <entry><structfield>reserved[11]</structfield></entry> - <entry>Reserved field for future use. Drivers and applications must -set the array to zero.</entry> - </row> - </tbody> - </tgroup> - </table> - - </refsect1> - - <refsect1> - &return-value; - <variablelist> - <varlistentry> - <term><errorcode>EINVAL</errorcode></term> - <listitem> - <para>A queue is not in MMAP mode or DMABUF exporting is not -supported or <structfield>flags</structfield> or <structfield>type</structfield> -or <structfield>index</structfield> or <structfield>plane</structfield> fields -are invalid.</para> - </listitem> - </varlistentry> - </variablelist> - </refsect1> - -</refentry> |