7ae6f15
From f14bf6eae4a923d944194c78f71d4c71c38842e6 Mon Sep 17 00:00:00 2001
b0c3aff
From: Laszlo Ersek <lersek@redhat.com>
b0c3aff
Date: Tue, 25 Feb 2014 18:40:35 +0100
7ae6f15
Subject: [PATCH 07/16] MdeModulePkg: TerminalDxe: add other text resolutions
b0c3aff
b0c3aff
When the console output is multiplexed to several devices by
b0c3aff
ConSplitterDxe, then ConSplitterDxe builds an intersection of text modes
b0c3aff
supported by all console output devices.
b0c3aff
b0c3aff
Two notable output devices are provided by:
b0c3aff
(1) MdeModulePkg/Universal/Console/GraphicsConsoleDxe,
b0c3aff
(2) MdeModulePkg/Universal/Console/TerminalDxe.
b0c3aff
b0c3aff
GraphicsConsoleDxe supports four modes at most -- see
3485002
InitializeGraphicsConsoleTextMode() and "mGraphicsConsoleModeData":
b0c3aff
b0c3aff
(1a) 80x25 (required by the UEFI spec as mode 0),
b0c3aff
(1b) 80x50 (not necessarily supported, but if it is, then the UEFI spec
b0c3aff
     requires the driver to provide it as mode 1),
b0c3aff
(1c) 100x31 (corresponding to graphics resolution 800x600, which the UEFI
b0c3aff
     spec requires from all plug-in graphics devices),
b0c3aff
(1d) "full screen" resolution, derived form the underlying GOP's
b0c3aff
     horizontal and vertical resolutions with division by EFI_GLYPH_WIDTH
b0c3aff
     (8) and EFI_GLYPH_HEIGHT (19), respectively.
b0c3aff
b0c3aff
The automatic "full screen resolution" makes GraphicsConsoleDxe's
b0c3aff
character console very flexible. However, TerminalDxe (which runs on
b0c3aff
serial ports) only provides the following fixed resolutions -- see
3485002
InitializeTerminalConsoleTextMode() and "mTerminalConsoleModeData":
b0c3aff
b0c3aff
(2a) 80x25 (required by the UEFI spec as mode 0),
b0c3aff
(2b) 80x50 (since the character resolution of a serial device cannot be
3485002
     interrogated easily, this is added unconditionally as mode 1),
3485002
(2c) 100x31 (since the character resolution of a serial device cannot be
3485002
     interrogated easily, this is added unconditionally as mode 2).
b0c3aff
b0c3aff
When ConSplitterDxe combines (1) and (2), multiplexing console output to
b0c3aff
both video output and serial terminal, the list of commonly supported text
b0c3aff
modes (ie. the "intersection") comprises:
b0c3aff
b0c3aff
(3a) 80x25, unconditionally, from (1a) and (2a),
b0c3aff
(3b) 80x50, if the graphics console provides at least 640x950 pixel
b0c3aff
     resolution, from (1b) and (2b)
b0c3aff
(3c) 100x31, if the graphics device is a plug-in one (because in that case
b0c3aff
     800x600 is a mandated pixel resolution), from (1c) and (2c).
