diff options
author | li-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-28 08:23:37 +0000 |
---|---|---|
committer | li-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-28 08:23:37 +0000 |
commit | b9b5e3078dfdcf0f9a8515f55a4eb44b6c55a9f5 (patch) | |
tree | ddce6e28db2d7a9a8e3e5ef2154679b5a3014f45 /MdeModulePkg/Universal/Console/ConSplitterDxe | |
parent | a40af6b04369d9067b6b0199d5b816c412dc0d08 (diff) | |
download | edk2-platforms-b9b5e3078dfdcf0f9a8515f55a4eb44b6c55a9f5.tar.xz |
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
Diffstat (limited to 'MdeModulePkg/Universal/Console/ConSplitterDxe')
-rw-r--r-- | MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c | 26 |
1 files changed, 22 insertions, 4 deletions
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;
|