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

Gerd Hoffmann 0476d8
From 8708aff7d939989ab52932c1329c81dfe86bdc61 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
Gerd Hoffmann ced5d8
Subject: [PATCH 04/21] MdeModulePkg: TerminalDxe: add other text resolutions
Gerd Hoffmann ced5d8
 (RHEL only)
59c3cd
59c3cd
Notes about the RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] ->
59c3cd
RHEL-8.5/20210520-e1999b264f1f [edk2-stable202105] rebase:
59c3cd
59c3cd
- no change
59c3cd
59c3cd
Notes about the RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] ->
59c3cd
RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] rebase:
59c3cd
59c3cd
- no changes
59c3cd
59c3cd
Notes about the RHEL-8.1/20190308-89910a39dcfd [edk2-stable201903] ->
59c3cd
RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] rebase:
59c3cd
59c3cd
- no changes
59c3cd
59c3cd
Notes about the RHEL-8.0/20180508-ee3198e672e2 ->
59c3cd
RHEL-8.1/20190308-89910a39dcfd rebase:
59c3cd
59c3cd
- no change
59c3cd
59c3cd
Notes about the RHEL-7.6/ovmf-20180508-2.gitee3198e672e2.el7 ->
59c3cd
RHEL-8.0/20180508-ee3198e672e2 rebase:
59c3cd
59c3cd
- reorder the rebase changelog in the commit message so that it reads like
59c3cd
  a blog: place more recent entries near the top
59c3cd
- no changes to the patch body
59c3cd
59c3cd
Notes about the 20171011-92d07e48907f -> 20180508-ee3198e672e2 rebase:
59c3cd
59c3cd
- update commit message as requested in
59c3cd
  <https://bugzilla.redhat.com/show_bug.cgi?id=1503316#c0>
