Merge remote-tracking branches 'spi/topic/octeon', 'spi/topic/omap2-mcspi', 'spi...
[cascardo/linux.git] / Documentation / DocBook / media / v4l / vidioc-query-dv-timings.xml
1 <refentry id="vidioc-query-dv-timings">
2   <refmeta>
3     <refentrytitle>ioctl VIDIOC_QUERY_DV_TIMINGS</refentrytitle>
4     &manvol;
5   </refmeta>
6
7   <refnamediv>
8     <refname>VIDIOC_QUERY_DV_TIMINGS</refname>
9     <refname>VIDIOC_SUBDEV_QUERY_DV_TIMINGS</refname>
10     <refpurpose>Sense the DV preset received by the current
11 input</refpurpose>
12   </refnamediv>
13
14   <refsynopsisdiv>
15     <funcsynopsis>
16       <funcprototype>
17         <funcdef>int <function>ioctl</function></funcdef>
18         <paramdef>int <parameter>fd</parameter></paramdef>
19         <paramdef>int <parameter>request</parameter></paramdef>
20         <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
21       </funcprototype>
22     </funcsynopsis>
23   </refsynopsisdiv>
24
25   <refsect1>
26     <title>Arguments</title>
27
28     <variablelist>
29         <varlistentry>
30         <term><parameter>fd</parameter></term>
31         <listitem>
32           <para>&fd;</para>
33         </listitem>
34       </varlistentry>
35       <varlistentry>
36         <term><parameter>request</parameter></term>
37         <listitem>
38           <para>VIDIOC_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERY_DV_TIMINGS</para>
39         </listitem>
40       </varlistentry>
41       <varlistentry>
42         <term><parameter>argp</parameter></term>
43         <listitem>
44           <para></para>
45         </listitem>
46       </varlistentry>
47     </variablelist>
48   </refsect1>
49
50   <refsect1>
51     <title>Description</title>
52
53     <note>
54       <title>Experimental</title>
55       <para>This is an <link linkend="experimental"> experimental </link>
56       interface and may change in the future.</para>
57     </note>
58
59     <para>The hardware may be able to detect the current DV timings
60 automatically, similar to sensing the video standard. To do so, applications
61 call <constant>VIDIOC_QUERY_DV_TIMINGS</constant> with a pointer to a
62 &v4l2-dv-timings;. Once the hardware detects the timings, it will fill in the
63 timings structure.</para>
64
65 <para>Please note that drivers shall <emphasis>not</emphasis> switch timings automatically
66 if new timings are detected. Instead, drivers should send the
67 <constant>V4L2_EVENT_SOURCE_CHANGE</constant> event (if they support this) and expect
68 that userspace will take action by calling <constant>VIDIOC_QUERY_DV_TIMINGS</constant>.
69 The reason is that new timings usually mean different buffer sizes as well, and you
70 cannot change buffer sizes on the fly. In general, applications that receive the
71 Source Change event will have to call <constant>VIDIOC_QUERY_DV_TIMINGS</constant>,
72 and if the detected timings are valid they will have to stop streaming, set the new
73 timings, allocate new buffers and start streaming again.</para>
74
75 <para>If the timings could not be detected because there was no signal, then
76 <errorcode>ENOLINK</errorcode> is returned. If a signal was detected, but
77 it was unstable and the receiver could not lock to the signal, then
78 <errorcode>ENOLCK</errorcode> is returned. If the receiver could lock to the signal,
79 but the format is unsupported (e.g. because the pixelclock is out of range
80 of the hardware capabilities), then the driver fills in whatever timings it
81 could find and returns <errorcode>ERANGE</errorcode>. In that case the application
82 can call &VIDIOC-DV-TIMINGS-CAP; to compare the found timings with the hardware's
83 capabilities in order to give more precise feedback to the user.
84 </para>
85   </refsect1>
86
87   <refsect1>
88     &return-value;
89
90     <variablelist>
91       <varlistentry>
92         <term><errorcode>ENODATA</errorcode></term>
93         <listitem>
94           <para>Digital video timings are not supported for this input or output.</para>
95         </listitem>
96       </varlistentry>
97       <varlistentry>
98         <term><errorcode>ENOLINK</errorcode></term>
99         <listitem>
100           <para>No timings could be detected because no signal was found.
101 </para>
102         </listitem>
103       </varlistentry>
104       <varlistentry>
105         <term><errorcode>ENOLCK</errorcode></term>
106         <listitem>
107           <para>The signal was unstable and the hardware could not lock on to it.
108 </para>
109         </listitem>
110       </varlistentry>
111       <varlistentry>
112         <term><errorcode>ERANGE</errorcode></term>
113         <listitem>
114           <para>Timings were found, but they are out of range of the hardware
115 capabilities.
116 </para>
117         </listitem>
118       </varlistentry>
119     </variablelist>
120   </refsect1>
121 </refentry>