mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
21d13c6156
commit
32bc1227a5
|
@ -152,6 +152,26 @@
|
||||||
# This PCD should be set as HII type PCD by platform integrator mapped to variable L"HwErrRecSupport"
|
# This PCD should be set as HII type PCD by platform integrator mapped to variable L"HwErrRecSupport"
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|0|UINT16|0x40000002
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|0|UINT16|0x40000002
|
||||||
|
|
||||||
|
[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
|
||||||
|
## The 4 PCDs below are used to specify the video resolution and text mode of text setup.
|
||||||
|
# To make text setup work in this resolution, PcdVideoHorizontalResolution, PcdVideoVerticalResolution,
|
||||||
|
# PcdConOutColumn and PcdConOutRow in MdeModulePkg.dec should be created as PcdsDynamic or PcdsDynamicEx
|
||||||
|
# in platform DSC file. Then BDS setup will update these PCDs defined in MdeModulePkg.dec and reconnect
|
||||||
|
# console drivers (GraphicsConsole, Terminal, Consplitter) to make the video resolution and text mode work
|
||||||
|
# for text setup.
|
||||||
|
|
||||||
|
## The PCD is used to specify the video horizontal resolution of text setup.
|
||||||
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|800|UINT32|0x50000001
|
||||||
|
|
||||||
|
## The PCD is used to specify the video vertical resolution of text setup.
|
||||||
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|600|UINT32|0x50000002
|
||||||
|
|
||||||
|
## The PCD is used to specify the console output column of text setup.
|
||||||
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|80|UINT32|0x50000003
|
||||||
|
|
||||||
|
## The PCD is used to specify the console output column of text setup.
|
||||||
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x50000004
|
||||||
|
|
||||||
[PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule]
|
[PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule]
|
||||||
## I/O Base address of floppy device controller.
|
## I/O Base address of floppy device controller.
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFdcBaseAddress|0x3f0|UINT16|0x30000000
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFdcBaseAddress|0x3f0|UINT16|0x30000000
|
||||||
|
@ -195,22 +215,4 @@
|
||||||
## The PCD is used to specify the high PMM (Post Memory Manager) size with bytes above 1MB.
|
## The PCD is used to specify the high PMM (Post Memory Manager) size with bytes above 1MB.
|
||||||
# The value should be a multiple of 4KB.
|
# The value should be a multiple of 4KB.
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x3000000a
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x3000000a
|
||||||
|
|
||||||
## The 4 PCDs below are used to specify the video resolution and text mode of text setup.
|
|
||||||
# To make text setup work in this resolution, PcdVideoHorizontalResolution, PcdVideoVerticalResolution,
|
|
||||||
# PcdConOutColumn and PcdConOutRow in MdeModulePkg.dec should be created as PcdsDynamic or PcdsDynamicEx
|
|
||||||
# in platform DSC file. Then BDS setup will update these PCDs defined in MdeModulePkg.dec and reconnect
|
|
||||||
# console drivers (GraphicsConsole, Terminal, Consplitter) to make the video resolution and text mode work
|
|
||||||
# for text setup.
|
|
||||||
|
|
||||||
## The PCD is used to specify the video horizontal resolution of text setup.
|
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|800|UINT32|0x3000000b
|
|
||||||
|
|
||||||
## The PCD is used to specify the video vertical resolution of text setup.
|
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|600|UINT32|0x3000000c
|
|
||||||
|
|
||||||
## The PCD is used to specify the console output column of text setup.
|
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|80|UINT32|0x3000000d
|
|
||||||
|
|
||||||
## The PCD is used to specify the console output column of text setup.
|
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|25|UINT32|0x3000000e
|
|
|
@ -1033,8 +1033,8 @@ GetConsoleOutMode (
|
||||||
ConOut = gST->ConOut;
|
ConOut = gST->ConOut;
|
||||||
MaxMode = (UINTN) (ConOut->Mode->MaxMode);
|
MaxMode = (UINTN) (ConOut->Mode->MaxMode);
|
||||||
|
|
||||||
CurrentCol = PcdGet32 (PcdConOutColumn);
|
CurrentCol = PcdGet32 (PcdSetupConOutColumn);
|
||||||
CurrentRow = PcdGet32 (PcdConOutRow);
|
CurrentRow = PcdGet32 (PcdSetupConOutRow);
|
||||||
for (Mode = 0; Mode < MaxMode; Mode++) {
|
for (Mode = 0; Mode < MaxMode; Mode++) {
|
||||||
Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);
|
Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
|
|
|
@ -1345,8 +1345,8 @@ Var_UpdateConMode (
|
||||||
|
|
||||||
Status = gST->ConOut->QueryMode (gST->ConOut, Mode, &(ModeInfo.Column), &(ModeInfo.Row));
|
Status = gST->ConOut->QueryMode (gST->ConOut, Mode, &(ModeInfo.Column), &(ModeInfo.Row));
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
PcdSet32 (PcdConOutColumn, (UINT32) ModeInfo.Column);
|
PcdSet32 (PcdSetupConOutColumn, (UINT32) ModeInfo.Column);
|
||||||
PcdSet32 (PcdConOutRow, (UINT32) ModeInfo.Row);
|
PcdSet32 (PcdSetupConOutRow, (UINT32) ModeInfo.Row);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
|
@ -17,6 +17,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "Hotkey.h"
|
#include "Hotkey.h"
|
||||||
|
|
||||||
|
BOOLEAN mSetupModeInitialized = FALSE;
|
||||||
|
UINT32 mSetupTextModeColumn;
|
||||||
|
UINT32 mSetupTextModeRow;
|
||||||
|
UINT32 mSetupHorizontalResolution;
|
||||||
|
UINT32 mSetupVerticalResolution;
|
||||||
|
|
||||||
BOOLEAN gConnectAllHappened = FALSE;
|
BOOLEAN gConnectAllHappened = FALSE;
|
||||||
UINTN gCallbackKey;
|
UINTN gCallbackKey;
|
||||||
|
|
||||||
|
@ -961,10 +967,6 @@ ChangeModeForSetup (
|
||||||
UINT32 MaxGopMode;
|
UINT32 MaxGopMode;
|
||||||
UINT32 MaxTextMode;
|
UINT32 MaxTextMode;
|
||||||
UINT32 ModeNumber;
|
UINT32 ModeNumber;
|
||||||
UINT32 SetupTextModeColumn;
|
|
||||||
UINT32 SetupTextModeRow;
|
|
||||||
UINT32 SetupHorizontalResolution;
|
|
||||||
UINT32 SetupVerticalResolution;
|
|
||||||
UINTN HandleCount;
|
UINTN HandleCount;
|
||||||
EFI_HANDLE *HandleBuffer;
|
EFI_HANDLE *HandleBuffer;
|
||||||
EFI_STATUS Status;
|
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);
|
if (!mSetupModeInitialized) {
|
||||||
SetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
|
mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);
|
||||||
SetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
|
mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
|
||||||
SetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
|
mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
|
||||||
|
mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
|
||||||
|
mSetupModeInitialized = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
MaxGopMode = GraphicsOutput->Mode->MaxMode;
|
MaxGopMode = GraphicsOutput->Mode->MaxMode;
|
||||||
MaxTextMode = SimpleTextOut->Mode->MaxMode;
|
MaxTextMode = SimpleTextOut->Mode->MaxMode;
|
||||||
|
@ -1020,17 +1025,17 @@ ChangeModeForSetup (
|
||||||
&Info
|
&Info
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
if ((Info->HorizontalResolution == SetupHorizontalResolution) &&
|
if ((Info->HorizontalResolution == mSetupHorizontalResolution) &&
|
||||||
(Info->VerticalResolution == SetupVerticalResolution)) {
|
(Info->VerticalResolution == mSetupVerticalResolution)) {
|
||||||
if ((GraphicsOutput->Mode->Info->HorizontalResolution == SetupHorizontalResolution) &&
|
if ((GraphicsOutput->Mode->Info->HorizontalResolution == mSetupHorizontalResolution) &&
|
||||||
(GraphicsOutput->Mode->Info->VerticalResolution == SetupVerticalResolution)) {
|
(GraphicsOutput->Mode->Info->VerticalResolution == mSetupVerticalResolution)) {
|
||||||
//
|
//
|
||||||
// If current video resolution is same with setup video resolution,
|
// If current video resolution is same with setup video resolution,
|
||||||
// then check if current text mode is same with setup text mode.
|
// then check if current text mode is same with setup text mode.
|
||||||
//
|
//
|
||||||
Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);
|
Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);
|
||||||
ASSERT_EFI_ERROR (Status);
|
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.
|
// 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++) {
|
for (Index = 0; Index < MaxTextMode; Index++) {
|
||||||
Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);
|
Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);
|
||||||
if (!EFI_ERROR(Status)) {
|
if (!EFI_ERROR(Status)) {
|
||||||
if ((CurrentColumn == SetupTextModeColumn) && (CurrentRow == SetupTextModeRow)) {
|
if ((CurrentColumn == mSetupTextModeColumn) && (CurrentRow == mSetupTextModeRow)) {
|
||||||
//
|
//
|
||||||
// setup text mode is supported, set it.
|
// setup text mode is supported, set it.
|
||||||
//
|
//
|
||||||
|
@ -1052,8 +1057,8 @@ ChangeModeForSetup (
|
||||||
//
|
//
|
||||||
// Update text mode PCD.
|
// Update text mode PCD.
|
||||||
//
|
//
|
||||||
PcdSet32 (PcdConOutColumn, SetupTextModeColumn);
|
PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
|
||||||
PcdSet32 (PcdConOutRow, SetupTextModeRow);
|
PcdSet32 (PcdConOutRow, mSetupTextModeRow);
|
||||||
FreePool (Info);
|
FreePool (Info);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1079,10 +1084,10 @@ ChangeModeForSetup (
|
||||||
// Set PCD to restart GraphicsConsole and Consplitter to change video resolution
|
// Set PCD to restart GraphicsConsole and Consplitter to change video resolution
|
||||||
// and produce new text mode based on new resolution.
|
// and produce new text mode based on new resolution.
|
||||||
//
|
//
|
||||||
PcdSet32 (PcdVideoHorizontalResolution, SetupHorizontalResolution);
|
PcdSet32 (PcdVideoHorizontalResolution, mSetupHorizontalResolution);
|
||||||
PcdSet32 (PcdVideoVerticalResolution, SetupVerticalResolution);
|
PcdSet32 (PcdVideoVerticalResolution, mSetupVerticalResolution);
|
||||||
PcdSet32 (PcdConOutColumn, SetupTextModeColumn);
|
PcdSet32 (PcdConOutColumn, mSetupTextModeColumn);
|
||||||
PcdSet32 (PcdConOutRow, SetupTextModeRow);
|
PcdSet32 (PcdConOutRow, mSetupTextModeRow);
|
||||||
|
|
||||||
Status = gBS->LocateHandleBuffer (
|
Status = gBS->LocateHandleBuffer (
|
||||||
ByProtocol,
|
ByProtocol,
|
||||||
|
|
Loading…
Reference in New Issue