1 | /* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.4tsi Exp $ */
|
---|
2 |
|
---|
3 | #ifndef _VDIF_H
|
---|
4 | #define _VDIF_H
|
---|
5 |
|
---|
6 | #define VDIF_MONITOR_MONOCHROME 0
|
---|
7 | #define VDIF_MONITOR_COLOR 1
|
---|
8 | #define VDIF_VIDEO_TTL 0
|
---|
9 | #define VDIF_VIDEO_ANALOG 1
|
---|
10 | #define VDIF_VIDEO_ECL 2
|
---|
11 | #define VDIF_VIDEO_DECL 3
|
---|
12 | #define VDIF_VIDEO_OTHER 4
|
---|
13 | #define VDIF_SYNC_SEPARATE 0
|
---|
14 | #define VDIF_SYNC_C 1
|
---|
15 | #define VDIF_SYNC_CP 2
|
---|
16 | #define VDIF_SYNC_G 3
|
---|
17 | #define VDIF_SYNC_GP 4
|
---|
18 | #define VDIF_SYNC_OTHER 5
|
---|
19 | #define VDIF_SCAN_NONINTERLACED 0
|
---|
20 | #define VDIF_SCAN_INTERLACED 1
|
---|
21 | #define VDIF_SCAN_OTHER 2
|
---|
22 | #define VDIF_POLARITY_NEGATIVE 0
|
---|
23 | #define VDIF_POLARITY_POSITIVE 1
|
---|
24 |
|
---|
25 | #include <X11/Xmd.h>
|
---|
26 |
|
---|
27 | #undef CARD32
|
---|
28 | #define CARD32 unsigned int /* ... on all supported platforms */
|
---|
29 |
|
---|
30 | typedef struct _VDIF { /* Monitor Description: */
|
---|
31 | CARD8 VDIFId[4]; /* alway "VDIF" */
|
---|
32 | CARD32 FileLength; /* lenght of the whole file */
|
---|
33 | CARD32 Checksum; /* sum of all bytes in the file after*/
|
---|
34 | /* this field */
|
---|
35 | CARD16 VDIFVersion; /* structure version number */
|
---|
36 | CARD16 VDIFRevision; /* structure revision number */
|
---|
37 | CARD16 Date[3]; /* file date Year/Month/Day */
|
---|
38 | CARD16 DateManufactured[3]; /* date Year/Month/Day */
|
---|
39 | CARD32 FileRevision; /* file revision string */
|
---|
40 | CARD32 Manufacturer; /* ASCII ID of the manufacturer */
|
---|
41 | CARD32 ModelNumber; /* ASCII ID of the model */
|
---|
42 | CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */
|
---|
43 | CARD32 Version; /* ASCII ID of the model version */
|
---|
44 | CARD32 SerialNumber; /* ASCII ID of the serial number */
|
---|
45 | CARD8 MonitorType; /* Monochrome or Color */
|
---|
46 | CARD8 CRTSize; /* inches */
|
---|
47 | CARD8 BorderRed; /* percent */
|
---|
48 | CARD8 BorderGreen; /* percent */
|
---|
49 | CARD8 BorderBlue; /* percent */
|
---|
50 | CARD8 Reserved1; /* padding */
|
---|
51 | CARD16 Reserved2; /* padding */
|
---|
52 | CARD32 RedPhosphorDecay; /* microseconds */
|
---|
53 | CARD32 GreenPhosphorDecay; /* microseconds */
|
---|
54 | CARD32 BluePhosphorDecay; /* microseconds */
|
---|
55 | CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */
|
---|
56 | CARD16 WhitePoint_y;
|
---|
57 | CARD16 WhitePoint_Y;
|
---|
58 | CARD16 RedChromaticity_x; /* Red chromaticity in x,y */
|
---|
59 | CARD16 RedChromaticity_y;
|
---|
60 | CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */
|
---|
61 | CARD16 GreenChromaticity_y;
|
---|
62 | CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */
|
---|
63 | CARD16 BlueChromaticity_y;
|
---|
64 | CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */
|
---|
65 | CARD16 GreenGamma;
|
---|
66 | CARD16 BlueGamma;
|
---|
67 | CARD32 NumberOperationalLimits;
|
---|
68 | CARD32 OffsetOperationalLimits;
|
---|
69 | CARD32 NumberOptions; /* optinal sections (gamma table) */
|
---|
70 | CARD32 OffsetOptions;
|
---|
71 | CARD32 OffsetStringTable;
|
---|
72 | } xf86VdifRec, *xf86VdifPtr;
|
---|
73 |
|
---|
74 | typedef enum { /* Tags for section identification */
|
---|
75 | VDIF_OPERATIONAL_LIMITS_TAG = 1,
|
---|
76 | VDIF_PREADJUSTED_TIMING_TAG,
|
---|
77 | VDIF_GAMMA_TABLE_TAG
|
---|
78 | } VDIFScnTag;
|
---|
79 |
|
---|
80 | typedef struct _VDIFScnHdr { /* Generic Section Header: */
|
---|
81 | CARD32 ScnLength; /* lenght of section */
|
---|
82 | CARD32 ScnTag; /* tag for section identification */
|
---|
83 | } VDIFScnHdrRec, *VDIFScnHdrPtr;
|
---|
84 |
|
---|
85 | typedef struct _VDIFLimits { /* Operational Limits: */
|
---|
86 | VDIFScnHdrRec Header; /* common section info */
|
---|
87 | CARD16 MaxHorPixel; /* pixels */
|
---|
88 | CARD16 MaxVerPixel; /* lines */
|
---|
89 | CARD16 MaxHorActiveLength; /* millimeters */
|
---|
90 | CARD16 MaxVerActiveHeight; /* millimeters */
|
---|
91 | CARD8 VideoType; /* TTL / Analog / ECL / DECL */
|
---|
92 | CARD8 SyncType; /* TTL / Analog / ECL / DECL */
|
---|
93 | CARD8 SyncConfiguration; /* separate / composite / other */
|
---|
94 | CARD8 Reserved1; /* padding */
|
---|
95 | CARD16 Reserved2; /* padding */
|
---|
96 | CARD16 TerminationResistance; /* */
|
---|
97 | CARD16 WhiteLevel; /* millivolts */
|
---|
98 | CARD16 BlackLevel; /* millivolts */
|
---|
99 | CARD16 BlankLevel; /* millivolts */
|
---|
100 | CARD16 SyncLevel; /* millivolts */
|
---|
101 | CARD32 MaxPixelClock; /* kiloHertz */
|
---|
102 | CARD32 MinHorFrequency; /* Hertz */
|
---|
103 | CARD32 MaxHorFrequency; /* Hertz */
|
---|
104 | CARD32 MinVerFrequency; /* milliHertz */
|
---|
105 | CARD32 MaxVerFrequency; /* milliHertz */
|
---|
106 | CARD16 MinHorRetrace; /* nanoseconds */
|
---|
107 | CARD16 MinVerRetrace; /* microseconds */
|
---|
108 | CARD32 NumberPreadjustedTimings;
|
---|
109 | CARD32 OffsetNextLimits;
|
---|
110 | } xf86VdifLimitsRec, *xf86VdifLimitsPtr;
|
---|
111 |
|
---|
112 | typedef struct _VDIFTiming { /* Preadjusted Timing: */
|
---|
113 | VDIFScnHdrRec Header; /* common section info */
|
---|
114 | CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */
|
---|
115 | CARD16 HorPixel; /* pixels */
|
---|
116 | CARD16 VerPixel; /* lines */
|
---|
117 | CARD16 HorAddrLength; /* millimeters */
|
---|
118 | CARD16 VerAddrHeight; /* millimeters */
|
---|
119 | CARD8 PixelWidthRatio; /* gives H:V */
|
---|
120 | CARD8 PixelHeightRatio;
|
---|
121 | CARD8 Reserved1; /* padding */
|
---|
122 | CARD8 ScanType; /* noninterlaced / interlaced / other*/
|
---|
123 | CARD8 HorSyncPolarity; /* negative / positive */
|
---|
124 | CARD8 VerSyncPolarity; /* negative / positive */
|
---|
125 | CARD16 CharacterWidth; /* pixels */
|
---|
126 | CARD32 PixelClock; /* kiloHertz */
|
---|
127 | CARD32 HorFrequency; /* Hertz */
|
---|
128 | CARD32 VerFrequency; /* milliHertz */
|
---|
129 | CARD32 HorTotalTime; /* nanoseconds */
|
---|
130 | CARD32 VerTotalTime; /* microseconds */
|
---|
131 | CARD16 HorAddrTime; /* nanoseconds */
|
---|
132 | CARD16 HorBlankStart; /* nanoseconds */
|
---|
133 | CARD16 HorBlankTime; /* nanoseconds */
|
---|
134 | CARD16 HorSyncStart; /* nanoseconds */
|
---|
135 | CARD16 HorSyncTime; /* nanoseconds */
|
---|
136 | CARD16 VerAddrTime; /* microseconds */
|
---|
137 | CARD16 VerBlankStart; /* microseconds */
|
---|
138 | CARD16 VerBlankTime; /* microseconds */
|
---|
139 | CARD16 VerSyncStart; /* microseconds */
|
---|
140 | CARD16 VerSyncTime; /* microseconds */
|
---|
141 | } xf86VdifTimingRec, *xf86VdifTimingPtr;
|
---|
142 |
|
---|
143 | typedef struct _VDIFGamma { /* Gamma Table: */
|
---|
144 | VDIFScnHdrRec Header; /* common section info */
|
---|
145 | CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */
|
---|
146 | CARD16 Unused1;
|
---|
147 | } xf86VdifGammaRec, *xf86VdifGammaPtr;
|
---|
148 |
|
---|
149 | /* access macros */
|
---|
150 | #define VDIF_OPERATIONAL_LIMITS(vdif) \
|
---|
151 | ((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits))
|
---|
152 | #define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \
|
---|
153 | ((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits))
|
---|
154 | #define VDIF_PREADJUSTED_TIMING(limits) \
|
---|
155 | ((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength))
|
---|
156 | #define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \
|
---|
157 | ((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength))
|
---|
158 | #define VDIF_OPTIONS(vdif) \
|
---|
159 | ((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions))
|
---|
160 | #define VDIF_NEXT_OPTIONS(options) options = \
|
---|
161 | ((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength))
|
---|
162 | #define VDIF_STRING(vdif, string) \
|
---|
163 | ((char*)((char*)vdif + vdif->OffsetStringTable + (string)))
|
---|
164 |
|
---|
165 | typedef struct _vdif {
|
---|
166 | xf86VdifPtr vdif;
|
---|
167 | xf86VdifLimitsPtr *limits;
|
---|
168 | xf86VdifTimingPtr *timings;
|
---|
169 | xf86VdifGammaPtr *gamma;
|
---|
170 | char * strings;
|
---|
171 | } xf86vdif, *xf86vdifPtr;
|
---|
172 |
|
---|
173 | #undef CARD32
|
---|
174 |
|
---|
175 | #endif
|
---|