VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.9.0/edid.h@ 61386

最後變更 在這個檔案從61386是 32168,由 vboxsync 提交於 14 年 前

X11 Additions: warnings

  • 屬性 svn:eol-style 設為 native
檔案大小: 18.5 KB
 
1/*
2 * edid.h: defines to parse an EDID block
3 *
4 * This file contains all information to interpret a standard EDIC block
5 * transmitted by a display device via DDC (Display Data Channel). So far
6 * there is no information to deal with optional EDID blocks.
7 * DDC is a Trademark of VESA (Video Electronics Standard Association).
8 *
9 * Copyright 1998 by Egbert Eich <[email protected]>
10 */
11
12#ifndef _EDID_H_
13#define _EDID_H_
14
15#include <X11/Xmd.h>
16
17#ifndef _X_EXPORT
18# include <X11/Xfuncproto.h>
19#endif
20
21/* read complete EDID record */
22#define EDID1_LEN 128
23#define BITS_PER_BYTE 9
24#define NUM BITS_PER_BYTE*EDID1_LEN
25#define HEADER 6
26
27#define STD_TIMINGS 8
28#define DET_TIMINGS 4
29
30#ifdef _PARSE_EDID_
31
32/* header: 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 */
33#define HEADER_SECTION 0
34#define HEADER_LENGTH 8
35
36/* vendor section */
37#define VENDOR_SECTION (HEADER_SECTION + HEADER_LENGTH)
38#define V_MANUFACTURER 0
39#define V_PROD_ID (V_MANUFACTURER + 2)
40#define V_SERIAL (V_PROD_ID + 2)
41#define V_WEEK (V_SERIAL + 4)
42#define V_YEAR (V_WEEK + 1)
43#define VENDOR_LENGTH (V_YEAR + 1)
44
45/* EDID version */
46#define VERSION_SECTION (VENDOR_SECTION + VENDOR_LENGTH)
47#define V_VERSION 0
48#define V_REVISION (V_VERSION + 1)
49#define VERSION_LENGTH (V_REVISION + 1)
50
51/* display information */
52#define DISPLAY_SECTION (VERSION_SECTION + VERSION_LENGTH)
53#define D_INPUT 0
54#define D_HSIZE (D_INPUT + 1)
55#define D_VSIZE (D_HSIZE + 1)
56#define D_GAMMA (D_VSIZE + 1)
57#define FEAT_S (D_GAMMA + 1)
58#define D_RG_LOW (FEAT_S + 1)
59#define D_BW_LOW (D_RG_LOW + 1)
60#define D_REDX (D_BW_LOW + 1)
61#define D_REDY (D_REDX + 1)
62#define D_GREENX (D_REDY + 1)
63#define D_GREENY (D_GREENX + 1)
64#define D_BLUEX (D_GREENY + 1)
65#define D_BLUEY (D_BLUEX + 1)
66#define D_WHITEX (D_BLUEY + 1)
67#define D_WHITEY (D_WHITEX + 1)
68#define DISPLAY_LENGTH (D_WHITEY + 1)
69
70/* supported VESA and other standard timings */
71#define ESTABLISHED_TIMING_SECTION (DISPLAY_SECTION + DISPLAY_LENGTH)
72#define E_T1 0
73#define E_T2 (E_T1 + 1)
74#define E_TMANU (E_T2 + 1)
75#define E_TIMING_LENGTH (E_TMANU + 1)
76
77/* non predefined standard timings supported by display */
78#define STD_TIMING_SECTION (ESTABLISHED_TIMING_SECTION + E_TIMING_LENGTH)
79#define STD_TIMING_INFO_LEN 2
80#define STD_TIMING_INFO_NUM STD_TIMINGS
81#define STD_TIMING_LENGTH (STD_TIMING_INFO_LEN * STD_TIMING_INFO_NUM)
82
83/* detailed timing info of non standard timings */
84#define DET_TIMING_SECTION (STD_TIMING_SECTION + STD_TIMING_LENGTH)
85#define DET_TIMING_INFO_LEN 18
86#define MONITOR_DESC_LEN DET_TIMING_INFO_LEN
87#define DET_TIMING_INFO_NUM DET_TIMINGS
88#define DET_TIMING_LENGTH (DET_TIMING_INFO_LEN * DET_TIMING_INFO_NUM)
89
90/* number of EDID sections to follow */
91#define NO_EDID (DET_TIMING_SECTION + DET_TIMING_LENGTH)
92/* one byte checksum */
93#define CHECKSUM (NO_EDID + 1)
94
95#if (CHECKSUM != (EDID1_LEN - 1))
96# error "EDID1 length != 128!"
97#endif
98
99
100#define SECTION(x,y) (Uchar *)(x + y)
101#define GET_ARRAY(y) ((Uchar *)(c + y))
102#define GET(y) *(Uchar *)(c + y)
103
104/* extract information from vendor section */
105#define _PROD_ID(x) x[0] + (x[1] << 8);
106#define PROD_ID _PROD_ID(GET_ARRAY(V_PROD_ID))
107#define _SERIAL_NO(x) x[0] + (x[1] << 8) + (x[2] << 16) + (x[3] << 24)
108#define SERIAL_NO _SERIAL_NO(GET_ARRAY(V_SERIAL))
109#define _YEAR(x) (x & 0xFF) + 1990
110#define YEAR _YEAR(GET(V_YEAR))
111#define WEEK GET(V_WEEK) & 0xFF
112#define _L1(x) ((x[0] & 0x7C) >> 2) + '@'
113#define _L2(x) ((x[0] & 0x03) << 3) + ((x[1] & 0xE0) >> 5) + '@'
114#define _L3(x) (x[1] & 0x1F) + '@';
115#define L1 _L1(GET_ARRAY(V_MANUFACTURER))
116#define L2 _L2(GET_ARRAY(V_MANUFACTURER))
117#define L3 _L3(GET_ARRAY(V_MANUFACTURER))
118
119/* extract information from version section */
120#define VERSION GET(V_VERSION)
121#define REVISION GET(V_REVISION)
122
123/* extract information from display section */
124#define _INPUT_TYPE(x) ((x & 0x80) >> 7)
125#define INPUT_TYPE _INPUT_TYPE(GET(D_INPUT))
126#define _INPUT_VOLTAGE(x) ((x & 0x60) >> 5)
127#define INPUT_VOLTAGE _INPUT_VOLTAGE(GET(D_INPUT))
128#define _SETUP(x) ((x & 0x10) >> 4)
129#define SETUP _SETUP(GET(D_INPUT))
130#define _SYNC(x) (x & 0x0F)
131#define SYNC _SYNC(GET(D_INPUT))
132#define _DFP(x) (x & 0x01)
133#define DFP _DFP(GET(D_INPUT))
134#define _BPC(x) ((x & 0x70) >> 4)
135#define BPC _BPC(GET(D_INPUT))
136#define _DIGITAL_INTERFACE(x) (x & 0x0F)
137#define DIGITAL_INTERFACE _DIGITAL_INTERFACE(GET(D_INPUT))
138#define _GAMMA(x) (x == 0xff ? 0.0 : ((x + 100.0)/100.0))
139#define GAMMA _GAMMA(GET(D_GAMMA))
140#define HSIZE_MAX GET(D_HSIZE)
141#define VSIZE_MAX GET(D_VSIZE)
142#define _DPMS(x) ((x & 0xE0) >> 5)
143#define DPMS _DPMS(GET(FEAT_S))
144#define _DISPLAY_TYPE(x) ((x & 0x18) >> 3)
145#define DISPLAY_TYPE _DISPLAY_TYPE(GET(FEAT_S))
146#define _MSC(x) (x & 0x7)
147#define MSC _MSC(GET(FEAT_S))
148
149
150/* color characteristics */
151#define CC_L(x,y) ((x & (0x03 << y)) >> y)
152#define CC_H(x) (x << 2)
153#define I_CC(x,y,z) CC_H(y) | CC_L(x,z)
154#define F_CC(x) ((x)/1024.0)
155#define REDX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDX)),6))
156#define REDY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDY)),4))
157#define GREENX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENX)),2))
158#define GREENY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENY)),0))
159#define BLUEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEX)),6))
160#define BLUEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEY)),4))
161#define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2))
162#define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0))
163
164/* extract information from standard timing section */
165#define T1 GET(E_T1)
166#define T2 GET(E_T2)
167#define T_MANU GET(E_TMANU)
168
169/* extract information from estabished timing section */
170#define _VALID_TIMING(x) !(((x[0] == 0x01) && (x[1] == 0x01)) \
171 || ((x[0] == 0x00) && (x[1] == 0x00)) \
172 || ((x[0] == 0x20) && (x[1] == 0x20)) )
173#define VALID_TIMING _VALID_TIMING(c)
174#define _HSIZE1(x) ((x[0] + 31) * 8)
175#define HSIZE1 _HSIZE1(c)
176#define RATIO(x) ((x[1] & 0xC0) >> 6)
177#define RATIO1_1 0
178/* EDID Ver. 1.3 redefined this */
179#define RATIO16_10 RATIO1_1
180#define RATIO4_3 1
181#define RATIO5_4 2
182#define RATIO16_9 3
183#define _VSIZE1(x,y,r) switch(RATIO(x)){ \
184 case RATIO1_1: y = ((v->version > 1 || v->revision > 2) \
185 ? (_HSIZE1(x) * 10) / 16 : _HSIZE1(x)); break; \
186 case RATIO4_3: y = _HSIZE1(x) * 3 / 4; break; \
187 case RATIO5_4: y = _HSIZE1(x) * 4 / 5; break; \
188 case RATIO16_9: y = _HSIZE1(x) * 9 / 16; break; \
189 }
190#define VSIZE1(x) _VSIZE1(c,x,v)
191#define _REFRESH_R(x) (x[1] & 0x3F) + 60
192#define REFRESH_R _REFRESH_R(c)
193#define _ID_LOW(x) x[0]
194#define ID_LOW _ID_LOW(c)
195#define _ID_HIGH(x) (x[1] << 8)
196#define ID_HIGH _ID_HIGH(c)
197#define STD_TIMING_ID (ID_LOW | ID_HIGH)
198#define _NEXT_STD_TIMING(x) (x = (x + STD_TIMING_INFO_LEN))
199#define NEXT_STD_TIMING _NEXT_STD_TIMING(c)
200
201
202/* EDID Ver. >= 1.2 */
203/**
204 * Returns true if the pointer is the start of a monitor descriptor block
205 * instead of a detailed timing descriptor.
206 *
207 * Checking the reserved pad fields for zeroes fails on some monitors with
208 * broken empty ASCII strings. Only the first two bytes are reliable.
209 */
210#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0)
211#define IS_MONITOR_DESC _IS_MONITOR_DESC(c)
212#define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000
213#define PIXEL_CLOCK _PIXEL_CLOCK(c)
214#define _H_ACTIVE(x) (x[2] + ((x[4] & 0xF0) << 4))
215#define H_ACTIVE _H_ACTIVE(c)
216#define _H_BLANK(x) (x[3] + ((x[4] & 0x0F) << 8))
217#define H_BLANK _H_BLANK(c)
218#define _V_ACTIVE(x) (x[5] + ((x[7] & 0xF0) << 4))
219#define V_ACTIVE _V_ACTIVE(c)
220#define _V_BLANK(x) (x[6] + ((x[7] & 0x0F) << 8))
221#define V_BLANK _V_BLANK(c)
222#define _H_SYNC_OFF(x) (x[8] + ((x[11] & 0xC0) << 2))
223#define H_SYNC_OFF _H_SYNC_OFF(c)
224#define _H_SYNC_WIDTH(x) (x[9] + ((x[11] & 0x30) << 4))
225#define H_SYNC_WIDTH _H_SYNC_WIDTH(c)
226#define _V_SYNC_OFF(x) ((x[10] >> 4) + ((x[11] & 0x0C) << 2))
227#define V_SYNC_OFF _V_SYNC_OFF(c)
228#define _V_SYNC_WIDTH(x) ((x[10] & 0x0F) + ((x[11] & 0x03) << 4))
229#define V_SYNC_WIDTH _V_SYNC_WIDTH(c)
230#define _H_SIZE(x) (x[12] + ((x[14] & 0xF0) << 4))
231#define H_SIZE _H_SIZE(c)
232#define _V_SIZE(x) (x[13] + ((x[14] & 0x0F) << 8))
233#define V_SIZE _V_SIZE(c)
234#define _H_BORDER(x) (x[15])
235#define H_BORDER _H_BORDER(c)
236#define _V_BORDER(x) (x[16])
237#define V_BORDER _V_BORDER(c)
238#define _INTERLACED(x) ((x[17] & 0x80) >> 7)
239#define INTERLACED _INTERLACED(c)
240#define _STEREO(x) ((x[17] & 0x60) >> 5)
241#define STEREO _STEREO(c)
242#define _STEREO1(x) (x[17] & 0x1)
243#define STEREO1 _STEREO(c)
244#define _SYNC_T(x) ((x[17] & 0x18) >> 3)
245#define SYNC_T _SYNC_T(c)
246#define _MISC(x) ((x[17] & 0x06) >> 1)
247#define MISC _MISC(c)
248
249#define _MONITOR_DESC_TYPE(x) x[3]
250#define MONITOR_DESC_TYPE _MONITOR_DESC_TYPE(c)
251#define SERIAL_NUMBER 0xFF
252#define ASCII_STR 0xFE
253#define MONITOR_RANGES 0xFD
254#define _MIN_V_OFFSET(x) ((!!(x[4] & 0x01)) * 255)
255#define _MAX_V_OFFSET(x) ((!!(x[4] & 0x02)) * 255)
256#define _MIN_H_OFFSET(x) ((!!(x[4] & 0x04)) * 255)
257#define _MAX_H_OFFSET(x) ((!!(x[4] & 0x08)) * 255)
258#define _MIN_V(x) x[5]
259#define MIN_V (_MIN_V(c) + _MIN_V_OFFSET(c))
260#define _MAX_V(x) x[6]
261#define MAX_V (_MAX_V(c) + _MAX_V_OFFSET(c))
262#define _MIN_H(x) x[7]
263#define MIN_H (_MIN_H(c) + _MIN_H_OFFSET(c))
264#define _MAX_H(x) x[8]
265#define MAX_H (_MAX_H(c) + _MAX_H_OFFSET(c))
266#define _MAX_CLOCK(x) x[9]
267#define MAX_CLOCK _MAX_CLOCK(c)
268#define _HAVE_2ND_GTF(x) (x[10] == 0x02)
269#define HAVE_2ND_GTF _HAVE_2ND_GTF(c)
270#define _F_2ND_GTF(x) (x[12] * 2)
271#define F_2ND_GTF _F_2ND_GTF(c)
272#define _C_2ND_GTF(x) (x[13] / 2)
273#define C_2ND_GTF _C_2ND_GTF(c)
274#define _M_2ND_GTF(x) (x[14] + (x[15] << 8))
275#define M_2ND_GTF _M_2ND_GTF(c)
276#define _K_2ND_GTF(x) (x[16])
277#define K_2ND_GTF _K_2ND_GTF(c)
278#define _J_2ND_GTF(x) (x[17] / 2)
279#define J_2ND_GTF _J_2ND_GTF(c)
280#define _HAVE_CVT(x) (x[10] == 0x04)
281#define HAVE_CVT _HAVE_CVT(c)
282#define _MAX_CLOCK_KHZ(x) (x[12] >> 2)
283#define MAX_CLOCK_KHZ (MAX_CLOCK * 10000) - (_MAX_CLOCK_KHZ(c) * 250)
284#define _MAXWIDTH(x) ((x[13] == 0 ? 0 : x[13] + ((x[12] & 0x03) << 8)) * 8)
285#define MAXWIDTH _MAXWIDTH(c)
286#define _SUPPORTED_ASPECT(x) x[14]
287#define SUPPORTED_ASPECT _SUPPORTED_ASPECT(c)
288#define SUPPORTED_ASPECT_4_3 0x80
289#define SUPPORTED_ASPECT_16_9 0x40
290#define SUPPORTED_ASPECT_16_10 0x20
291#define SUPPORTED_ASPECT_5_4 0x10
292#define SUPPORTED_ASPECT_15_9 0x08
293#define _PREFERRED_ASPECT(x) ((x[15] & 0xe0) >> 5)
294#define PREFERRED_ASPECT _PREFERRED_ASPECT(c)
295#define PREFERRED_ASPECT_4_3 0
296#define PREFERRED_ASPECT_16_9 1
297#define PREFERRED_ASPECT_16_10 2
298#define PREFERRED_ASPECT_5_4 3
299#define PREFERRED_ASPECT_15_9 4
300#define _SUPPORTED_BLANKING(x) ((x[15] & 0x18) >> 3)
301#define SUPPORTED_BLANKING _SUPPORTED_BLANKING(c)
302#define CVT_STANDARD 0x01
303#define CVT_REDUCED 0x02
304#define _SUPPORTED_SCALING(x) ((x[16] & 0xf0) >> 4)
305#define SUPPORTED_SCALING _SUPPORTED_SCALING(c)
306#define SCALING_HSHRINK 0x08
307#define SCALING_HSTRETCH 0x04
308#define SCALING_VSHRINK 0x02
309#define SCALING_VSTRETCH 0x01
310#define _PREFERRED_REFRESH(x) x[17]
311#define PREFERRED_REFRESH _PREFERRED_REFRESH(c)
312
313#define MONITOR_NAME 0xFC
314#define ADD_COLOR_POINT 0xFB
315#define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2))
316#define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0))
317#define _WHITEX_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 1)),2))
318#define _WHITEY_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 2)),0))
319#define _WHITE_INDEX1(x) x[5]
320#define WHITE_INDEX1 _WHITE_INDEX1(c)
321#define _WHITE_INDEX2(x) x[10]
322#define WHITE_INDEX2 _WHITE_INDEX2(c)
323#define WHITEX1 _WHITEX_ADD(c,6)
324#define WHITEY1 _WHITEY_ADD(c,6)
325#define WHITEX2 _WHITEX_ADD(c,12)
326#define WHITEY2 _WHITEY_ADD(c,12)
327#define _WHITE_GAMMA1(x) _GAMMA(x[9])
328#define WHITE_GAMMA1 _WHITE_GAMMA1(c)
329#define _WHITE_GAMMA2(x) _GAMMA(x[14])
330#define WHITE_GAMMA2 _WHITE_GAMMA2(c)
331#define ADD_STD_TIMINGS 0xFA
332#define COLOR_MANAGEMENT_DATA 0xF9
333#define CVT_3BYTE_DATA 0xF8
334#define ADD_EST_TIMINGS 0xF7
335#define ADD_DUMMY 0x10
336
337#define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN))
338#define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION(c)
339
340#endif /* _PARSE_EDID_ */
341
342/* input type */
343#define DIGITAL(x) x
344
345/* DFP */
346#define DFP1(x) x
347
348/* input voltage level */
349#define V070 0 /* 0.700V/0.300V */
350#define V071 1 /* 0.714V/0.286V */
351#define V100 2 /* 1.000V/0.400V */
352#define V007 3 /* 0.700V/0.000V */
353
354/* Signal level setup */
355#define SIG_SETUP(x) (x)
356
357/* sync characteristics */
358#define SEP_SYNC(x) (x & 0x08)
359#define COMP_SYNC(x) (x & 0x04)
360#define SYNC_O_GREEN(x) (x & 0x02)
361#define SYNC_SERR(x) (x & 0x01)
362
363/* DPMS features */
364#define DPMS_STANDBY(x) (x & 0x04)
365#define DPMS_SUSPEND(x) (x & 0x02)
366#define DPMS_OFF(x) (x & 0x01)
367
368/* display type, analog */
369#define DISP_MONO 0
370#define DISP_RGB 1
371#define DISP_MULTCOLOR 2
372
373/* display color encodings, digital */
374#define DISP_YCRCB444 0x01
375#define DISP_YCRCB422 0x02
376
377/* Msc stuff EDID Ver > 1.1 */
378#define STD_COLOR_SPACE(x) (x & 0x4)
379#define PREFERRED_TIMING_MODE(x) (x & 0x2)
380#define GFT_SUPPORTED(x) (x & 0x1)
381#define GTF_SUPPORTED(x) (x & 0x1)
382#define CVT_SUPPORTED(x) (x & 0x1)
383
384/* detailed timing misc */
385#define IS_INTERLACED(x) (x)
386#define IS_STEREO(x) (x)
387#define IS_RIGHT_STEREO(x) (x & 0x01)
388#define IS_LEFT_STEREO(x) (x & 0x02)
389#define IS_4WAY_STEREO(x) (x & 0x03)
390#define IS_RIGHT_ON_SYNC(x) IS_RIGHT_STEREO(x)
391#define IS_LEFT_ON_SYNC(x) IS_LEFT_STEREO(x)
392
393
394typedef unsigned int Uint;
395typedef unsigned char Uchar;
396
397struct vendor {
398 char name[4];
399 int prod_id;
400 Uint serial;
401 int week;
402 int year;
403};
404
405struct edid_version {
406 int version;
407 int revision;
408};
409
410struct disp_features {
411 unsigned int input_type:1;
412 unsigned int input_voltage:2;
413 unsigned int input_setup:1;
414 unsigned int input_sync:5;
415 unsigned int input_dfp:1;
416 unsigned int input_bpc:3;
417 unsigned int input_interface:4;
418 /* 15 bit hole */
419 int hsize;
420 int vsize;
421 float gamma;
422 unsigned int dpms:3;
423 unsigned int display_type:2;
424 unsigned int msc:3;
425 float redx;
426 float redy;
427 float greenx;
428 float greeny;
429 float bluex;
430 float bluey;
431 float whitex;
432 float whitey;
433};
434
435struct established_timings {
436 Uchar t1;
437 Uchar t2;
438 Uchar t_manu;
439};
440
441struct std_timings {
442 int hsize;
443 int vsize;
444 int refresh;
445 CARD16 id;
446};
447
448struct detailed_timings {
449 int clock;
450 int h_active;
451 int h_blanking;
452 int v_active;
453 int v_blanking;
454 int h_sync_off;
455 int h_sync_width;
456 int v_sync_off;
457 int v_sync_width;
458 int h_size;
459 int v_size;
460 int h_border;
461 int v_border;
462 unsigned int interlaced:1;
463 unsigned int stereo:2;
464 unsigned int sync:2;
465 unsigned int misc:2;
466 unsigned int stereo_1:1;
467};
468
469#define DT 0
470#define DS_SERIAL 0xFF
471#define DS_ASCII_STR 0xFE
472#define DS_NAME 0xFC
473#define DS_RANGES 0xFD
474#define DS_WHITE_P 0xFB
475#define DS_STD_TIMINGS 0xFA
476#define DS_CMD 0xF9
477#define DS_CVT 0xF8
478#define DS_EST_III 0xF7
479#define DS_DUMMY 0x10
480#define DS_UNKOWN 0x100 /* type is an int */
481#define DS_VENDOR 0x101
482#define DS_VENDOR_MAX 0x110
483
484struct monitor_ranges {
485 int min_v;
486 int max_v;
487 int min_h;
488 int max_h;
489 int max_clock; /* in mhz */
490 int gtf_2nd_f;
491 int gtf_2nd_c;
492 int gtf_2nd_m;
493 int gtf_2nd_k;
494 int gtf_2nd_j;
495 int max_clock_khz;
496 int maxwidth; /* in pixels */
497 char supported_aspect;
498 char preferred_aspect;
499 char supported_blanking;
500 char supported_scaling;
501 int preferred_refresh; /* in hz */
502};
503
504struct whitePoints{
505 int index;
506 float white_x;
507 float white_y;
508 float white_gamma;
509};
510
511struct cvt_timings {
512 int width;
513 int height;
514 int rate;
515 int rates;
516};
517
518/*
519 * Be careful when adding new sections; this structure can't grow, it's
520 * embedded in the middle of xf86Monitor which is ABI. Sizes below are
521 * in bytes, for ILP32 systems. If all else fails just copy the section
522 * literally like serial and friends.
523 */
524struct detailed_monitor_section {
525 int type;
526 union {
527 struct detailed_timings d_timings; /* 56 */
528 Uchar serial[13];
529 Uchar ascii_data[13];
530 Uchar name[13];
531 struct monitor_ranges ranges; /* 56 */
532 struct std_timings std_t[5]; /* 80 */
533 struct whitePoints wp[2]; /* 32 */
534 /* color management data */
535 struct cvt_timings cvt[4]; /* 64 */
536 Uchar est_iii[6]; /* 6 */
537 } section; /* max: 80 */
538};
539
540/* flags */
541#define MONITOR_EDID_COMPLETE_RAWDATA 0x01
542/* old, don't use */
543#define EDID_COMPLETE_RAWDATA 0x01
544#define MONITOR_DISPLAYID 0x02
545
546/*
547 * For DisplayID devices, only the scrnIndex, flags, and rawData fields
548 * are meaningful. For EDID, they all are.
549 */
550typedef struct {
551 int scrnIndex;
552 struct vendor vendor;
553 struct edid_version ver;
554 struct disp_features features;
555 struct established_timings timings1;
556 struct std_timings timings2[8];
557 struct detailed_monitor_section det_mon[4];
558 unsigned long flags;
559 int no_sections;
560 Uchar *rawData;
561} xf86Monitor, *xf86MonPtr;
562
563extern _X_EXPORT xf86MonPtr ConfiguredMonitor;
564
565#define EXT_TAG 0
566#define EXT_REV 1
567#define CEA_EXT 0x02
568#define VTB_EXT 0x10
569#define DI_EXT 0x40
570#define LS_EXT 0x50
571#define MI_EXT 0x60
572
573#define CEA_EXT_MIN_DATA_OFFSET 4
574#define CEA_EXT_MAX_DATA_OFFSET 127
575#define CEA_EXT_DET_TIMING_NUM 6
576
577#define IEEE_ID_HDMI 0x000C03
578#define CEA_AUDIO_BLK 1
579#define CEA_VIDEO_BLK 2
580#define CEA_VENDOR_BLK 3
581#define CEA_SPEAKER_ALLOC_BLK 4
582#define CEA_VESA_DTC_BLK 5
583#define VENDOR_SUPPORT_AI(x) ((x) >> 7)
584#define VENDOR_SUPPORT_DC_48bit(x) ( ( (x) >> 6) & 0x01)
585#define VENDOR_SUPPORT_DC_36bit(x) ( ( (x) >> 5) & 0x01)
586#define VENDOR_SUPPORT_DC_30bit(x) ( ( (x) >> 4) & 0x01)
587#define VENDOR_SUPPORT_DC_Y444(x) ( ( (x) >> 3) & 0x01)
588#define VENDOR_LATENCY_PRESENT(x) ( (x) >> 7)
589#define VENDOR_LATENCY_PRESENT_I(x) ( ( (x) >> 6) & 0x01)
590#define HDMI_MAX_TMDS_UNIT (5000)
591
592struct cea_video_block {
593 Uchar video_code;
594};
595
596struct cea_audio_block_descriptor {
597 Uchar audio_code[3];
598};
599
600struct cea_audio_block {
601 struct cea_audio_block_descriptor descriptor[10];
602};
603
604struct cea_vendor_block_hdmi {
605 __extension__ Uchar portB:4;
606 __extension__ Uchar portA:4;
607 __extension__ Uchar portD:4;
608 __extension__ Uchar portC:4;
609 Uchar support_flags;
610 Uchar max_tmds_clock;
611 Uchar latency_present;
612 Uchar video_latency;
613 Uchar audio_latency;
614 Uchar interlaced_video_latency;
615 Uchar interlaced_audio_latency;
616};
617
618struct cea_vendor_block {
619 unsigned char ieee_id[3];
620 union {
621 struct cea_vendor_block_hdmi hdmi;
622 /* any other vendor blocks we know about */
623 } dummy;
624};
625
626struct cea_speaker_block
627{
628 __extension__ Uchar FLR:1;
629 __extension__ Uchar LFE:1;
630 __extension__ Uchar FC:1;
631 __extension__ Uchar RLR:1;
632 __extension__ Uchar RC:1;
633 __extension__ Uchar FLRC:1;
634 __extension__ Uchar RLRC:1;
635 __extension__ Uchar FLRW:1;
636 __extension__ Uchar FLRH:1;
637 __extension__ Uchar TC:1;
638 __extension__ Uchar FCH:1;
639 __extension__ Uchar Resv:5;
640 __extension__ Uchar ResvByte;
641};
642
643struct cea_data_block {
644 __extension__ Uchar len:5;
645 __extension__ Uchar tag:3;
646 union{
647 struct cea_video_block video;
648 struct cea_audio_block audio;
649 struct cea_vendor_block vendor;
650 struct cea_speaker_block speaker;
651 }u;
652};
653
654struct cea_ext_body {
655 Uchar tag;
656 Uchar rev;
657 Uchar dt_offset;
658 Uchar flags;
659 struct cea_data_block data_collection;
660};
661
662#endif /* _EDID_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette