Remove hard code video resolution in C code and use PCD PcdVideoHorizontalResolution/PcdVideoVerticalResolution for customization. And when PcdConOutRow/PcdConOutColumn and PcdVideoHorizontalResolution/PcdVideoVerticalResolution are all set to 0, the console will be max video resolution and max text mode.

Signed-off-by: li-elvin
Reviewed-by: niruiyu, hhtian


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12595 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
li-elvin
2011-10-28 08:23:37 +00:00
parent a40af6b043
commit b9b5e3078d
5 changed files with 143 additions and 80 deletions

View File

@@ -2901,6 +2901,7 @@ ConsplitterSetConsoleOutMode (
UINTN MaxMode;
EFI_STATUS Status;
CONSOLE_OUT_MODE ModeInfo;
CONSOLE_OUT_MODE MaxModeInfo;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
PreferMode = 0xFF;
@@ -2908,8 +2909,10 @@ ConsplitterSetConsoleOutMode (
TextOut = &Private->TextOut;
MaxMode = (UINTN) (TextOut->Mode->MaxMode);
ModeInfo.Column = PcdGet32 (PcdConOutColumn);
ModeInfo.Row = PcdGet32 (PcdConOutRow);
MaxModeInfo.Column = 0;
MaxModeInfo.Row = 0;
ModeInfo.Column = PcdGet32 (PcdConOutColumn);
ModeInfo.Row = PcdGet32 (PcdConOutRow);
//
// To find the prefer mode and basic mode from Text Out mode list
@@ -2917,8 +2920,23 @@ ConsplitterSetConsoleOutMode (
for (Mode = 0; Mode < MaxMode; Mode++) {
Status = TextOut->QueryMode (TextOut, Mode, &Col, &Row);
if (!EFI_ERROR(Status)) {
if (Col == ModeInfo.Column && Row == ModeInfo.Row) {
PreferMode = Mode;
if ((ModeInfo.Column != 0) && (ModeInfo.Row != 0)) {
//
// Use user defined column and row
//
if (Col == ModeInfo.Column && Row == ModeInfo.Row) {
PreferMode = Mode;
}
} else {
//
// If user sets PcdConOutColumn or PcdConOutRow to 0,
// find and set the highest text mode.
//
if ((Col >= MaxModeInfo.Column) && (Row >= MaxModeInfo.Row)) {
MaxModeInfo.Column = Col;
MaxModeInfo.Row = Row;
PreferMode = Mode;
}
}
if (Col == 80 && Row == 25) {
BaseMode = Mode;