/** @file\r
ConsoleOut Routines that speak VGA.\r
\r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
((EdidDataBlock->EstablishedTimings[2] & 0x80) << 9) ;\r
for (Index = 0; Index < VESA_BIOS_EXTENSIONS_EDID_ESTABLISHED_TIMING_MAX_NUMBER; Index ++) {\r
if ((TimingBits & 0x1) != 0) {\r
+ DEBUG ((EFI_D_INFO, "Established Timing: %d x %d\n",\r
+ mEstablishedEdidTiming[Index].HorizontalResolution, mEstablishedEdidTiming[Index].VerticalResolution));\r
ValidEdidTiming->Key[ValidNumber] = CalculateEdidKey (&mEstablishedEdidTiming[Index]);\r
ValidNumber ++;\r
}\r
TimingBits = TimingBits >> 1;\r
}\r
- } else {\r
+ }\r
+\r
+ //\r
+ // Parse the standard timing data\r
+ //\r
+ BufferIndex = &EdidDataBlock->StandardTimingIdentification[0];\r
+ for (Index = 0; Index < 8; Index ++) {\r
//\r
- // If no Established timing data, read the standard timing data\r
+ // Check if this is a valid Standard Timing entry\r
+ // VESA documents unused fields should be set to 01h\r
//\r
- BufferIndex = &EdidDataBlock->StandardTimingIdentification[0];\r
- for (Index = 0; Index < 8; Index ++) {\r
- if ((BufferIndex[0] != 0x1) && (BufferIndex[1] != 0x1)){\r
- //\r
- // A valid Standard Timing\r
- //\r
- HorizontalResolution = (UINT16) (BufferIndex[0] * 8 + 248);\r
- AspectRatio = (UINT8) (BufferIndex[1] >> 6);\r
- switch (AspectRatio) {\r
- case 0:\r
- VerticalResolution = (UINT16) (HorizontalResolution / 16 * 10);\r
- break;\r
- case 1:\r
- VerticalResolution = (UINT16) (HorizontalResolution / 4 * 3);\r
- break;\r
- case 2:\r
- VerticalResolution = (UINT16) (HorizontalResolution / 5 * 4);\r
- break;\r
- case 3:\r
- VerticalResolution = (UINT16) (HorizontalResolution / 16 * 9);\r
- break;\r
- default:\r
- VerticalResolution = (UINT16) (HorizontalResolution / 4 * 3);\r
- break;\r
- }\r
- RefreshRate = (UINT8) ((BufferIndex[1] & 0x1f) + 60);\r
- TempTiming.HorizontalResolution = HorizontalResolution;\r
- TempTiming.VerticalResolution = VerticalResolution;\r
- TempTiming.RefreshRate = RefreshRate;\r
- ValidEdidTiming->Key[ValidNumber] = CalculateEdidKey (&TempTiming);\r
- ValidNumber ++;\r
+ if ((BufferIndex[0] != 0x1) && (BufferIndex[1] != 0x1)){\r
+ //\r
+ // A valid Standard Timing\r
+ //\r
+ HorizontalResolution = (UINT16) (BufferIndex[0] * 8 + 248);\r
+ AspectRatio = (UINT8) (BufferIndex[1] >> 6);\r
+ switch (AspectRatio) {\r
+ case 0:\r
+ VerticalResolution = (UINT16) (HorizontalResolution / 16 * 10);\r
+ break;\r
+ case 1:\r
+ VerticalResolution = (UINT16) (HorizontalResolution / 4 * 3);\r
+ break;\r
+ case 2:\r
+ VerticalResolution = (UINT16) (HorizontalResolution / 5 * 4);\r
+ break;\r
+ case 3:\r
+ VerticalResolution = (UINT16) (HorizontalResolution / 16 * 9);\r
+ break;\r
+ default:\r
+ VerticalResolution = (UINT16) (HorizontalResolution / 4 * 3);\r
+ break;\r
}\r
- BufferIndex += 2;\r
+ RefreshRate = (UINT8) ((BufferIndex[1] & 0x1f) + 60);\r
+ DEBUG ((EFI_D_INFO, "Standard Timing: %d x %d\n", HorizontalResolution, VerticalResolution));\r
+ TempTiming.HorizontalResolution = HorizontalResolution;\r
+ TempTiming.VerticalResolution = VerticalResolution;\r
+ TempTiming.RefreshRate = RefreshRate;\r
+ ValidEdidTiming->Key[ValidNumber] = CalculateEdidKey (&TempTiming);\r
+ ValidNumber ++;\r
}\r
+ BufferIndex += 2;\r
+ }\r
+\r
+ //\r
+ // Parse the Detailed Timing data\r
+ //\r
+ BufferIndex = &EdidDataBlock->DetailedTimingDescriptions[0];\r
+ for (Index = 0; Index < 4; Index ++, BufferIndex += VESA_BIOS_EXTENSIONS_DETAILED_TIMING_EACH_DESCRIPTOR_SIZE) {\r
+ if ((BufferIndex[0] == 0x0) && (BufferIndex[1] == 0x0)) {\r
+ //\r
+ // Check if this is a valid Detailed Timing Descriptor\r
+ // If first 2 bytes are zero, it is monitor descriptor other than detailed timing descriptor\r
+ //\r
+ continue;\r
+ }\r
+ //\r
+ // Calculate Horizontal and Vertical resolution\r
+ //\r
+ TempTiming.HorizontalResolution = ((UINT16)(BufferIndex[4] & 0xF0) << 4) | (BufferIndex[2]);\r
+ TempTiming.VerticalResolution = ((UINT16)(BufferIndex[7] & 0xF0) << 4) | (BufferIndex[5]);\r
+ DEBUG ((EFI_D_INFO, "Detailed Timing %d: %d x %d\n",\r
+ Index, TempTiming.HorizontalResolution, TempTiming.VerticalResolution));\r
+ ValidEdidTiming->Key[ValidNumber] = CalculateEdidKey (&TempTiming);\r
+ ValidNumber ++;\r
}\r
\r
ValidEdidTiming->ValidNumber = ValidNumber;\r