Update consplitter driver to use dynamic PCD to set console output mode instead of use L"ConOutMode" and gEfiGenericPlatformVariableGuid to set console output mode.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7574 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2009-02-23 03:11:13 +00:00
parent 2db4a77e60
commit 589f16d2bf
3 changed files with 10 additions and 44 deletions

View File

@ -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 ;

View File

@ -33,7 +33,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/PrimaryStandardErrorDevice.h>
#include <Guid/PrimaryConsoleOutDevice.h>
#include <Guid/PrimaryConsoleInDevice.h>
#include <Guid/GenericPlatformVariable.h>
#include <Guid/ConsoleInDevice.h>
#include <Guid/StandardErrorDevice.h>
#include <Guid/ConsoleOutDevice.h>
@ -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;

View File

@ -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.