diff options
Diffstat (limited to 'hw/xfree86/ddc/edid.h')
-rw-r--r-- | hw/xfree86/ddc/edid.h | 57 |
1 files changed, 48 insertions, 9 deletions
diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h index ccf9d9280..e40492c4c 100644 --- a/hw/xfree86/ddc/edid.h +++ b/hw/xfree86/ddc/edid.h @@ -11,7 +11,7 @@ */ #ifndef _EDID_H_ -#define _EDID_H_ 1 +#define _EDID_H_ #include "vdif.h" @@ -126,7 +126,9 @@ #define SETUP _SETUP(GET(D_INPUT)) #define _SYNC(x) (x & 0x0F) #define SYNC _SYNC(GET(D_INPUT)) -#define _GAMMA(x) ((x + 100.0)/100.0) +#define _DFP(x) (x & 0x01) +#define DFP _DFP(GET(D_INPUT)) +#define _GAMMA(x) (x == 0xff ? 1.0 : ((x + 100.0)/100.0)) #define GAMMA _GAMMA(GET(D_GAMMA)) #define HSIZE_MAX GET(D_HSIZE) #define VSIZE_MAX GET(D_VSIZE) @@ -158,20 +160,27 @@ #define T_MANU GET(E_TMANU) /* extract information from estabished timing section */ +#define _VALID_TIMING(x) ((x[0] != 0x01 && x[1] != 0x01) \ + && (x[0] != 0x00 && x[1] != 0x00) \ + && (x[0] != 0x20 && x[1] != 0x20) ) +#define VALID_TIMING _VALID_TIMING(c) #define _HSIZE1(x) ((x[0] + 31) * 8) #define HSIZE1 _HSIZE1(c) #define RATIO(x) ((x[1] & 0xC0) >> 6) #define RATIO1_1 0 +/* EDID Ver. 1.3 redefined this */ +#define RATIO16_10 RATIO1_1 #define RATIO4_3 1 #define RATIO5_4 2 #define RATIO16_9 3 -#define _VSIZE1(x,y) switch(RATIO(x)){ \ - case RATIO1_1: y = _HSIZE1(x); break; \ +#define _VSIZE1(x,y,r) switch(RATIO(x)){ \ + case RATIO1_1: y = _HSIZE1(x) * ((v->version>1||v->revision>2) ? 10/16 : 1); \ + break; \ case RATIO4_3: y = _HSIZE1(x) * 3 / 4; break; \ case RATIO5_4: y = _HSIZE1(x) * 4 / 5; break; \ case RATIO16_9: y = _HSIZE1(x) * 9 / 16; break; \ } -#define VSIZE1(x) _VSIZE1(c,x) +#define VSIZE1(x) _VSIZE1(c,x,v) #define _REFRESH_R(x) (x[1] & 0x3F) + 60 #define REFRESH_R _REFRESH_R(c) #define _ID_LOW(x) x[0] @@ -183,7 +192,7 @@ #define NEXT_STD_TIMING _NEXT_STD_TIMING(c) -/* EDID Ver. > 1.2 */ +/* EDID Ver. >= 1.2 */ #define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0 && x[2] == 0 && x[4] == 0) #define IS_MONITOR_DESC _IS_MONITOR_DESC(c) #define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000 @@ -214,8 +223,10 @@ #define V_BORDER _V_BORDER(c) #define _INTERLACED(x) ((x[17] & 0x80) >> 7) #define INTERLACED _INTERLACED(c) -#define _STEREO(x) ((x[17] & 0x60) >> 6) +#define _STEREO(x) ((x[17] & 0x60) >> 5) #define STEREO _STEREO(c) +#define _STEREO1(x) (x[17] & 0x1) +#define STEREO1 _STEREO(c) #define _SYNC_T(x) ((x[17] & 0x18) >> 4) #define SYNC_T _SYNC_T(c) #define _MISC(x) ((x[17] & 0x06) >> 2) @@ -236,6 +247,18 @@ #define MAX_H _MAX_H(c) #define _MAX_CLOCK(x) x[9] #define MAX_CLOCK _MAX_CLOCK(c) +#define _HAVE_2ND_GTF(x) (x[10] == 0x02) +#define HAVE_2ND_GTF _HAVE_2ND_GTF(c) +#define _F_2ND_GTF(x) (x[12] * 2) +#define F_2ND_GTF _F_2ND_GTF(c) +#define _C_2ND_GTF(x) (x[13] / 2) +#define C_2ND_GTF _C_2ND_GTF(c) +#define _M_2ND_GTF(x) (x[14] + (x[15] << 8)) +#define M_2ND_GTF _M_2ND_GTF(c) +#define _K_2ND_GTF(x) (x[16]) +#define K_2ND_GTF _K_2ND_GTF(c) +#define _J_2ND_GTF(x) (x[17] / 2) +#define J_2ND_GTF _J_2ND_GTF(c) #define MONITOR_NAME 0xFC #define ADD_COLOR_POINT 0xFB #define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2)) @@ -255,6 +278,7 @@ #define _WHITE_GAMMA2(x) _GAMMA(x[14]) #define WHITE_GAMMA2 _WHITE_GAMMA2(c) #define ADD_STD_TIMINGS 0xFA +#define ADD_DUMMY 0x10 #define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN)) #define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION(c) @@ -264,6 +288,9 @@ /* input type */ #define DIGITAL(x) x +/* DFP */ +#define DFP1(x) x + /* input voltage level */ #define V070 0 /* 0.700V/0.300V */ #define V071 1 /* 0.714V/0.286V */ @@ -297,8 +324,12 @@ /* detailed timing misc */ #define IS_INTERLACED(x) (x) #define IS_STEREO(x) (x) -#define IS_RIGHT_ON_SYNC(x) (x & 0x01) -#define IS_LEFT_ON_SYNC(x) (x & 0x02) +#define IS_RIGHT_STEREO(x) (x & 0x01) +#define IS_LEFT_STEREO(x) (x & 0x02) +#define IS_4WAY_STEREO(x) (x & 0x03) +#define IS_RIGHT_ON_SYNC(x) IS_RIGHT_STEREO(x) +#define IS_LEFT_ON_SYNC(x) IS_LEFT_STEREO(x) + typedef unsigned int Uint; typedef unsigned char Uchar; @@ -321,6 +352,7 @@ struct disp_features { unsigned int input_voltage:2; unsigned int input_setup:1; unsigned int input_sync:5; + unsigned int input_dfp:1; int hsize; int vsize; float gamma; @@ -368,6 +400,7 @@ struct detailed_timings { unsigned int stereo:2; unsigned int sync:2; unsigned int misc:2; + unsigned int stereo_1:1; }; #define DT 0 @@ -377,6 +410,7 @@ struct detailed_timings { #define DS_RANGES 0xFD #define DS_WHITE_P 0xFB #define DS_STD_TIMINGS 0xFA +#define DS_DUMMY 0x10 struct monitor_ranges { int min_v; @@ -384,6 +418,11 @@ struct monitor_ranges { int min_h; int max_h; int max_clock; + int gtf_2nd_f; + int gtf_2nd_c; + int gtf_2nd_m; + int gtf_2nd_k; + int gtf_2nd_j; }; struct whitePoints{ |