b0c3aff
b0c3aff
Unfortunately, the "full screen resolution" (1d) of the GOP-based text
b0c3aff
console is not available in general.
b0c3aff
b0c3aff
Mitigate this problem by extending "mTerminalConsoleModeData" with a
b0c3aff
handful of text resolutions that are derived from widespread maximal pixel
b0c3aff
resolutions. This way TerminalDxe won't cause ConSplitterDxe to filter out
b0c3aff
the most frequent (1d) values from the intersection, and eg. the MODE
b0c3aff
command in the UEFI shell will offer the "best" (ie. full screen)
b0c3aff
resolution too.
b0c3aff
3485002
Upstream status: three calendar months (with on-and-off discussion and
3485002
patches) have not been enough to find a solution to this problem that
3485002
would please all stakeholders.
3485002
3485002
Notes about the 20160608b-988715a -> 20170228-c325e41585e3 rebase:
3485002
3485002
- adapt commit 0bc77c63de03 (code and commit message) to upstream commit
3485002
  390b95a49c14 ("MdeModulePkg/TerminalDxe: Refine
3485002
  InitializeTerminalConsoleTextMode", 2017-01-10).
3485002
3485002
Notes about the 20170228-c325e41585e3 -> 20171011-92d07e48907f rebase:
3485002
3485002
- no changes
3485002
b0c3aff
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
3485002
(cherry picked from commit 99dc3720ac86059f60156197328cc433603c536e)
7ae6f15
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
b0c3aff
---
7ae6f15
 .../Universal/Console/TerminalDxe/Terminal.c  | 41 +++++++++++++++++--
d7ad692
 1 file changed, 38 insertions(+), 3 deletions(-)
b0c3aff
b0c3aff
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
7ae6f15
index 66dd3ad..78a1983 100644
b0c3aff
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
b0c3aff
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
d7ad692
@@ -113,9 +113,44 @@ TERMINAL_DEV  mTerminalDevTemplate = {
b0c3aff
 };
b0c3aff
 
b0c3aff
 TERMINAL_CONSOLE_MODE_DATA mTerminalConsoleModeData[] = {
d7ad692
-  {80,  25},
d7ad692
-  {80,  50},
b0c3aff
-  {100, 31},
d7ad692
+  {   80,  25 }, // from graphics resolution  640 x  480
3485002
+  {   80,  50 }, // from graphics resolution  640 x  960
d7ad692
+  {  100,  25 }, // from graphics resolution  800 x  480
d7ad692
+  {  100,  31 }, // from graphics resolution  800 x  600
d7ad692
+  {  104,  32 }, // from graphics resolution  832 x  624
d7ad692
+  {  120,  33 }, // from graphics resolution  960 x  640
d7ad692
+  {  128,  31 }, // from graphics resolution 1024 x  600
d7ad692
+  {  128,  40 }, // from graphics resolution 1024 x  768
d7ad692
+  {  144,  45 }, // from graphics resolution 1152 x  864
d7ad692
+  {  144,  45 }, // from graphics resolution 1152 x  870
d7ad692
+  {  160,  37 }, // from graphics resolution 1280 x  720
d7ad692
+  {  160,  40 }, // from graphics resolution 1280 x  760
d7ad692
+  {  160,  40 }, // from graphics resolution 1280 x  768
d7ad692
+  {  160,  42 }, // from graphics resolution 1280 x  800
d7ad692
+  {  160,  50 }, // from graphics resolution 1280 x  960
d7ad692
+  {  160,  53 }, // from graphics resolution 1280 x 1024
d7ad692
+  {  170,  40 }, // from graphics resolution 1360 x  768
d7ad692
+  {  170,  40 }, // from graphics resolution 1366 x  768
d7ad692
+  {  175,  55 }, // from graphics resolution 1400 x 1050
d7ad692
+  {  180,  47 }, // from graphics resolution 1440 x  900
d7ad692
+  {  200,  47 }, // from graphics resolution 1600 x  900
d7ad692
+  {  200,  63 }, // from graphics resolution 1600 x 1200
d7ad692
+  {  210,  55 }, // from graphics resolution 1680 x 1050
d7ad692
+  {  240,  56 }, // from graphics resolution 1920 x 1080
d7ad692
+  {  240,  63 }, // from graphics resolution 1920 x 1200
d7ad692
+  {  240,  75 }, // from graphics resolution 1920 x 1440
d7ad692
+  {  250, 105 }, // from graphics resolution 2000 x 2000
d7ad692
+  {  256,  80 }, // from graphics resolution 2048 x 1536
d7ad692
+  {  256, 107 }, // from graphics resolution 2048 x 2048
d7ad692
+  {  320,  75 }, // from graphics resolution 2560 x 1440
d7ad692
+  {  320,  84 }, // from graphics resolution 2560 x 1600
d7ad692
+  {  320, 107 }, // from graphics resolution 2560 x 2048
d7ad692
+  {  350, 110 }, // from graphics resolution 2800 x 2100
d7ad692
+  {  400, 126 }, // from graphics resolution 3200 x 2400
d7ad692
+  {  480, 113 }, // from graphics resolution 3840 x 2160
d7ad692
+  {  512, 113 }, // from graphics resolution 4096 x 2160
d7ad692
+  {  960, 227 }, // from graphics resolution 7680 x 4320
d7ad692
+  { 1024, 227 }, // from graphics resolution 8192 x 4320
b0c3aff
   //
b0c3aff
   // New modes can be added here.
b0c3aff
   //
3485002
-- 
7ae6f15
2.17.0
3485002