# This PCD should be set as HII type PCD by platform integrator mapped to variable L"HwErrRecSupport"\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|0|UINT16|0x40000002\r
\r
+[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
+ ## The 4 PCDs below are used to specify the video resolution and text mode of text setup.\r
+ # To make text setup work in this resolution, PcdVideoHorizontalResolution, PcdVideoVerticalResolution,\r
+ # PcdConOutColumn and PcdConOutRow in MdeModulePkg.dec should be created as PcdsDynamic or PcdsDynamicEx\r
+ # in platform DSC file. Then BDS setup will update these PCDs defined in MdeModulePkg.dec and reconnect\r
+ # console drivers (GraphicsConsole, Terminal, Consplitter) to make the video resolution and text mode work\r
+ # for text setup.\r
+\r
+ ## The PCD is used to specify the video horizontal resolution of text setup. \r
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|800|UINT32|0x50000001\r
+ \r
+ ## The PCD is used to specify the video vertical resolution of text setup.\r
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|600|UINT32|0x50000002\r
+\r
+ ## The PCD is used to specify the console output column of text setup.\r
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|80|UINT32|0x50000003\r
+ \r
+ ## The PCD is used to specify the console output column of text setup.\r
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x50000004\r
+\r
[PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule]\r
## I/O Base address of floppy device controller.\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFdcBaseAddress|0x3f0|UINT16|0x30000000\r
## The PCD is used to specify the high PMM (Post Memory Manager) size with bytes above 1MB.\r
# The value should be a multiple of 4KB.\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x3000000a\r
-\r
- ## The 4 PCDs below are used to specify the video resolution and text mode of text setup.\r
- # To make text setup work in this resolution, PcdVideoHorizontalResolution, PcdVideoVerticalResolution,\r
- # PcdConOutColumn and PcdConOutRow in MdeModulePkg.dec should be created as PcdsDynamic or PcdsDynamicEx\r
- # in platform DSC file. Then BDS setup will update these PCDs defined in MdeModulePkg.dec and reconnect\r
- # console drivers (GraphicsConsole, Terminal, Consplitter) to make the video resolution and text mode work\r
- # for text setup.\r
-\r
- ## The PCD is used to specify the video horizontal resolution of text setup. \r
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|800|UINT32|0x3000000b\r
- \r
- ## The PCD is used to specify the video vertical resolution of text setup.\r
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|600|UINT32|0x3000000c\r
-\r
- ## The PCD is used to specify the console output column of text setup.\r
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|80|UINT32|0x3000000d\r
- \r
- ## The PCD is used to specify the console output column of text setup.\r
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x3000000e
\ No newline at end of file
+
\ No newline at end of file
#include "Language.h"\r
#include "Hotkey.h"\r
\r
+BOOLEAN mSetupModeInitialized = FALSE;\r
+UINT32 mSetupTextModeColumn;\r
+UINT32 mSetupTextModeRow;\r
+UINT32 mSetupHorizontalResolution;\r
+UINT32 mSetupVerticalResolution;\r
+\r
BOOLEAN gConnectAllHappened = FALSE;\r
UINTN gCallbackKey;\r
\r
UINT32 MaxGopMode;\r
UINT32 MaxTextMode;\r
UINT32 ModeNumber;\r
- UINT32 SetupTextModeColumn;\r
- UINT32 SetupTextModeRow;\r
- UINT32 SetupHorizontalResolution;\r
- UINT32 SetupVerticalResolution;\r
UINTN HandleCount;\r
EFI_HANDLE *HandleBuffer;\r
EFI_STATUS Status;\r
}\r
\r
//\r
- // Get user defined text mode for setup.\r
+ // Get user defined text mode for setup only once.\r
// \r
- SetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);\r
- SetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution); \r
- SetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);\r
- SetupTextModeRow = PcdGet32 (PcdSetupConOutRow);\r
+ if (!mSetupModeInitialized) {\r
+ mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);\r
+ mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution); \r
+ mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);\r
+ mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);\r
+ mSetupModeInitialized = TRUE;\r
+ }\r
\r
MaxGopMode = GraphicsOutput->Mode->MaxMode;\r
MaxTextMode = SimpleTextOut->Mode->MaxMode;\r
&Info\r
);\r
if (!EFI_ERROR (Status)) {\r
- if ((Info->HorizontalResolution == SetupHorizontalResolution) &&\r
- (Info->VerticalResolution == SetupVerticalResolution)) {\r
- if ((GraphicsOutput->Mode->Info->HorizontalResolution == SetupHorizontalResolution) &&\r
- (GraphicsOutput->Mode->Info->VerticalResolution == SetupVerticalResolution)) {\r
+ if ((Info->HorizontalResolution == mSetupHorizontalResolution) &&\r
+ (Info->VerticalResolution == mSetupVerticalResolution)) {\r
+ if ((GraphicsOutput->Mode->Info->HorizontalResolution == mSetupHorizontalResolution) &&\r
+ (GraphicsOutput->Mode->Info->VerticalResolution == mSetupVerticalResolution)) {\r
//\r
// If current video resolution is same with setup video resolution, \r
// then check if current text mode is same with setup text mode.\r
//\r
Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);\r
ASSERT_EFI_ERROR (Status);\r
- if (CurrentColumn == SetupTextModeColumn && CurrentRow == SetupTextModeRow) {\r
+ if (CurrentColumn == mSetupTextModeColumn && CurrentRow == mSetupTextModeRow) {\r
//\r
// Current text mode is same with setup text mode, text mode need not be change.\r
//\r
for (Index = 0; Index < MaxTextMode; Index++) {\r
Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);\r
if (!EFI_ERROR(Status)) {\r
- if ((CurrentColumn == SetupTextModeColumn) && (CurrentRow == SetupTextModeRow)) {\r
+ if ((CurrentColumn == mSetupTextModeColumn) && (CurrentRow == mSetupTextModeRow)) {\r
//\r
// setup text mode is supported, set it.\r
//\r
//\r
// Update text mode PCD.\r
//\r
- PcdSet32 (PcdConOutColumn, SetupTextModeColumn);\r
- PcdSet32 (PcdConOutRow, SetupTextModeRow);\r
+ PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);\r
+ PcdSet32 (PcdConOutRow, mSetupTextModeRow);\r
FreePool (Info);\r
return EFI_SUCCESS;\r
}\r
// Set PCD to restart GraphicsConsole and Consplitter to change video resolution \r
// and produce new text mode based on new resolution.\r
//\r
- PcdSet32 (PcdVideoHorizontalResolution, SetupHorizontalResolution);\r
- PcdSet32 (PcdVideoVerticalResolution, SetupVerticalResolution);\r
- PcdSet32 (PcdConOutColumn, SetupTextModeColumn);\r
- PcdSet32 (PcdConOutRow, SetupTextModeRow);\r
+ PcdSet32 (PcdVideoHorizontalResolution, mSetupHorizontalResolution);\r
+ PcdSet32 (PcdVideoVerticalResolution, mSetupVerticalResolution);\r
+ PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);\r
+ PcdSet32 (PcdConOutRow, mSetupTextModeRow);\r
\r
Status = gBS->LocateHandleBuffer (\r
ByProtocol,\r