diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index 153974a051..e189b7d5c9 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -2918,7 +2918,6 @@ ConsplitterSetConsoleOutMode ( UINTN MaxMode; EFI_STATUS Status; CONSOLE_OUT_MODE ModeInfo; - UINTN ModeInfoSize; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut; PreferMode = 0xFF; @@ -2926,31 +2925,8 @@ ConsplitterSetConsoleOutMode ( TextOut = &Private->TextOut; MaxMode = (UINTN) (TextOut->Mode->MaxMode); - ModeInfoSize = sizeof (CONSOLE_OUT_MODE); - Status = gRT->GetVariable ( - VARCONOUTMODE, - &gEfiGenericPlatformVariableGuid, - NULL, - &ModeInfoSize, - &ModeInfo - ); - - if (EFI_ERROR(Status)) { - // - // If fail to get variable, set variable to the default mode 80 x 25 - // required by UEFI spec; - // - ModeInfo.Column = 80; - ModeInfo.Row = 25; - - gRT->SetVariable ( - VARCONOUTMODE, - &gEfiGenericPlatformVariableGuid, - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, - sizeof (CONSOLE_OUT_MODE), - &ModeInfo - ); - } + ModeInfo.Column = PcdGet32 (PcdConOutColumn); + ModeInfo.Row = PcdGet32 (PcdConOutRow); // // To find the prefer mode and basic mode from Text Out mode list @@ -2968,7 +2944,7 @@ ConsplitterSetConsoleOutMode ( } // - // Set perfer mode to Text Out devices. + // Set prefer mode to Text Out devices. // Status = TextOut->SetMode (TextOut, PreferMode); if (EFI_ERROR(Status)) { @@ -2977,20 +2953,9 @@ ConsplitterSetConsoleOutMode ( // Status = TextOut->SetMode (TextOut, BaseMode); ASSERT(!EFI_ERROR(Status)); - - ModeInfo.Column = 80; - ModeInfo.Row = 25; - - // - // Update ConOutMode variable - // - gRT->SetVariable ( - VARCONOUTMODE, - &gEfiGenericPlatformVariableGuid, - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, - sizeof (CONSOLE_OUT_MODE), - &ModeInfo - ); + + PcdSet32 (PcdConOutColumn, 80); + PcdSet32 (PcdConOutRow, 25); } return ; diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h index 4e37213b34..b4b8f1d322 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h @@ -33,7 +33,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include #include @@ -84,7 +83,6 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterStdErrComponentName2; #define CONSOLE_SPLITTER_MODES_ALLOC_UNIT 32 #define MAX_STD_IN_PASSWORD 80 -#define VARCONOUTMODE L"ConOutMode" typedef struct { UINTN Column; diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf index b4248fe27f..f33b26af41 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf @@ -77,7 +77,6 @@ gEfiPrimaryConsoleOutDeviceGuid ## PRODUCES gEfiPrimaryConsoleInDeviceGuid ## PRODUCES gEfiPrimaryStandardErrorDeviceGuid ## PRODUCES - gEfiGenericPlatformVariableGuid ## SOMETIMES_CONSUMES ## Variable:L"ConOutMode" [Protocols] gEfiConsoleControlProtocolGuid ## PRODUCES @@ -96,6 +95,10 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport +[Pcd.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn + # [Event] # ## # # mConIn.LockEvent, used to record and check key sequence on StdIn. Periodic is 25ms.