From 675253b4a459a44c28be7332ce057c87e9c98fbb Mon Sep 17 00:00:00 2001 From: li-elvin Date: Fri, 28 Oct 2011 08:25:18 +0000 Subject: Set video resolution to highest when PcdVideoHorizontalResolution or PcdVideoVerticalResolution are set to 0x0. Signed-off-by: li-elvin Reviewed-by: niruiyu, hhtian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12596 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Csm/BiosThunk/VideoDxe/BiosVideo.c | 25 ++++++++++++++++++++++ .../Csm/BiosThunk/VideoDxe/VideoDxe.inf | 2 ++ 2 files changed, 27 insertions(+) (limited to 'IntelFrameworkModulePkg') diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c b/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c index f8830b1763..ceb362798c 100644 --- a/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c +++ b/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c @@ -1225,12 +1225,18 @@ BiosVideoCheckForVbe ( UINT8 *EdidOverrideDataBlock; UINTN EdidActiveDataSize; UINT8 *EdidActiveDataBlock; + UINT32 HighestHorizontalResolution; + UINT32 HighestVerticalResolution; + UINTN HighestResolutionMode; EdidFound = TRUE; EdidOverrideFound = FALSE; EdidOverrideDataBlock = NULL; EdidActiveDataSize = 0; EdidActiveDataBlock = NULL; + HighestHorizontalResolution = 0; + HighestVerticalResolution = 0; + HighestResolutionMode = 0; // // Allocate buffer under 1MB for VBE data structures @@ -1526,6 +1532,16 @@ BiosVideoCheckForVbe ( continue; } + // + // Record the highest resolution mode to set later + // + if ((BiosVideoPrivate->VbeModeInformationBlock->XResolution >= HighestHorizontalResolution) && + (BiosVideoPrivate->VbeModeInformationBlock->YResolution >= HighestVerticalResolution)) { + HighestHorizontalResolution = BiosVideoPrivate->VbeModeInformationBlock->XResolution; + HighestVerticalResolution = BiosVideoPrivate->VbeModeInformationBlock->YResolution; + HighestResolutionMode = ModeNumber; + } + // // Add mode to the list of available modes // @@ -1620,6 +1636,15 @@ BiosVideoCheckForVbe ( // // Find the best mode to initialize // + if ((PcdGet32 (PcdVideoHorizontalResolution) == 0x0) || (PcdGet32 (PcdVideoVerticalResolution) == 0x0)) { + DEBUG_CODE ( + BIOS_VIDEO_MODE_DATA *ModeData; + ModeData = &BiosVideoPrivate->ModeData[HighestResolutionMode]; + DEBUG ((EFI_D_INFO, "BiosVideo set highest resolution %d x %d\n", + ModeData->HorizontalResolution, ModeData->VerticalResolution)); + ); + PreferMode = HighestResolutionMode; + } Status = BiosVideoGraphicsOutputSetMode (&BiosVideoPrivate->GraphicsOutput, (UINT32) PreferMode); if (EFI_ERROR (Status)) { for (PreferMode = 0; PreferMode < ModeNumber; PreferMode ++) { diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf b/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf index bf5f255dcf..33dad82109 100644 --- a/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf +++ b/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf @@ -78,3 +78,5 @@ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBiosVideoSetTextVgaModeEnable gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBiosVideoCheckVbeEnable gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBiosVideoCheckVgaEnable + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution -- cgit v1.2.3