blob: eda1a2991bbe4382f717c5407295407220250161 [file] [log] [blame]
Muralidharan Karicheri007701e2009-12-03 01:13:17 -03001<refentry id="vidioc-g-dv-timings">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_DV_TIMINGS</refname>
9 <refname>VIDIOC_S_DV_TIMINGS</refname>
Hans Verkuil7dcc6062012-05-15 08:04:28 -030010 <refpurpose>Get or set DV timings for input or output</refpurpose>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -030011 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
Hans Verkuil5e765c62010-09-11 08:36:55 -030019 <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -030020 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
Hans Verkuil7dcc6062012-05-15 08:04:28 -030051 <para>To set DV timings for the input or output, applications use the
52<constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current timings,
Muralidharan Karicheri007701e2009-12-03 01:13:17 -030053applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing
54information is filled in using the structure &v4l2-dv-timings;. These ioctls take
55a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported
56or the timing values are not correct, the driver returns &EINVAL;.</para>
Hans Verkuil7dcc6062012-05-15 08:04:28 -030057<para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the
58timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" />
59standards.</para>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -030060 </refsect1>
61
62 <refsect1>
63 &return-value;
64
65 <variablelist>
66 <varlistentry>
67 <term><errorcode>EINVAL</errorcode></term>
68 <listitem>
69 <para>This ioctl is not supported, or the
70<constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para>
71 </listitem>
72 </varlistentry>
73 <varlistentry>
74 <term><errorcode>EBUSY</errorcode></term>
75 <listitem>
76 <para>The device is busy and therefore can not change the timings.</para>
77 </listitem>
78 </varlistentry>
79 </variablelist>
80
81 <table pgwide="1" frame="none" id="v4l2-bt-timings">
82 <title>struct <structname>v4l2_bt_timings</structname></title>
83 <tgroup cols="3">
84 &cs-str;
85 <tbody valign="top">
86 <row>
87 <entry>__u32</entry>
88 <entry><structfield>width</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -030089 <entry>Width of the active video in pixels.</entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -030090 </row>
91 <row>
92 <entry>__u32</entry>
93 <entry><structfield>height</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -030094 <entry>Height of the active video frame in lines. So for interlaced formats the
95 height of the active video in each field is <structfield>height</structfield>/2.</entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -030096 </row>
97 <row>
98 <entry>__u32</entry>
99 <entry><structfield>interlaced</structfield></entry>
100 <entry>Progressive (0) or interlaced (1)</entry>
101 </row>
102 <row>
103 <entry>__u32</entry>
104 <entry><structfield>polarities</structfield></entry>
105 <entry>This is a bit mask that defines polarities of sync signals.
106bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit 1 (V4L2_DV_HSYNC_POS_POL) is for horizontal sync polarity. If the bit is set
107(1) it is positive polarity and if is cleared (0), it is negative polarity.</entry>
108 </row>
109 <row>
110 <entry>__u64</entry>
111 <entry><structfield>pixelclock</structfield></entry>
112 <entry>Pixel clock in Hz. Ex. 74.25MHz->74250000</entry>
113 </row>
114 <row>
115 <entry>__u32</entry>
116 <entry><structfield>hfrontporch</structfield></entry>
117 <entry>Horizontal front porch in pixels</entry>
118 </row>
119 <row>
120 <entry>__u32</entry>
121 <entry><structfield>hsync</structfield></entry>
122 <entry>Horizontal sync length in pixels</entry>
123 </row>
124 <row>
125 <entry>__u32</entry>
126 <entry><structfield>hbackporch</structfield></entry>
127 <entry>Horizontal back porch in pixels</entry>
128 </row>
129 <row>
130 <entry>__u32</entry>
131 <entry><structfield>vfrontporch</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -0300132 <entry>Vertical front porch in lines. For interlaced formats this refers to the
133 odd field (aka field 1).</entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300134 </row>
135 <row>
136 <entry>__u32</entry>
137 <entry><structfield>vsync</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -0300138 <entry>Vertical sync length in lines. For interlaced formats this refers to the
139 odd field (aka field 1).</entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300140 </row>
141 <row>
142 <entry>__u32</entry>
143 <entry><structfield>vbackporch</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -0300144 <entry>Vertical back porch in lines. For interlaced formats this refers to the
145 odd field (aka field 1).</entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300146 </row>
147 <row>
148 <entry>__u32</entry>
149 <entry><structfield>il_vfrontporch</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -0300150 <entry>Vertical front porch in lines for the even field (aka field 2) of
151 interlaced field formats.</entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300152 </row>
153 <row>
154 <entry>__u32</entry>
155 <entry><structfield>il_vsync</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -0300156 <entry>Vertical sync length in lines for the even field (aka field 2) of
157 interlaced field formats.</entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300158 </row>
159 <row>
160 <entry>__u32</entry>
161 <entry><structfield>il_vbackporch</structfield></entry>
Hans Verkuil7dcc6062012-05-15 08:04:28 -0300162 <entry>Vertical back porch in lines for the even field (aka field 2) of
163 interlaced field formats.</entry>
164 </row>
165 <row>
166 <entry>__u32</entry>
167 <entry><structfield>standards</structfield></entry>
168 <entry>The video standard(s) this format belongs to. This will be filled in by
169 the driver. Applications must set this to 0. See <xref linkend="dv-bt-standards"/>
170 for a list of standards.</entry>
171 </row>
172 <row>
173 <entry>__u32</entry>
174 <entry><structfield>flags</structfield></entry>
175 <entry>Several flags giving more information about the format.
176 See <xref linkend="dv-bt-flags"/> for a description of the flags.
177 </entry>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300178 </row>
179 </tbody>
180 </tgroup>
181 </table>
182
183 <table pgwide="1" frame="none" id="v4l2-dv-timings">
184 <title>struct <structname>v4l2_dv_timings</structname></title>
185 <tgroup cols="4">
186 &cs-str;
187 <tbody valign="top">
188 <row>
189 <entry>__u32</entry>
190 <entry><structfield>type</structfield></entry>
191 <entry></entry>
192 <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry>
193 </row>
194 <row>
195 <entry>union</entry>
196 <entry><structfield></structfield></entry>
197 <entry></entry>
198 </row>
199 <row>
200 <entry></entry>
201 <entry>&v4l2-bt-timings;</entry>
202 <entry><structfield>bt</structfield></entry>
203 <entry>Timings defined by BT.656/1120 specifications</entry>
204 </row>
205 <row>
206 <entry></entry>
207 <entry>__u32</entry>
208 <entry><structfield>reserved</structfield>[32]</entry>
209 <entry></entry>
210 </row>
211 </tbody>
212 </tgroup>
213 </table>
214
215 <table pgwide="1" frame="none" id="dv-timing-types">
216 <title>DV Timing types</title>
217 <tgroup cols="3">
218 &cs-str;
219 <tbody valign="top">
220 <row>
221 <entry>Timing type</entry>
222 <entry>value</entry>
223 <entry>Description</entry>
224 </row>
225 <row>
226 <entry></entry>
227 <entry></entry>
228 <entry></entry>
229 </row>
230 <row>
231 <entry>V4L2_DV_BT_656_1120</entry>
232 <entry>0</entry>
233 <entry>BT.656/1120 timings</entry>
234 </row>
235 </tbody>
236 </tgroup>
237 </table>
Hans Verkuil7dcc6062012-05-15 08:04:28 -0300238 <table pgwide="1" frame="none" id="dv-bt-standards">
239 <title>DV BT Timing standards</title>
240 <tgroup cols="2">
241 &cs-str;
242 <tbody valign="top">
243 <row>
244 <entry>Timing standard</entry>
245 <entry>Description</entry>
246 </row>
247 <row>
248 <entry></entry>
249 <entry></entry>
250 </row>
251 <row>
252 <entry>V4L2_DV_BT_STD_CEA861</entry>
253 <entry>The timings follow the CEA-861 Digital TV Profile standard</entry>
254 </row>
255 <row>
256 <entry>V4L2_DV_BT_STD_DMT</entry>
257 <entry>The timings follow the VESA Discrete Monitor Timings standard</entry>
258 </row>
259 <row>
260 <entry>V4L2_DV_BT_STD_CVT</entry>
261 <entry>The timings follow the VESA Coordinated Video Timings standard</entry>
262 </row>
263 <row>
264 <entry>V4L2_DV_BT_STD_GTF</entry>
265 <entry>The timings follow the VESA Generalized Timings Formula standard</entry>
266 </row>
267 </tbody>
268 </tgroup>
269 </table>
270 <table pgwide="1" frame="none" id="dv-bt-flags">
271 <title>DV BT Timing flags</title>
272 <tgroup cols="2">
273 &cs-str;
274 <tbody valign="top">
275 <row>
276 <entry>Flag</entry>
277 <entry>Description</entry>
278 </row>
279 <row>
280 <entry></entry>
281 <entry></entry>
282 </row>
283 <row>
284 <entry>V4L2_DV_FL_REDUCED_BLANKING</entry>
285 <entry>CVT/GTF specific: the timings use reduced blanking (CVT) or the 'Secondary
286GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
287intervals are reduced, allowing a higher resolution over the same
288bandwidth. This is a read-only flag, applications must not set this.
289 </entry>
290 </row>
291 <row>
292 <entry>V4L2_DV_FL_CAN_REDUCE_FPS</entry>
293 <entry>CEA-861 specific: set for CEA-861 formats with a framerate that is a multiple
294of six. These formats can be optionally played at 1 / 1.001 speed to
295be compatible with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
29629.97 frames per second. If the transmitter can't generate such frequencies, then the
297flag will also be cleared. This is a read-only flag, applications must not set this.
298 </entry>
299 </row>
300 <row>
301 <entry>V4L2_DV_FL_REDUCED_FPS</entry>
302 <entry>CEA-861 specific: only valid for video transmitters, the flag is cleared
303by receivers. It is also only valid for formats with the V4L2_DV_FL_CAN_REDUCE_FPS flag
304set, for other formats the flag will be cleared by the driver.
305
306If the application sets this flag, then the pixelclock used to set up the transmitter is
307divided by 1.001 to make it compatible with NTSC framerates. If the transmitter
308can't generate such frequencies, then the flag will also be cleared.
309 </entry>
310 </row>
311 <row>
312 <entry>V4L2_DV_FL_HALF_LINE</entry>
313 <entry>Specific to interlaced formats: if set, then field 1 (aka the odd field)
314is really one half-line longer and field 2 (aka the even field) is really one half-line
315shorter, so each field has exactly the same number of half-lines. Whether half-lines can be
316detected or used depends on the hardware.
317 </entry>
318 </row>
319 </tbody>
320 </tgroup>
321 </table>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300322 </refsect1>
Mauro Carvalho Chehab43c1daa2011-07-05 11:22:28 -0300323 <refsect1>
324 &return-value;
325 </refsect1>
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300326</refentry>