59c3cd
59c3cd
Notes about the 20170228-c325e41585e3 -> 20171011-92d07e48907f rebase:
59c3cd
59c3cd
- no changes
59c3cd
59c3cd
Notes about the 20160608b-988715a -> 20170228-c325e41585e3 rebase:
59c3cd
59c3cd
- adapt commit 0bc77c63de03 (code and commit message) to upstream commit
59c3cd
  390b95a49c14 ("MdeModulePkg/TerminalDxe: Refine
59c3cd
  InitializeTerminalConsoleTextMode", 2017-01-10).
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
59c3cd
Upstreaming efforts for this patch have been discontinued; it was clear
59c3cd
from the off-list thread that consensus was impossible to reach.
Paolo Bonzini 348500
Gerd Hoffmann b0c3af
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Paolo Bonzini 348500
(cherry picked from commit 99dc3720ac86059f60156197328cc433603c536e)
59c3cd
(cherry picked from commit d2066c1748f885043026c51dec1bc8d6d406ae8f)
59c3cd
(cherry picked from commit 1facdd58e946c584a3dc1e5be8f2f837b5a7c621)
59c3cd
(cherry picked from commit 28faeb5f94b4866b9da16cf2a1e4e0fc09a26e37)
59c3cd
(cherry picked from commit 4e4e15b80a5b2103eadd495ef4a830d46dd4ed51)
59c3cd
(cherry picked from commit 12cb13a1da913912bd9148ce8f2353a75be77f18)
59c3cd
(cherry picked from commit 82b9edc5fef3a07227a45059bbe821af7b9abd69)
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
Gerd Hoffmann ced5d8
index e2d779c78378..f238c4103b3d 100644
Gerd Hoffmann b0c3af
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
Gerd Hoffmann b0c3af
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
Gerd Hoffmann ced5d8
@@ -112,9 +112,44 @@ TERMINAL_DEV  mTerminalDevTemplate = {
Gerd Hoffmann b0c3af
 };
Gerd Hoffmann b0c3af
 
Gerd Hoffmann ced5d8
 TERMINAL_CONSOLE_MODE_DATA  mTerminalConsoleModeData[] = {
Gerd Hoffmann ced5d8
-  { 80,  25 },
Gerd Hoffmann ced5d8
-  { 80,  50 },
Gerd Hoffmann ced5d8
-  { 100, 31 },
Gerd Hoffmann ced5d8
+  { 80,   25  }, // from graphics resolution  640 x  480
Gerd Hoffmann ced5d8
+  { 80,   50  }, // from graphics resolution  640 x  960
Gerd Hoffmann ced5d8
+  { 100,  25  }, // from graphics resolution  800 x  480
Gerd Hoffmann ced5d8
+  { 100,  31  }, // from graphics resolution  800 x  600
Gerd Hoffmann ced5d8
+  { 104,  32  }, // from graphics resolution  832 x  624
Gerd Hoffmann ced5d8
+  { 120,  33  }, // from graphics resolution  960 x  640
Gerd Hoffmann ced5d8
+  { 128,  31  }, // from graphics resolution 1024 x  600
Gerd Hoffmann ced5d8
+  { 128,  40  }, // from graphics resolution 1024 x  768
Gerd Hoffmann ced5d8
+  { 144,  45  }, // from graphics resolution 1152 x  864
Gerd Hoffmann ced5d8
+  { 144,  45  }, // from graphics resolution 1152 x  870
Gerd Hoffmann ced5d8
+  { 160,  37  }, // from graphics resolution 1280 x  720
Gerd Hoffmann ced5d8
+  { 160,  40  }, // from graphics resolution 1280 x  760
Gerd Hoffmann ced5d8
+  { 160,  40  }, // from graphics resolution 1280 x  768
Gerd Hoffmann ced5d8
+  { 160,  42  }, // from graphics resolution 1280 x  800
Gerd Hoffmann ced5d8
+  { 160,  50  }, // from graphics resolution 1280 x  960
Gerd Hoffmann ced5d8
+  { 160,  53  }, // from graphics resolution 1280 x 1024
Gerd Hoffmann ced5d8
+  { 170,  40  }, // from graphics resolution 1360 x  768
Gerd Hoffmann ced5d8
+  { 170,  40  }, // from graphics resolution 1366 x  768
Gerd Hoffmann ced5d8
+  { 175,  55  }, // from graphics resolution 1400 x 1050
Gerd Hoffmann ced5d8
+  { 180,  47  }, // from graphics resolution 1440 x  900
Gerd Hoffmann ced5d8
+  { 200,  47  }, // from graphics resolution 1600 x  900
Gerd Hoffmann ced5d8
+  { 200,  63  }, // from graphics resolution 1600 x 1200
Gerd Hoffmann ced5d8
+  { 210,  55  }, // from graphics resolution 1680 x 1050
Gerd Hoffmann ced5d8
+  { 240,  56  }, // from graphics resolution 1920 x 1080
Gerd Hoffmann ced5d8
+  { 240,  63  }, // from graphics resolution 1920 x 1200
Gerd Hoffmann ced5d8
+  { 240,  75  }, // from graphics resolution 1920 x 1440
Gerd Hoffmann ced5d8
+  { 250,  105 }, // from graphics resolution 2000 x 2000
Gerd Hoffmann ced5d8
+  { 256,  80  }, // from graphics resolution 2048 x 1536
Gerd Hoffmann ced5d8
+  { 256,  107 }, // from graphics resolution 2048 x 2048
Gerd Hoffmann ced5d8
+  { 320,  75  }, // from graphics resolution 2560 x 1440
Gerd Hoffmann ced5d8
+  { 320,  84  }, // from graphics resolution 2560 x 1600
Gerd Hoffmann ced5d8
+  { 320,  107 }, // from graphics resolution 2560 x 2048
Gerd Hoffmann ced5d8
+  { 350,  110 }, // from graphics resolution 2800 x 2100
Gerd Hoffmann ced5d8
+  { 400,  126 }, // from graphics resolution 3200 x 2400
Gerd Hoffmann ced5d8
+  { 480,  113 }, // from graphics resolution 3840 x 2160
Gerd Hoffmann ced5d8
+  { 512,  113 }, // from graphics resolution 4096 x 2160
Gerd Hoffmann ced5d8
+  { 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
   //
59c3cd
-- 
Gerd Hoffmann 0476d8
2.35.3
59c3cd