2 * Copyright © 2007-2008 Intel Corporation
3 * Jesse Barnes <jesse.barnes@intel.com>
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef __DRM_EDID_H__
24 #define __DRM_EDID_H__
26 #include <linux/types.h>
28 #define EDID_LENGTH 128
32 #error "EDID structure is little endian, need big endian versions"
39 } __attribute__((packed));
42 u8 hsize; /* need to multiply by 8 then add 248 */
43 u8 vfreq:6; /* need to add 60 */
44 u8 aspect_ratio:2; /* 00=16:10, 01=4:3, 10=5:4, 11=16:9 */
45 } __attribute__((packed));
47 /* If detailed data is pixel timing */
48 struct detailed_pixel_timing {
58 u8 hsync_pulse_width_lo;
59 u8 vsync_pulse_width_lo:4;
61 u8 vsync_pulse_width_hi:2;
63 u8 hsync_pulse_width_hi:2;
78 } __attribute__((packed));
80 /* If it's not pixel timing, it'll be one of the below */
81 struct detailed_data_string {
83 } __attribute__((packed));
85 struct detailed_data_monitor_range {
90 u8 pixel_clock_mhz; /* need to multiply by 10 */
91 u16 sec_gtf_toggle; /* A000=use above, 20=use below */ /* FIXME: byte order */
92 u8 hfreq_start_khz; /* need to multiply by 2 */
93 u8 c; /* need to divide by 2 */
94 u16 m; /* FIXME: byte order */
96 u8 j; /* need to divide by 2 */
97 } __attribute__((packed));
99 struct detailed_data_wpindex {
105 u8 gamma; /* need to divide by 100 then add 1 */
106 } __attribute__((packed));
108 struct detailed_data_color_point {
113 } __attribute__((packed));
115 struct detailed_non_pixel {
117 u8 type; /* ff=serial, fe=string, fd=monitor range, fc=monitor name
118 fb=color point data, fa=standard timing data,
119 f9=undefined, f8=mfg. reserved */
122 struct detailed_data_string str;
123 struct detailed_data_monitor_range range;
124 struct detailed_data_wpindex color;
125 struct std_timing timings[5];
127 } __attribute__((packed));
129 #define EDID_DETAIL_STD_MODES 0xfa
130 #define EDID_DETAIL_MONITOR_CPDATA 0xfb
131 #define EDID_DETAIL_MONITOR_NAME 0xfc
132 #define EDID_DETAIL_MONITOR_RANGE 0xfd
133 #define EDID_DETAIL_MONITOR_STRING 0xfe
134 #define EDID_DETAIL_MONITOR_SERIAL 0xff
136 struct detailed_timing {
137 u16 pixel_clock; /* need to multiply by 10 KHz */ /* FIXME: byte order */
139 struct detailed_pixel_timing pixel_data;
140 struct detailed_non_pixel other_data;
142 } __attribute__((packed));
146 /* Vendor & product info */
149 u32 serial; /* FIXME: byte order */
156 /* input definition */
157 u8 serration_vsync:1;
163 u8 digital:1; /* bits below must be zero if set */
167 /* feature support */
169 u8 preferred_timing:1;
171 u8 display_type:2; /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */
175 /* Color characteristics */
186 /* Est. timings and mfg rsvd timings*/
187 struct est_timings established_timings;
188 /* Standard timings 1-8*/
189 struct std_timing standard_timings[8];
190 /* Detailing timings 1-4 */
191 struct detailed_timing detailed_timings[4];
192 /* Number of 128 byte ext. blocks */
196 } __attribute__((packed));
198 #endif /* little endian structs */
200 #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8))
202 #endif /* __DRM_EDID_H__ */