diff options
Diffstat (limited to 'Documentation/DocBook/media/v4l/vidioc-reqbufs.xml')
-rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-reqbufs.xml | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml index 2b50ef2007f3..78a06a9a5ece 100644 --- a/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml +++ b/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml | |||
@@ -48,28 +48,30 @@ | |||
48 | <refsect1> | 48 | <refsect1> |
49 | <title>Description</title> | 49 | <title>Description</title> |
50 | 50 | ||
51 | <para>This ioctl is used to initiate <link linkend="mmap">memory | 51 | <para>This ioctl is used to initiate <link linkend="mmap">memory mapped</link>, |
52 | mapped</link> or <link linkend="userp">user pointer</link> | 52 | <link linkend="userp">user pointer</link> or <link |
53 | I/O. Memory mapped buffers are located in device memory and must be | 53 | linkend="dmabuf">DMABUF</link> based I/O. Memory mapped buffers are located in |
54 | allocated with this ioctl before they can be mapped into the | 54 | device memory and must be allocated with this ioctl before they can be mapped |
55 | application's address space. User buffers are allocated by | 55 | into the application's address space. User buffers are allocated by |
56 | applications themselves, and this ioctl is merely used to switch the | 56 | applications themselves, and this ioctl is merely used to switch the driver |
57 | driver into user pointer I/O mode and to setup some internal structures.</para> | 57 | into user pointer I/O mode and to setup some internal structures. |
58 | Similarly, DMABUF buffers are allocated by applications through a device | ||
59 | driver, and this ioctl only configures the driver into DMABUF I/O mode without | ||
60 | performing any direct allocation.</para> | ||
58 | 61 | ||
59 | <para>To allocate device buffers applications initialize all | 62 | <para>To allocate device buffers applications initialize all fields of the |
60 | fields of the <structname>v4l2_requestbuffers</structname> structure. | 63 | <structname>v4l2_requestbuffers</structname> structure. They set the |
61 | They set the <structfield>type</structfield> field to the respective | 64 | <structfield>type</structfield> field to the respective stream or buffer type, |
62 | stream or buffer type, the <structfield>count</structfield> field to | 65 | the <structfield>count</structfield> field to the desired number of buffers, |
63 | the desired number of buffers, <structfield>memory</structfield> | 66 | <structfield>memory</structfield> must be set to the requested I/O method and |
64 | must be set to the requested I/O method and the <structfield>reserved</structfield> array | 67 | the <structfield>reserved</structfield> array must be zeroed. When the ioctl is |
65 | must be zeroed. When the ioctl | 68 | called with a pointer to this structure the driver will attempt to allocate the |
66 | is called with a pointer to this structure the driver will attempt to allocate | 69 | requested number of buffers and it stores the actual number allocated in the |
67 | the requested number of buffers and it stores the actual number | 70 | <structfield>count</structfield> field. It can be smaller than the number |
68 | allocated in the <structfield>count</structfield> field. It can be | 71 | requested, even zero, when the driver runs out of free memory. A larger number |
69 | smaller than the number requested, even zero, when the driver runs out | 72 | is also possible when the driver requires more buffers to function correctly. |
70 | of free memory. A larger number is also possible when the driver requires | 73 | For example video output requires at least two buffers, one displayed and one |
71 | more buffers to function correctly. For example video output requires at least two buffers, | 74 | filled by the application.</para> |
72 | one displayed and one filled by the application.</para> | ||
73 | <para>When the I/O method is not supported the ioctl | 75 | <para>When the I/O method is not supported the ioctl |
74 | returns an &EINVAL;.</para> | 76 | returns an &EINVAL;.</para> |
75 | 77 | ||
@@ -102,7 +104,8 @@ as the &v4l2-format; <structfield>type</structfield> field. See <xref | |||
102 | <entry>__u32</entry> | 104 | <entry>__u32</entry> |
103 | <entry><structfield>memory</structfield></entry> | 105 | <entry><structfield>memory</structfield></entry> |
104 | <entry>Applications set this field to | 106 | <entry>Applications set this field to |
105 | <constant>V4L2_MEMORY_MMAP</constant> or | 107 | <constant>V4L2_MEMORY_MMAP</constant>, |
108 | <constant>V4L2_MEMORY_DMABUF</constant> or | ||
106 | <constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory" | 109 | <constant>V4L2_MEMORY_USERPTR</constant>. See <xref linkend="v4l2-memory" |
107 | />.</entry> | 110 | />.</entry> |
108 | </row> | 111 | </row> |