1 <refentry id="vidioc-g-edid">
3 <refentrytitle>ioctl VIDIOC_G_EDID, VIDIOC_S_EDID, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_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, zero the <structfield>reserved</structfield> array and call
75 <constant>VIDIOC_G_EDID</constant>. The current EDID from block
76 <structfield>start_block</structfield> and of size <structfield>blocks</structfield>
77 will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield>
78 pointer must point to memory at least <structfield>blocks</structfield> * 128 bytes
79 large (the size of one block is 128 bytes).</para>
81 <para>If there are fewer blocks than specified, then the driver will set <structfield>blocks</structfield>
82 to the actual number of blocks. If there are no EDID blocks available at all, then the error code
83 ENODATA is set.</para>
85 <para>If blocks have to be retrieved from the sink, then this call will block until they
86 have been read.</para>
88 <para>If <structfield>start_block</structfield> and <structfield>blocks</structfield> are
89 both set to 0 when <constant>VIDIOC_G_EDID</constant> is called, then the driver will
90 set <structfield>blocks</structfield> to the total number of available EDID blocks
91 and it will return 0 without copying any data. This is an easy way to discover how many
92 EDID blocks there are. Note that if there are no EDID blocks available at all, then
93 the driver will set <structfield>blocks</structfield> to 0 and it returns 0.</para>
95 <para>To set the EDID blocks of a receiver the application has to fill in the <structfield>pad</structfield>,
96 <structfield>blocks</structfield> and <structfield>edid</structfield> fields, set
97 <structfield>start_block</structfield> to 0 and zero the <structfield>reserved</structfield> array.
98 It is not possible to set part of an EDID,
99 it is always all or nothing. Setting the EDID data is only valid for receivers as it makes
100 no sense for a transmitter.</para>
102 <para>The driver assumes that the full EDID is passed in. If there are more EDID blocks than
103 the hardware can handle then the EDID is not written, but instead the error code E2BIG is set
104 and <structfield>blocks</structfield> is set to the maximum that the hardware supports.
105 If <structfield>start_block</structfield> is any
106 value other than 0 then the error code EINVAL is set.</para>
108 <para>To disable an EDID you set <structfield>blocks</structfield> to 0. Depending on the
109 hardware this will drive the hotplug pin low and/or block the source from reading the EDID
110 data in some way. In any case, the end result is the same: the EDID is no longer available.
113 <table pgwide="1" frame="none" id="v4l2-edid">
114 <title>struct <structname>v4l2_edid</structname></title>
120 <entry><structfield>pad</structfield></entry>
121 <entry>Pad for which to get/set the EDID blocks. When used with a video device
122 node the pad represents the input or output index as returned by
123 &VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; respectively.</entry>
127 <entry><structfield>start_block</structfield></entry>
128 <entry>Read the EDID from starting with this block. Must be 0 when setting
133 <entry><structfield>blocks</structfield></entry>
134 <entry>The number of blocks to get or set. Must be less or equal to 256 (the
135 maximum number of blocks as defined by the standard). When you set the EDID and
136 <structfield>blocks</structfield> is 0, then the EDID is disabled or erased.</entry>
140 <entry><structfield>reserved</structfield>[5]</entry>
141 <entry>Reserved for future extensions. Applications and drivers must
142 set the array to zero.</entry>
145 <entry>__u8 *</entry>
146 <entry><structfield>edid</structfield></entry>
147 <entry>Pointer to memory that contains the EDID. The minimum size is
148 <structfield>blocks</structfield> * 128.</entry>
160 <term><errorcode>ENODATA</errorcode></term>
162 <para>The EDID data is not available.</para>
166 <term><errorcode>E2BIG</errorcode></term>
168 <para>The EDID data you provided is more than the hardware can handle.</para>