1 <refentry id="vidioc-prepare-buf">
3 <refentrytitle>ioctl VIDIOC_PREPARE_BUF</refentrytitle>
8 <refname>VIDIOC_PREPARE_BUF</refname>
9 <refpurpose>Prepare a buffer for I/O</refpurpose>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_buffer *<parameter>argp</parameter></paramdef>
24 <title>Arguments</title>
28 <term><parameter>fd</parameter></term>
34 <term><parameter>request</parameter></term>
36 <para>VIDIOC_PREPARE_BUF</para>
40 <term><parameter>argp</parameter></term>
49 <title>Description</title>
51 <para>Applications can optionally call the
52 <constant>VIDIOC_PREPARE_BUF</constant> ioctl to pass ownership of the buffer
53 to the driver before actually enqueuing it, using the
54 <constant>VIDIOC_QBUF</constant> ioctl, and to prepare it for future I/O.
55 Such preparations may include cache invalidation or cleaning. Performing them
56 in advance saves time during the actual I/O. In case such cache operations are
57 not required, the application can use one of
58 <constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant> and
59 <constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant> flags to skip the respective
62 <para>The <structname>v4l2_buffer</structname> structure is
63 specified in <xref linkend="buffer" />.</para>
71 <term><errorcode>EBUSY</errorcode></term>
73 <para>File I/O is in progress.</para>
77 <term><errorcode>EINVAL</errorcode></term>
79 <para>The buffer <structfield>type</structfield> is not
80 supported, or the <structfield>index</structfield> is out of bounds,
81 or no buffers have been allocated yet, or the
82 <structfield>userptr</structfield> or
83 <structfield>length</structfield> are invalid.</para>