summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-28 08:25:18 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-28 08:25:18 +0000
commit675253b4a459a44c28be7332ce057c87e9c98fbb (patch)
tree60032df4425854a058080535ee308ff7b08e99aa /IntelFrameworkModulePkg
parentb9b5e3078dfdcf0f9a8515f55a4eb44b6c55a9f5 (diff)
downloadedk2-platforms-675253b4a459a44c28be7332ce057c87e9c98fbb.tar.xz
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
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c25
-rw-r--r--IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf2
2 files changed, 27 insertions, 0 deletions
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
@@ -1527,6 +1533,16 @@ BiosVideoCheckForVbe (
}
//
+ // 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
//
ModeNumber ++;
@@ -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