1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="user-func.html" title="Appendix A. Function Reference"><link rel="prev" href="vidioc-g-ctrl.html" title="ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL"><link rel="next" href="vidioc-g-edid.html" title="ioctl VIDIOC_G_EDID, VIDIOC_S_EDID"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-g-ctrl.html">Prev</a> </td><th width="60%" align="center">Appendix A. Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="vidioc-g-edid.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-g-dv-timings"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS — Get or set DV timings for input or output</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">request</var>, </td></tr><tr><td> </td><td>struct v4l2_dv_timings *<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1113870932"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1113875004"></a><h2>Description</h2><p>To set DV timings for the input or output, applications use the 2<code class="constant">VIDIOC_S_DV_TIMINGS</code> ioctl and to get the current timings, 3applications use the <code class="constant">VIDIOC_G_DV_TIMINGS</code> ioctl. The detailed timing 4information is filled in using the structure struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a>. These ioctls take 5a pointer to the struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-dv-timings" title="Table A.58. struct v4l2_dv_timings">v4l2_dv_timings</a> structure as argument. If the ioctl is not supported 6or the timing values are not correct, the driver returns <span class="errorcode">EINVAL</span> error code.</p><p>The <code class="filename">linux/v4l2-dv-timings.h</code> header can be used to get the 7timings of the formats in the <a class="xref" href="bi01.html#cea861" title="A DTV Profile for Uncompressed High Speed Digital Interfaces">[<abbr class="abbrev">CEA-861-E</abbr>]</a> and <a class="xref" href="bi01.html#vesadmt" title="VESA and Industry Standards and Guidelines for Computer Display Monitor Timing (DMT)">[<abbr class="abbrev">VESA DMT</abbr>]</a> 8standards. If the current input or output does not support DV timings (e.g. if 9<a class="link" href="vidioc-enuminput.html" title="ioctl VIDIOC_ENUMINPUT"><code class="constant">VIDIOC_ENUMINPUT</code></a> does not set the <code class="constant">V4L2_IN_CAP_DV_TIMINGS</code> flag), then 10<span class="errorcode">ENODATA</span> error code is returned.</p></div><div class="refsect1"><a name="idp1113879668"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>This ioctl is not supported, or the 11<code class="constant">VIDIOC_S_DV_TIMINGS</code> parameter was unsuitable.</p></dd><dt><span class="term"><span class="errorcode">ENODATA</span></span></dt><dd><p>Digital video timings are not supported for this input or output.</p></dd><dt><span class="term"><span class="errorcode">EBUSY</span></span></dt><dd><p>The device is busy and therefore can not change the timings.</p></dd></dl></div><div class="table"><a name="v4l2-bt-timings"></a><p class="title"><b>Table A.57. struct <span class="structname">v4l2_bt_timings</span></b></p><div class="table-contents"><table summary="struct v4l2_bt_timings" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>width</code></em></td><td valign="top">Width of the active video in pixels.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>height</code></em></td><td valign="top">Height of the active video frame in lines. So for interlaced formats the 12 height of the active video in each field is <em class="structfield"><code>height</code></em>/2.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>interlaced</code></em></td><td valign="top">Progressive (0) or interlaced (1)</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>polarities</code></em></td><td valign="top">This is a bit mask that defines polarities of sync signals. 13bit 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 14(1) it is positive polarity and if is cleared (0), it is negative polarity.</td></tr><tr><td valign="top">__u64</td><td valign="top"><em class="structfield"><code>pixelclock</code></em></td><td valign="top">Pixel clock in Hz. Ex. 74.25MHz->74250000</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>hfrontporch</code></em></td><td valign="top">Horizontal front porch in pixels</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>hsync</code></em></td><td valign="top">Horizontal sync length in pixels</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>hbackporch</code></em></td><td valign="top">Horizontal back porch in pixels</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>vfrontporch</code></em></td><td valign="top">Vertical front porch in lines. For interlaced formats this refers to the 15 odd field (aka field 1).</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>vsync</code></em></td><td valign="top">Vertical sync length in lines. For interlaced formats this refers to the 16 odd field (aka field 1).</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>vbackporch</code></em></td><td valign="top">Vertical back porch in lines. For interlaced formats this refers to the 17 odd field (aka field 1).</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>il_vfrontporch</code></em></td><td valign="top">Vertical front porch in lines for the even field (aka field 2) of 18 interlaced field formats. Must be 0 for progressive formats.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>il_vsync</code></em></td><td valign="top">Vertical sync length in lines for the even field (aka field 2) of 19 interlaced field formats. Must be 0 for progressive formats.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>il_vbackporch</code></em></td><td valign="top">Vertical back porch in lines for the even field (aka field 2) of 20 interlaced field formats. Must be 0 for progressive formats.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>standards</code></em></td><td valign="top">The video standard(s) this format belongs to. This will be filled in by 21 the driver. Applications must set this to 0. See <a class="xref" href="vidioc-g-dv-timings.html#dv-bt-standards" title="Table A.60. DV BT Timing standards">Table A.60, “DV BT Timing standards”</a> 22 for a list of standards.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>flags</code></em></td><td valign="top">Several flags giving more information about the format. 23 See <a class="xref" href="vidioc-g-dv-timings.html#dv-bt-flags" title="Table A.61. DV BT Timing flags">Table A.61, “DV BT Timing flags”</a> for a description of the flags. 24 </td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="v4l2-dv-timings"></a><p class="title"><b>Table A.58. struct <span class="structname">v4l2_dv_timings</span></b></p><div class="table-contents"><table summary="struct v4l2_dv_timings" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"><col></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>type</code></em></td><td valign="top"> </td><td valign="top">Type of DV timings as listed in <a class="xref" href="vidioc-g-dv-timings.html#dv-timing-types" title="Table A.59. DV Timing types">Table A.59, “DV Timing types”</a>.</td></tr><tr><td valign="top">union</td><td valign="top"><em class="structfield"><code></code></em></td><td valign="top"> </td><td class="auto-generated"> </td></tr><tr><td valign="top"> </td><td valign="top">struct <a class="link" href="vidioc-g-dv-timings.html#v4l2-bt-timings" title="Table A.57. struct v4l2_bt_timings">v4l2_bt_timings</a></td><td valign="top"><em class="structfield"><code>bt</code></em></td><td valign="top">Timings defined by BT.656/1120 specifications</td></tr><tr><td valign="top"> </td><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[32]</td><td valign="top"> </td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="dv-timing-types"></a><p class="title"><b>Table A.59. DV Timing types</b></p><div class="table-contents"><table summary="DV Timing types" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">Timing type</td><td valign="top">value</td><td valign="top">Description</td></tr><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">V4L2_DV_BT_656_1120</td><td valign="top">0</td><td valign="top">BT.656/1120 timings</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="dv-bt-standards"></a><p class="title"><b>Table A.60. DV BT Timing standards</b></p><div class="table-contents"><table summary="DV BT Timing standards" width="100%" border="0"><colgroup><col class="c1"><col class="c2"></colgroup><tbody valign="top"><tr><td valign="top">Timing standard</td><td valign="top">Description</td></tr><tr><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">V4L2_DV_BT_STD_CEA861</td><td valign="top">The timings follow the CEA-861 Digital TV Profile standard</td></tr><tr><td valign="top">V4L2_DV_BT_STD_DMT</td><td valign="top">The timings follow the VESA Discrete Monitor Timings standard</td></tr><tr><td valign="top">V4L2_DV_BT_STD_CVT</td><td valign="top">The timings follow the VESA Coordinated Video Timings standard</td></tr><tr><td valign="top">V4L2_DV_BT_STD_GTF</td><td valign="top">The timings follow the VESA Generalized Timings Formula standard</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="dv-bt-flags"></a><p class="title"><b>Table A.61. DV BT Timing flags</b></p><div class="table-contents"><table summary="DV BT Timing flags" width="100%" border="0"><colgroup><col class="c1"><col class="c2"></colgroup><tbody valign="top"><tr><td valign="top">Flag</td><td valign="top">Description</td></tr><tr><td valign="top"> </td><td valign="top"> </td></tr><tr><td valign="top">V4L2_DV_FL_REDUCED_BLANKING</td><td valign="top">CVT/GTF specific: the timings use reduced blanking (CVT) or the 'Secondary 25GTF' curve (GTF). In both cases the horizontal and/or vertical blanking 26intervals are reduced, allowing a higher resolution over the same 27bandwidth. This is a read-only flag, applications must not set this. 28 </td></tr><tr><td valign="top">V4L2_DV_FL_CAN_REDUCE_FPS</td><td valign="top">CEA-861 specific: set for CEA-861 formats with a framerate that is a multiple 29of six. These formats can be optionally played at 1 / 1.001 speed to 30be compatible with 60 Hz based standards such as NTSC and PAL-M that use a framerate of 3129.97 frames per second. If the transmitter can't generate such frequencies, then the 32flag will also be cleared. This is a read-only flag, applications must not set this. 33 </td></tr><tr><td valign="top">V4L2_DV_FL_REDUCED_FPS</td><td valign="top">CEA-861 specific: only valid for video transmitters, the flag is cleared 34by receivers. It is also only valid for formats with the V4L2_DV_FL_CAN_REDUCE_FPS flag 35set, for other formats the flag will be cleared by the driver. 36 37If the application sets this flag, then the pixelclock used to set up the transmitter is 38divided by 1.001 to make it compatible with NTSC framerates. If the transmitter 39can't generate such frequencies, then the flag will also be cleared. 40 </td></tr><tr><td valign="top">V4L2_DV_FL_HALF_LINE</td><td valign="top">Specific to interlaced formats: if set, then the vertical frontporch 41of field 1 (aka the odd field) is really one half-line longer and the vertical backporch 42of field 2 (aka the even field) is really one half-line shorter, so each field has exactly 43the same number of half-lines. Whether half-lines can be detected or used depends on 44the hardware. 45 </td></tr><tr><td valign="top">V4L2_DV_FL_IS_CE_VIDEO</td><td valign="top">If set, then this is a Consumer Electronics (CE) video format. 46Such formats differ from other formats (commonly called IT formats) in that if 47R'G'B' encoding is used then by default the R'G'B' values use limited range 48(i.e. 16-235) as opposed to full range (i.e. 0-255). All formats defined in CEA-861 49except for the 640x480p59.94 format are CE formats. 50 </td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="vidioc-g-ctrl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="vidioc-g-edid.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ioctl VIDIOC_G_EDID, VIDIOC_S_EDID</td></tr></table></div></body></html> 51