diff options
author | li-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-11-24 01:01:48 +0000 |
---|---|---|
committer | li-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-11-24 01:01:48 +0000 |
commit | 32bc1227a5a75fe086970420f98c91e500fd88cb (patch) | |
tree | 39e990ff9d402c1bf3e593098b17bc5f2db797ec /IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | |
parent | 21d13c61561c465a4d4cfe0f0d188765fc8ae3b9 (diff) | |
download | edk2-platforms-32bc1227a5a75fe086970420f98c91e500fd88cb.tar.xz |
Update console mode setup to use PcdSetupConOutColumn and PcdSetupConOutRow which are specially for BIOS setup.
Signed-off-by: li-elvin
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12770 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 4bba3e0499..8a8286a704 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -17,6 +17,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Language.h"
#include "Hotkey.h"
+BOOLEAN mSetupModeInitialized = FALSE;
+UINT32 mSetupTextModeColumn;
+UINT32 mSetupTextModeRow;
+UINT32 mSetupHorizontalResolution;
+UINT32 mSetupVerticalResolution;
+
BOOLEAN gConnectAllHappened = FALSE;
UINTN gCallbackKey;
@@ -961,10 +967,6 @@ ChangeModeForSetup ( UINT32 MaxGopMode;
UINT32 MaxTextMode;
UINT32 ModeNumber;
- UINT32 SetupTextModeColumn;
- UINT32 SetupTextModeRow;
- UINT32 SetupHorizontalResolution;
- UINT32 SetupVerticalResolution;
UINTN HandleCount;
EFI_HANDLE *HandleBuffer;
EFI_STATUS Status;
@@ -995,12 +997,15 @@ ChangeModeForSetup ( }
//
- // Get user defined text mode for setup.
+ // Get user defined text mode for setup only once.
//
- SetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);
- SetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
- SetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
- SetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
+ if (!mSetupModeInitialized) {
+ mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);
+ mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
+ mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
+ mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
+ mSetupModeInitialized = TRUE;
+ }
MaxGopMode = GraphicsOutput->Mode->MaxMode;
MaxTextMode = SimpleTextOut->Mode->MaxMode;
@@ -1020,17 +1025,17 @@ ChangeModeForSetup ( &Info
);
if (!EFI_ERROR (Status)) {
- if ((Info->HorizontalResolution == SetupHorizontalResolution) &&
- (Info->VerticalResolution == SetupVerticalResolution)) {
- if ((GraphicsOutput->Mode->Info->HorizontalResolution == SetupHorizontalResolution) &&
- (GraphicsOutput->Mode->Info->VerticalResolution == SetupVerticalResolution)) {
+ if ((Info->HorizontalResolution == mSetupHorizontalResolution) &&
+ (Info->VerticalResolution == mSetupVerticalResolution)) {
+ if ((GraphicsOutput->Mode->Info->HorizontalResolution == mSetupHorizontalResolution) &&
+ (GraphicsOutput->Mode->Info->VerticalResolution == mSetupVerticalResolution)) {
//
// If current video resolution is same with setup video resolution,
// then check if current text mode is same with setup text mode.
//
Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);
ASSERT_EFI_ERROR (Status);
- if (CurrentColumn == SetupTextModeColumn && CurrentRow == SetupTextModeRow) {
+ if (CurrentColumn == mSetupTextModeColumn && CurrentRow == mSetupTextModeRow) {
//
// Current text mode is same with setup text mode, text mode need not be change.
//
@@ -1043,7 +1048,7 @@ ChangeModeForSetup ( for (Index = 0; Index < MaxTextMode; Index++) {
Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);
if (!EFI_ERROR(Status)) {
- if ((CurrentColumn == SetupTextModeColumn) && (CurrentRow == SetupTextModeRow)) {
+ if ((CurrentColumn == mSetupTextModeColumn) && (CurrentRow == mSetupTextModeRow)) {
//
// setup text mode is supported, set it.
//
@@ -1052,8 +1057,8 @@ ChangeModeForSetup ( //
// Update text mode PCD.
//
- PcdSet32 (PcdConOutColumn, SetupTextModeColumn);
- PcdSet32 (PcdConOutRow, SetupTextModeRow);
+ PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
+ PcdSet32 (PcdConOutRow, mSetupTextModeRow);
FreePool (Info);
return EFI_SUCCESS;
}
@@ -1079,10 +1084,10 @@ ChangeModeForSetup ( // Set PCD to restart GraphicsConsole and Consplitter to change video resolution
// and produce new text mode based on new resolution.
//
- PcdSet32 (PcdVideoHorizontalResolution, SetupHorizontalResolution);
- PcdSet32 (PcdVideoVerticalResolution, SetupVerticalResolution);
- PcdSet32 (PcdConOutColumn, SetupTextModeColumn);
- PcdSet32 (PcdConOutRow, SetupTextModeRow);
+ PcdSet32 (PcdVideoHorizontalResolution, mSetupHorizontalResolution);
+ PcdSet32 (PcdVideoVerticalResolution, mSetupVerticalResolution);
+ PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
+ PcdSet32 (PcdConOutRow, mSetupTextModeRow);
Status = gBS->LocateHandleBuffer (
ByProtocol,
|