Blame 0007-MdeModulePkg-TerminalDxe-add-other-text-resolutions.patch

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