From b9b5e3078dfdcf0f9a8515f55a4eb44b6c55a9f5 Mon Sep 17 00:00:00 2001 From: li-elvin Date: Fri, 28 Oct 2011 08:23:37 +0000 Subject: 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 --- .../Universal/Console/ConSplitterDxe/ConSplitter.c | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'MdeModulePkg/Universal/Console/ConSplitterDxe') diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index 8b9b2e77fd..6425beac8b 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -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; -- cgit v1.2.3