1 <refentry id="vidioc-g-edid">
3 <refentrytitle>ioctl VIDIOC_G_EDID, VIDIOC_S_EDID</refentrytitle>
8 <refname>VIDIOC_G_EDID</refname>
9 <refname>VIDIOC_S_EDID</refname>
10 <refname>VIDIOC_SUBDEV_G_EDID</refname>
11 <refname>VIDIOC_SUBDEV_S_EDID</refname>
12 <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose>
18 <funcdef>int <function>ioctl</function></funcdef>
19 <paramdef>int <parameter>fd</parameter></paramdef>
20 <paramdef>int <parameter>request</parameter></paramdef>
21 <paramdef>struct v4l2_edid *<parameter>argp</parameter></paramdef>
26 <funcdef>int <function>ioctl</function></funcdef>
27 <paramdef>int <parameter>fd</parameter></paramdef>
28 <paramdef>int <parameter>request</parameter></paramdef>
29 <paramdef>struct v4l2_edid *<parameter>argp</parameter></paramdef>
35 <title>Arguments</title>
39 <term><parameter>fd</parameter></term>
45 <term><parameter>request</parameter></term>
47 <para>VIDIOC_G_EDID, VIDIOC_S_EDID, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para>
51 <term><parameter>argp</parameter></term>
60 <title>Description</title>
61 <para>These ioctls can be used to get or set an EDID associated with an input
62 from a receiver or an output of a transmitter device. They can be
63 used with subdevice nodes (/dev/v4l-subdevX) or with video nodes (/dev/videoX).</para>
65 <para>When used with video nodes the <structfield>pad</structfield> field represents the
66 input (for video capture devices) or output (for video output devices) index as
67 is returned by &VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; respectively. When used
68 with subdevice nodes the <structfield>pad</structfield> field represents the
69 input or output pad of the subdevice. If there is no EDID support for the given
70 <structfield>pad</structfield> value, then the &EINVAL; will be returned.</para>
72 <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>,
73 <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield>
74 fields and call <constant>VIDIOC_G_EDID</constant>. The current EDID from block
75 <structfield>start_block</structfield> and of size <structfield>blocks</structfield>
76 will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield>
77 pointer must point to memory at least <structfield>blocks</structfield> * 128 bytes
78 large (the size of one block is 128 bytes).</para>
80 <para>If there are fewer blocks than specified, then the driver will set <structfield>blocks</structfield>
81 to the actual number of blocks. If there are no EDID blocks available at all, then the error code
82 ENODATA is set.</para>
84 <para>If blocks have to be retrieved from the sink, then this call will block until they
85 have been read.</para>
87 <para>If <structfield>start_block</structfield> and <structfield>blocks</structfield> are
88 both set to 0 when <constant>VIDIOC_G_EDID</constant> is called, then the driver will
89 set <structfield>blocks</structfield> to the total number of available EDID blocks
90 and it will return 0 without copying any data. This is an easy way to discover how many
91 EDID blocks there are. Note that if there are no EDID blocks available at all, then
92 the driver will set <structfield>blocks</structfield> to 0 and it returns 0.</para>
94 <para>To set the EDID blocks of a receiver the application has to fill in the <structfield>pad</structfield>,
95 <structfield>blocks</structfield> and <structfield>edid</structfield> fields and set
96 <structfield>start_block</structfield> to 0. It is not possible to set part of an EDID,
97 it is always all or nothing. Setting the EDID data is only valid for receivers as it makes
98 no sense for a transmitter.</para>
100 <para>The driver assumes that the full EDID is passed in. If there are more EDID blocks than
101 the hardware can handle then the EDID is not written, but instead the error code E2BIG is set
102 and <structfield>blocks</structfield> is set to the maximum that the hardware supports.
103 If <structfield>start_block</structfield> is any
104 value other than 0 then the error code EINVAL is set.</para>
106 <para>To disable an EDID you set <structfield>blocks</structfield> to 0. Depending on the
107 hardware this will drive the hotplug pin low and/or block the source from reading the EDID
108 data in some way. In any case, the end result is the same: the EDID is no longer available.
111 <table pgwide="1" frame="none" id="v4l2-edid">
112 <title>struct <structname>v4l2_edid</structname></title>
118 <entry><structfield>pad</structfield></entry>
119 <entry>Pad for which to get/set the EDID blocks. When used with a video device
120 node the pad represents the input or output index as returned by
121 &VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; respectively.</entry>
125 <entry><structfield>start_block</structfield></entry>
126 <entry>Read the EDID from starting with this block. Must be 0 when setting
131 <entry><structfield>blocks</structfield></entry>
132 <entry>The number of blocks to get or set. Must be less or equal to 256 (the
133 maximum number of blocks as defined by the standard). When you set the EDID and
134 <structfield>blocks</structfield> is 0, then the EDID is disabled or erased.</entry>
138 <entry><structfield>reserved</structfield>[5]</entry>
139 <entry>Reserved for future extensions. Applications and drivers must
140 set the array to zero.</entry>
143 <entry>__u8 *</entry>
144 <entry><structfield>edid</structfield></entry>
145 <entry>Pointer to memory that contains the EDID. The minimum size is
146 <structfield>blocks</structfield> * 128.</entry>
158 <term><errorcode>ENODATA</errorcode></term>
160 <para>The EDID data is not available.</para>
164 <term><errorcode>E2BIG</errorcode></term>
166 <para>The EDID data you provided is more than the hardware can handle.</para>