Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * drivers/video/edid.h - EDID/DDC Header | |
3 | * | |
4 | * Based on: | |
5 | * 1. XFree86 4.3.0, edid.h | |
6 | * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE> | |
7 | * | |
8 | * 2. John Fremlin <vii@users.sourceforge.net> and | |
9 | * Ani Joshi <ajoshi@unixbox.com> | |
10 | * | |
11 | * DDC is a Trademark of VESA (Video Electronics Standard Association). | |
12 | * | |
13 | * This file is subject to the terms and conditions of the GNU General Public | |
14 | * License. See the file COPYING in the main directory of this archive | |
15 | * for more details. | |
16 | */ | |
17 | ||
18 | #ifndef __EDID_H__ | |
19 | #define __EDID_H__ | |
20 | ||
21 | #define EDID_LENGTH 0x80 | |
22 | #define EDID_HEADER 0x00 | |
23 | #define EDID_HEADER_END 0x07 | |
24 | ||
25 | #define ID_MANUFACTURER_NAME 0x08 | |
26 | #define ID_MANUFACTURER_NAME_END 0x09 | |
27 | #define ID_MODEL 0x0a | |
28 | ||
29 | #define ID_SERIAL_NUMBER 0x0c | |
30 | ||
31 | #define MANUFACTURE_WEEK 0x10 | |
32 | #define MANUFACTURE_YEAR 0x11 | |
33 | ||
34 | #define EDID_STRUCT_VERSION 0x12 | |
35 | #define EDID_STRUCT_REVISION 0x13 | |
36 | ||
37 | #define EDID_STRUCT_DISPLAY 0x14 | |
38 | ||
39 | #define DPMS_FLAGS 0x18 | |
40 | #define ESTABLISHED_TIMING_1 0x23 | |
41 | #define ESTABLISHED_TIMING_2 0x24 | |
42 | #define MANUFACTURERS_TIMINGS 0x25 | |
43 | ||
44 | /* standard timings supported */ | |
45 | #define STD_TIMING 8 | |
46 | #define STD_TIMING_DESCRIPTION_SIZE 2 | |
47 | #define STD_TIMING_DESCRIPTIONS_START 0x26 | |
48 | ||
49 | #define DETAILED_TIMING_DESCRIPTIONS_START 0x36 | |
50 | #define DETAILED_TIMING_DESCRIPTION_SIZE 18 | |
51 | #define NO_DETAILED_TIMING_DESCRIPTIONS 4 | |
52 | ||
53 | #define DETAILED_TIMING_DESCRIPTION_1 0x36 | |
54 | #define DETAILED_TIMING_DESCRIPTION_2 0x48 | |
55 | #define DETAILED_TIMING_DESCRIPTION_3 0x5a | |
56 | #define DETAILED_TIMING_DESCRIPTION_4 0x6c | |
57 | ||
58 | #define DESCRIPTOR_DATA 5 | |
59 | ||
3c2a0909 S |
60 | /* vendor specific data block */ |
61 | #define VSDB_LATENCY_FIELD 7 | |
62 | #define VSDB_LATENCY_FIELD_MASK (1 << 7) | |
63 | #define VSDB_I_LATENCY_FIELD 6 | |
64 | #define VSDB_I_LATENCY_FIELD_MASK (1 << 6) | |
65 | #define VSDB_VIDEO_PRESENT 5 | |
66 | #define VSDB_VIDEO_PRESENT_MASK (1 << 5) | |
67 | #define VSDB_VIC_LEN 5 | |
68 | #define VSDB_VIC_LEN_MASK (0x7 << 5) | |
69 | #define VSDB_VIC_ORDER 4 | |
70 | #define VSDB_VIC_ORDER_MASK (0xf << 4) | |
71 | #define VSDB_3D_MASK 2 | |
72 | #define VSDB_3D_LEN_MASK 0x1f | |
73 | #define VSDB_3D_STRUCTURE_MASK 0xf | |
74 | #define VSDB_3D_PRESENT 7 | |
75 | #define VSDB_3D_PRESENT_MASK (1 << 7) | |
76 | #define VSDB_3D_MT_PRESENT 5 | |
77 | #define VSDB_3D_MT_PRESENT_MASK (0x3 << 5) | |
78 | ||
1da177e4 LT |
79 | #define UPPER_NIBBLE( x ) \ |
80 | (((128|64|32|16) & (x)) >> 4) | |
81 | ||
82 | #define LOWER_NIBBLE( x ) \ | |
83 | ((1|2|4|8) & (x)) | |
84 | ||
85 | #define COMBINE_HI_8LO( hi, lo ) \ | |
86 | ( (((unsigned)hi) << 8) | (unsigned)lo ) | |
87 | ||
88 | #define COMBINE_HI_4LO( hi, lo ) \ | |
89 | ( (((unsigned)hi) << 4) | (unsigned)lo ) | |
90 | ||
91 | #define PIXEL_CLOCK_LO (unsigned)block[ 0 ] | |
92 | #define PIXEL_CLOCK_HI (unsigned)block[ 1 ] | |
93 | #define PIXEL_CLOCK (COMBINE_HI_8LO( PIXEL_CLOCK_HI,PIXEL_CLOCK_LO )*10000) | |
94 | #define H_ACTIVE_LO (unsigned)block[ 2 ] | |
95 | #define H_BLANKING_LO (unsigned)block[ 3 ] | |
96 | #define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 4 ] ) | |
97 | #define H_ACTIVE COMBINE_HI_8LO( H_ACTIVE_HI, H_ACTIVE_LO ) | |
98 | #define H_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 4 ] ) | |
99 | #define H_BLANKING COMBINE_HI_8LO( H_BLANKING_HI, H_BLANKING_LO ) | |
100 | ||
101 | #define V_ACTIVE_LO (unsigned)block[ 5 ] | |
102 | #define V_BLANKING_LO (unsigned)block[ 6 ] | |
103 | #define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 7 ] ) | |
104 | #define V_ACTIVE COMBINE_HI_8LO( V_ACTIVE_HI, V_ACTIVE_LO ) | |
105 | #define V_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 7 ] ) | |
106 | #define V_BLANKING COMBINE_HI_8LO( V_BLANKING_HI, V_BLANKING_LO ) | |
107 | ||
108 | #define H_SYNC_OFFSET_LO (unsigned)block[ 8 ] | |
109 | #define H_SYNC_WIDTH_LO (unsigned)block[ 9 ] | |
110 | ||
111 | #define V_SYNC_OFFSET_LO UPPER_NIBBLE( (unsigned)block[ 10 ] ) | |
112 | #define V_SYNC_WIDTH_LO LOWER_NIBBLE( (unsigned)block[ 10 ] ) | |
113 | ||
114 | #define V_SYNC_WIDTH_HI ((unsigned)block[ 11 ] & (1|2)) | |
115 | #define V_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (4|8)) >> 2) | |
116 | ||
117 | #define H_SYNC_WIDTH_HI (((unsigned)block[ 11 ] & (16|32)) >> 4) | |
118 | #define H_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (64|128)) >> 6) | |
119 | ||
120 | #define V_SYNC_WIDTH COMBINE_HI_4LO( V_SYNC_WIDTH_HI, V_SYNC_WIDTH_LO ) | |
121 | #define V_SYNC_OFFSET COMBINE_HI_4LO( V_SYNC_OFFSET_HI, V_SYNC_OFFSET_LO ) | |
122 | ||
dfc906da MD |
123 | #define H_SYNC_WIDTH COMBINE_HI_8LO( H_SYNC_WIDTH_HI, H_SYNC_WIDTH_LO ) |
124 | #define H_SYNC_OFFSET COMBINE_HI_8LO( H_SYNC_OFFSET_HI, H_SYNC_OFFSET_LO ) | |
1da177e4 LT |
125 | |
126 | #define H_SIZE_LO (unsigned)block[ 12 ] | |
127 | #define V_SIZE_LO (unsigned)block[ 13 ] | |
128 | ||
129 | #define H_SIZE_HI UPPER_NIBBLE( (unsigned)block[ 14 ] ) | |
130 | #define V_SIZE_HI LOWER_NIBBLE( (unsigned)block[ 14 ] ) | |
131 | ||
132 | #define H_SIZE COMBINE_HI_8LO( H_SIZE_HI, H_SIZE_LO ) | |
133 | #define V_SIZE COMBINE_HI_8LO( V_SIZE_HI, V_SIZE_LO ) | |
134 | ||
135 | #define H_BORDER (unsigned)block[ 15 ] | |
136 | #define V_BORDER (unsigned)block[ 16 ] | |
137 | ||
138 | #define FLAGS (unsigned)block[ 17 ] | |
139 | ||
140 | #define INTERLACED (FLAGS&128) | |
141 | #define SYNC_TYPE (FLAGS&3<<3) /* bits 4,3 */ | |
142 | #define SYNC_SEPARATE (3<<3) | |
143 | #define HSYNC_POSITIVE (FLAGS & 4) | |
144 | #define VSYNC_POSITIVE (FLAGS & 2) | |
145 | ||
146 | #define V_MIN_RATE block[ 5 ] | |
147 | #define V_MAX_RATE block[ 6 ] | |
148 | #define H_MIN_RATE block[ 7 ] | |
149 | #define H_MAX_RATE block[ 8 ] | |
150 | #define MAX_PIXEL_CLOCK (((int)block[ 9 ]) * 10) | |
151 | #define GTF_SUPPORT block[10] | |
152 | ||
153 | #define DPMS_ACTIVE_OFF (1 << 5) | |
154 | #define DPMS_SUSPEND (1 << 6) | |
155 | #define DPMS_STANDBY (1 << 7) | |
156 | ||
157 | #endif /* __EDID_H__ */ |