39#define EDID_INLINE_ROUTINE static inline
45#define EDID1_DTD_Flag_InterlacedOff 7
46#define EDID1_DTD_Flag_InterlacedMask 0x1
47#define EDID1_DTD_Flag_StereoModeOff 0
48#define EDID1_DTD_Flag_StereoModeMask 0xC1
50#define EDID1_DTD_Stereo_FldSeqRightOnSync 0x40
51#define EDID1_DTD_Stereo_FldSeqLeftOnSync 0x80
52#define EDID1_DTD_Stereo_2wItlvdRightOnEven 0x41
53#define EDID1_DTD_Stereo_2wItlvdLeftOnEven 0x81
54#define EDID1_DTD_Stereo_4wInterleaved 0xC0
55#define EDID1_DTD_Stereo_SideBySideItlvd 0xC1
57#define EDID1_DTD_Flag_DigitalOff 4
58#define EDID1_DTD_Flag_DigitalMask 0x1
60#define EDID1_DTD_BipolarAnalogComposSyncOff 3
61#define EDID1_DTD_BipolarAnalogComposSyncMask 0x1
62#define EDID1_DTD_WithSerrationsOff 2
63#define EDID1_DTD_WithSerrationsMask 0x1
65#define EDID1_DTD_DigitalSeparateSyncOff 3
66#define EDID1_DTD_DigitalSeparateSyncMask 0x1
69#define EDID1_DTD_VerticalSyncIsPositiveOff 2
70#define EDID1_DTD_VerticalSyncIsPositiveMask 0x1
71#define EDID1_DTD_HorizontalSyncIsPositiveOff 1
72#define EDID1_DTD_HorizontalSyncIsPositiveMask 0x1
75 uint8_t PixelClock_div10000[2];
76 uint8_t HorizontalActiveLow;
77 uint8_t HorizontalBlankingLow;
78 uint8_t HorizontalBlanking_ActiveHigh;
79 uint8_t VerticalActiveLow;
80 uint8_t VerticalBlankingLow;
81 uint8_t VerticalBlanking_ActiveHigh;
82 uint8_t HorizontalSyncOffsetLow;
83 uint8_t HorizontalSyncPulseWidthLow;
84 uint8_t VerticalSyncPulseWidth_OffsetLow;
85 uint8_t Vert_Hor_SyncPulseWidth_Offset_High;
86 uint8_t HorizontalImageSizeLow;
87 uint8_t VerticalImageSizeLow;
88 uint8_t Vertical_HorizontalImageSizeHigh;
89 uint8_t HorizontalBorder;
90 uint8_t VerticalBorder;
94EDID_INLINE_ROUTINE uint16_t DTD_horizontal_active (
95 EDID_detailed_timing_descriptor *dtd)
97 return (dtd->HorizontalActiveLow |
98 (dtd->HorizontalBlanking_ActiveHigh & 0xF0) << 4);
101EDID_INLINE_ROUTINE uint16_t DTD_horizontal_blanking (
102 EDID_detailed_timing_descriptor *dtd)
104 return (dtd->HorizontalBlankingLow |
105 (dtd->HorizontalBlanking_ActiveHigh & 0xF) << 8);
108EDID_INLINE_ROUTINE uint16_t DTD_vertical_active (
109 EDID_detailed_timing_descriptor *dtd)
111 return (dtd->VerticalActiveLow |
112 (dtd->VerticalBlanking_ActiveHigh & 0xF0) << 4);
115EDID_INLINE_ROUTINE uint16_t DTD_vertical_blanking (
116 EDID_detailed_timing_descriptor *dtd)
118 return (dtd->VerticalBlankingLow |
119 (dtd->VerticalBlanking_ActiveHigh & 0xF) << 8);
122EDID_INLINE_ROUTINE uint16_t DTD_vertical_sync_pulse_width (
123 EDID_detailed_timing_descriptor *dtd)
125 return ((dtd->VerticalSyncPulseWidth_OffsetLow & 0xF) |
126 (dtd->Vert_Hor_SyncPulseWidth_Offset_High & 0x3) << 4);
129EDID_INLINE_ROUTINE uint16_t DTD_vertical_sync_offset (
130 EDID_detailed_timing_descriptor *dtd)
132 return ((dtd->VerticalSyncPulseWidth_OffsetLow >> 4) |
133 (dtd->Vert_Hor_SyncPulseWidth_Offset_High & 0xC) << 2);
136EDID_INLINE_ROUTINE uint16_t DTD_horizontal_sync_pulse_width (
137 EDID_detailed_timing_descriptor *dtd)
139 return (dtd->HorizontalSyncPulseWidthLow |
140 (dtd->Vert_Hor_SyncPulseWidth_Offset_High & 0x30) << 4);
143EDID_INLINE_ROUTINE uint16_t DTD_horizontal_sync_offset (
144 EDID_detailed_timing_descriptor *dtd)
146 return (dtd->HorizontalSyncOffsetLow |
147 (dtd->Vert_Hor_SyncPulseWidth_Offset_High & 0xC0) << 2);
150EDID_INLINE_ROUTINE uint16_t DTD_vertical_image_size (
151 EDID_detailed_timing_descriptor *dtd)
153 return (dtd->VerticalImageSizeLow |
154 (dtd->Vertical_HorizontalImageSizeHigh & 0xF) << 8);
157EDID_INLINE_ROUTINE uint16_t DTD_horizontal_image_size (
158 EDID_detailed_timing_descriptor *dtd)
160 return (dtd->HorizontalImageSizeLow |
161 (dtd->Vertical_HorizontalImageSizeHigh & 0xF0) << 4);
165 uint8_t ColorPointWhitePointIndexNumber;
166 uint8_t ColorPointWhiteLowBits;
167 uint8_t ColorPointWhite_x;
168 uint8_t ColorPointWhite_y;
169 uint8_t ColorPointWhiteGamma;
174#define EDID_DTT_MonitorSerialNumber 0xFF
176#define EDID_DTT_ASCIIString 0xFE
178#define EDID_DTT_MonitorRangeLimits 0xFD
180 uint8_t MinVerticalRateInHz;
181 uint8_t MaxVerticalRateInHz;
182 uint8_t MinHorizontalInKHz;
183 uint8_t MaxHorizontalInKHz;
184 uint8_t MaxSupportedPixelClockIn10MHz;
187 uint8_t GTFStandard[8];
190#define EDID_DTT_MonitorName 0xFC
192#define EDID_DTT_AdditionalColorPointData 0xFB
194#define EDID_DTT_AdditionalSTI 0xFA
196#define EDID_DTT_DisplayColorManagement 0xF9
198#define EDID_DTT_CVT3ByteTimingCodes 0xF8
200#define EDID1_CVT_AspectRatioOff 2
201#define EDID1_CVT_AspectRatioMask 0x3
202#define EDID1_CVT_AddressableLinesHighOff 4
203#define EDID1_CVT_AddressableLinesHighMask 0xF
205#define EDID1_CVT_VerticalRate60HzRBOff 0
206#define EDID1_CVT_VerticalRate60HzRBMask 0x1
207#define EDID1_CVT_VerticalRate85HzOff 1
208#define EDID1_CVT_VerticalRate85HzMask 0x1
209#define EDID1_CVT_VerticalRate75HzOff 2
210#define EDID1_CVT_VerticalRate75HzMask 0x1
211#define EDID1_CVT_VerticalRate60HzOff 3
212#define EDID1_CVT_VerticalRate60HzMask 0x1
213#define EDID1_CVT_VerticalRate50HzOff 4
214#define EDID1_CVT_VerticalRate50HzMask 0x1
215#define EDID1_CVT_PreferredVerticalRateOff 5
216#define EDID1_CVT_PreferredVerticalRateMask 0x3
218#define EDID_CVT_AspectRatio_4_3 0
219#define EDID_CVT_AspectRatio_16_9 1
220#define EDID_CVT_AspectRatio_16_10 2
221#define EDID_CVT_AspectRatio_15_9 3
222#define EDID_CVT_PrefVertRate50Hz 0
223#define EDID_CVT_PrefVertRate60Hz 1
224#define EDID_CVT_PrefVertRate75Hz 2
225#define EDID_CVT_PrefVertRate85Hz 3
227 uint8_t AddressableLinesLow;
228 uint8_t AspectRatio_AddressableLinesHigh;
229 uint8_t VerticalRate_PreferredVerticalRate;
232 uint8_t VersionNumber;
233 EDID_CVT_3_byte_code_descriptor cvt[4];
236EDID_INLINE_ROUTINE uint16_t edid1_CVT_addressable_lines_high (
237 EDID_CVT_3_byte_code_descriptor *cvt)
239 return (cvt->AddressableLinesLow |
240 (cvt->VerticalRate_PreferredVerticalRate &
241 (EDID1_CVT_AddressableLinesHighMask<<EDID1_CVT_AddressableLinesHighOff)
242 ) << (8-EDID1_CVT_AddressableLinesHighOff) );
245EDID_INLINE_ROUTINE uint8_t edid1_CVT_aspect_ratio (
246 EDID_CVT_3_byte_code_descriptor *cvt)
248 return (cvt->AspectRatio_AddressableLinesHigh >> EDID1_CVT_AspectRatioOff) &
249 EDID1_CVT_AspectRatioMask;
252#define EDID_DTT_EstablishedTimingsIII 0xF7
254 uint8_t RevisionNumber;
258 EST_1152x864_75Hz = 0,
259 EST_1024x768_85Hz = 1,
260 EST_800x600_85Hz = 2,
261 EST_848x480_60Hz = 3,
262 EST_640x480_85Hz = 4,
263 EST_720x400_85Hz = 5,
264 EST_640x400_85Hz = 6,
265 EST_640x350_85Hz = 7,
267 EST_1280x1024_85Hz = 8,
268 EST_1280x1024_60Hz = 9,
269 EST_1280x960_85Hz = 10,
270 EST_1280x960_60Hz = 11,
271 EST_1280x768_85Hz = 12,
272 EST_1280x768_75Hz = 13,
273 EST_1280x768_60Hz = 14,
274 EST_1280x768_60HzRB = 15,
276 EST_1400x1050_75Hz = 16,
277 EST_1400x1050_60Hz = 17,
278 EST_1400x1050_60HzRB= 18,
279 EST_1400x900_85Hz = 19,
280 EST_1400x900_75Hz = 20,
281 EST_1400x900_60Hz = 21,
282 EST_1400x900_60HzRB = 22,
283 EST_1360x768_60Hz = 23,
285 EST_1600x1200_70Hz = 24,
286 EST_1600x1200_65Hz = 25,
287 EST_1600x1200_60Hz = 26,
288 EST_1680x1050_85Hz = 27,
289 EST_1680x1050_75Hz = 28,
290 EST_1680x1050_60Hz = 29,
291 EST_1680x1050_60HzRB= 30,
292 EST_1400x1050_85Hz = 31,
294 EST_1920x1200_60Hz = 32,
295 EST_1920x1200_60HzRB= 33,
296 EST_1856x1392_75Hz = 34,
297 EST_1856x1392_60Hz = 35,
298 EST_1792x1344_75Hz = 36,
299 EST_1792x1344_60Hz = 37,
300 EST_1600x1200_85Hz = 38,
301 EST_1600x1200_75Hz = 39,
303 EST_1920x1440_75Hz = 44,
304 EST_1920x1440_60Hz = 45,
305 EST_1920x1200_85Hz = 46,
306 EST_1920x1200_75Hz = 47,
309#define EDID_DTT_DescriptorSpaceUnused 0x10
317 uint8_t DescriptorData[13];
321 EDID_detailed_timing_descriptor dtd;
322 EDID_monitor_descriptor md;
325#define EDID1_STI_ImageAspectRatioOff 0
326#define EDID1_STI_ImageAspectRatioMask 0x3
327#define EDID1_STI_RefreshRateOff 2
328#define EDID1_STI_RefreshRateMask 0x3F
330#define EDID_STI_DescriptorUnused 0x0101
331#define EDID_STI_AspectRatio_16_10 0
332#define EDID_STI_AspectRatio_4_3 1
333#define EDID_STI_AspectRatio_5_4 2
334#define EDID_STI_AspectRatio_16_9 3
336 uint8_t HorizontalActivePixels;
337 uint8_t ImageAspectRatio_RefreshRate;
342#define EDID1_VID_DigitalSignalLevelOff 7
343#define EDID1_VID_DigitalSignalLevelMask 0x1
345#define EDID1_VID_ColorBitDepthOff 4
346#define EDID1_VID_ColorBitDepthMask 0x7
347#define EDID1_VID_DigitalVideoStandardSuppOff 0
348#define EDID1_VID_DigitalVideoStandardSuppMask 0xF
350#define EDID1_VID_SignalLevelStandardOff 5
351#define EDID1_VID_SignalLevelStandardMask 0x3
352#define EDID1_VID_VideoSetupBlankOff 4
353#define EDID1_VID_VideoSetupBlankMask 0x1
354#define EDID1_VID_SeparateSyncHandVSignalsOff 3
355#define EDID1_VID_SeparateSyncHandVSignalsMask 0x1
356#define EDID1_VID_SyncSignalOnHorizontalOff 2
357#define EDID1_VID_SyncSignalOnHorizontalMask 0x1
358#define EDID1_VID_SyncSignalOnGreenOff 1
359#define EDID1_VID_SyncSignalOnGreenMask 0x1
360#define EDID1_VID_SerationOnVerticalSyncOff 0
361#define EDID1_VID_SerationOnVerticalSyncMask 0x1
363#define EDID_SLS_0700_0300_1000Vpp 0x0
364#define EDID_SLS_0714_0286_1000Vpp 0x1
365#define EDID_SLS_1000_0400_1400Vpp 0x2
366#define EDID_SLS_0700_0000_0700Vpp 0x3
370#define CBD_6bPerPrimaryColor 0x1
371#define CBD_8bPerPrimaryColor 0x2
372#define CBD_10bPerPrimaryColor 0x3
373#define CBD_12bPerPrimaryColor 0x4
374#define CBD_14bPerPrimaryColor 0x5
375#define CBD_16bPerPrimaryColor 0x6
376#define CBD_reserved 0x7
381#define DVS_HDMI_a 0x2
382#define DVS_HDMI_b 0x3
384#define DVS_DiplayPort 0x5
387#define EDID1_Feature_GTFSupported_mask 0x1
388#define EDID1_Feature_GTFSupported_off 0
389#define EDID1_Feature_PreferredTimingMode_mask 0x1
390#define EDID1_Feature_PreferredTimingMode_off 1
391#define EDID1_Feature_StandardDefaultColorSpace_mask 0x1
392#define EDID1_Feature_StandardDefaultColorSpace_off 2
393#define EDID1_Feature_DisplayType_mask 0x2
394#define EDID1_Feature_DisplayType_off 3
396#define EDID1_Feature_ActiveOff_mask 0x1
397#define EDID1_Feature_ActiveOff_off 5
398#define EDID1_Feature_Suspend_mask 0x1
399#define EDID1_Feature_Suspend_off 6
400#define EDID1_Feature_StandBy_mask 0x1
401#define EDID1_Feature_StandBy_off 7
403#define EDID_DisplayType_Monochrome 0
404#define EDID_DisplayType_RGBcolor 1
405#define EDID_DisplayType_nonRGBcolor 2
406#define EDID_DisplayType_undef 3
408#define EDID_DisplayType_RGB444 0
409#define EDID_DisplayType_RGB444YCrCb444 1
410#define EDID_DisplayType_RGB444YCrCb422 2
411#define EDID_DisplayType_RGB444YCrCb444YCrCb422 3
416 uint8_t IDManufacturerName[2];
417 uint8_t IDProductCode[2];
418 uint8_t IDSerialNumber[4];
419 uint8_t WeekofManufacture;
420 uint8_t YearofManufacture;
426 uint8_t VideoInputDefinition;
427 uint8_t MaxHorizontalImageSize;
428 uint8_t MaxVerticalImageSize;
429 uint8_t DisplayTransferCharacteristic;
434 uint8_t WhiteBlueLow;
444 uint8_t EST_I_II_Man[3];
446 EDID_standard_timing_identification STI[8];
449 uint8_t ExtensionFlag;
453EDID_INLINE_ROUTINE uint16_t edid1_RedX (EDID_edid1 *edid) {
454 return (edid->RedXHigh<<2) | (edid->GreenRedLow>>6);
456EDID_INLINE_ROUTINE uint16_t edid1_RedY (EDID_edid1 *edid) {
457 return (edid->RedYHigh<<2) | (edid->GreenRedLow>>4)&&0x3;
459EDID_INLINE_ROUTINE uint16_t edid1_GreenX (EDID_edid1 *edid) {
460 return (edid->GreenXHigh<<2) | (edid->GreenRedLow>>2)&&0x3;
462EDID_INLINE_ROUTINE uint16_t edid1_GreenY (EDID_edid1 *edid) {
463 return (edid->GreenYHigh<<2) | (edid->GreenRedLow&0x3);
465EDID_INLINE_ROUTINE uint16_t edid1_BlueX (EDID_edid1 *edid) {
466 return (edid->BlueXHigh<<2) | (edid->WhiteBlueLow>>6);
468EDID_INLINE_ROUTINE uint16_t edid1_BlueY (EDID_edid1 *edid) {
469 return (edid->BlueYHigh<<2) | (edid->WhiteBlueLow>>4)&&0x3;
471EDID_INLINE_ROUTINE uint16_t edid1_WhiteX (EDID_edid1 *edid) {
472 return (edid->WhiteXHigh<<2) | (edid->WhiteBlueLow>>2)&&0x3;
474EDID_INLINE_ROUTINE uint16_t edid1_WhiteY (EDID_edid1 *edid) {
475 return (edid->WhiteYHigh<<2) | (edid->WhiteBlueLow&0x3);
478EDID_INLINE_ROUTINE
int edid1_STI_is_unused (
479 const EDID_standard_timing_identification *edid_sti) {
480 return (edid_sti->HorizontalActivePixels ==
481 (uint8_t)EDID_STI_DescriptorUnused) &&
482 (edid_sti->ImageAspectRatio_RefreshRate ==
483 (uint8_t)(EDID_STI_DescriptorUnused >> 8));
486enum edid1_established_timings {
488 EST_800x600_60Hz = 0,
489 EST_800x600_56Hz = 1,
490 EST_640x480_75Hz = 2,
491 EST_640x480_72Hz = 3,
492 EST_640x480_67Hz = 4,
493 EST_640x480_60Hz = 5,
494 EST_720x400_88Hz = 6,
495 EST_720x400_70Hz = 7,
497 EST_1280x1024_75Hz = 8,
498 EST_1024x768_75Hz = 9,
499 EST_1024x768_70Hz = 10,
500 EST_1024x768_60Hz = 11,
501 EST_1024x768_87Hz = 12,
502 EST_832x624_75Hz = 13,
503 EST_800x600_75Hz = 14,
504 EST_800x600_72Hz = 15,
506 EST_1152x870_75Hz = 23,
509EDID_INLINE_ROUTINE uint8_t edid1_established_tim (
511 enum edid1_established_timings est)
513 return (uint8_t)(edid->EST_I_II_Man[est/8] & (est%8));
This header file provides basic definitions used by the API and the implementation.
Used for passing and retrieving registers content to/from real mode interrupt call.
Definition: realmode_int.h:45