|
|
8c9246 |
From c540bfb48919613f58aa902ca30a922fd1406603 Mon Sep 17 00:00:00 2001
|
|
|
c4e3b2 |
From: Laszlo Ersek <lersek@redhat.com>
|
|
|
c4e3b2 |
Date: Tue, 25 Feb 2014 22:40:01 +0100
|
|
|
c4e3b2 |
Subject: MdeModulePkg: TerminalDxe: set xterm resolution on mode change (RH
|
|
|
c4e3b2 |
only)
|
|
|
c4e3b2 |
|
|
|
8c9246 |
Notes for rebase to edk2-stable202205:
|
|
|
8c9246 |
|
|
|
8c9246 |
- Minor context changes due to fd306d1dbc MdeModulePkg: Add PcdTdxSharedBitMask
|
|
|
8c9246 |
|
|
|
8c9246 |
Notes for rebase to edk2-stable202202:
|
|
|
8c9246 |
|
|
|
8c9246 |
- Minor context changes due to 1436aea4d MdeModulePkg: Apply uncrustify changes
|
|
|
8c9246 |
|
|
|
c4e3b2 |
Notes about the RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] ->
|
|
|
c4e3b2 |
RHEL-8.5/20210520-e1999b264f1f [edk2-stable202105] rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- Resolve harmless conflict in "MdeModulePkg/MdeModulePkg.dec",
|
|
|
c4e3b2 |
originating from new upstream commits
|
|
|
c4e3b2 |
- 45bc28172fbf ("MdeModulePkg.dec: Change PCDs for status code.",
|
|
|
c4e3b2 |
2020-06-18),
|
|
|
c4e3b2 |
- 0785c619a58a ("MdeModulePkg/Bus/Pci/PciBusDxe: Support PCIe Resizable
|
|
|
c4e3b2 |
BAR Capability", 2021-01-04),
|
|
|
c4e3b2 |
- ef23012e5439 ("MdeModulePkg: Change default value of
|
|
|
c4e3b2 |
PcdPcieResizableBarSupport to FALSE", 2021-01-14).
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Notes about the RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] ->
|
|
|
c4e3b2 |
RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- Resolve trivial conflict in "MdeModulePkg/MdeModulePkg.dec", arising
|
|
|
c4e3b2 |
from upstream commit 166830d8f7ca ("MdeModulePkg/dec: add
|
|
|
c4e3b2 |
PcdTcgPfpMeasurementRevision PCD", 2020-01-06).
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Notes about the RHEL-8.1/20190308-89910a39dcfd [edk2-stable201903] ->
|
|
|
c4e3b2 |
RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- Conflict in "MdeModulePkg/MdeModulePkg.dec" due to upstream commits
|
|
|
c4e3b2 |
- 1103ba946aee ("MdeModulePkg: Add Capsule On Disk related definition.",
|
|
|
c4e3b2 |
2019-06-26),
|
|
|
c4e3b2 |
- 1c7b3eb84631 ("MdeModulePkg/DxeIpl: Introduce PCD
|
|
|
c4e3b2 |
PcdUse5LevelPageTable", 2019-08-09),
|
|
|
c4e3b2 |
with easy manual resolution.
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Notes about the RHEL-8.0/20180508-ee3198e672e2 ->
|
|
|
c4e3b2 |
RHEL-8.1/20190308-89910a39dcfd rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- no change
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Notes about the RHEL-7.6/ovmf-20180508-2.gitee3198e672e2.el7 ->
|
|
|
c4e3b2 |
RHEL-8.0/20180508-ee3198e672e2 rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- reorder the rebase changelog in the commit message so that it reads like
|
|
|
c4e3b2 |
a blog: place more recent entries near the top
|
|
|
c4e3b2 |
- no changes to the patch body
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Notes about the 20171011-92d07e48907f -> 20180508-ee3198e672e2 rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- no change
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Notes about the 20170228-c325e41585e3 -> 20171011-92d07e48907f rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- Refresh downstream-only commit 2909e025db68 against "MdeModulePkg.dec"
|
|
|
c4e3b2 |
context change from upstream commits e043f7895b83 ("MdeModulePkg: Add
|
|
|
c4e3b2 |
PCD PcdPteMemoryEncryptionAddressOrMask", 2017-02-27) and 76081dfcc5b2
|
|
|
c4e3b2 |
("MdeModulePkg: Add PROMPT&HELP string of pcd to UNI file", 2017-03-03).
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Notes about the 20160608b-988715a -> 20170228-c325e41585e3 rebase:
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
- refresh commit 519b9751573e against various context changes
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
The
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
CSI Ps ; Ps ; Ps t
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
escape sequence serves for window manipulation. We can use the
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
CSI 8 ; <rows> ; <columns> t
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
sequence to adapt eg. the xterm window size to the selected console mode.
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
Reference: <http://rtfm.etla.org/xterm/ctlseq.html>
|
|
|
c4e3b2 |
Contributed-under: TianoCore Contribution Agreement 1.0
|
|
|
c4e3b2 |
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
c4e3b2 |
(cherry picked from commit 2909e025db6878723b49644a8a0cf160d07e6444)
|
|
|
c4e3b2 |
(cherry picked from commit b9c5c901f25e48d68eef6e78a4abca00e153f574)
|
|
|
c4e3b2 |
(cherry picked from commit b7f6115b745de8cbc5214b6ede33c9a8558beb90)
|
|
|
c4e3b2 |
(cherry picked from commit 67415982afdc77922aa37496c981adeb4351acdb)
|
|
|
c4e3b2 |
(cherry picked from commit cfccb98d13e955beb0b93b4a75a973f30c273ffc)
|
|
|
c4e3b2 |
(cherry picked from commit a11602f5e2ef930be5b693ddfd0c789a1bd4c60c)
|
|
|
c4e3b2 |
(cherry picked from commit bc2266f20de5db1636e09a07e4a72c8dbf505f5a)
|
|
|
c4e3b2 |
---
|
|
|
c4e3b2 |
MdeModulePkg/MdeModulePkg.dec | 4 +++
|
|
|
c4e3b2 |
.../Console/TerminalDxe/TerminalConOut.c | 30 +++++++++++++++++++
|
|
|
c4e3b2 |
.../Console/TerminalDxe/TerminalDxe.inf | 2 ++
|
|
|
c4e3b2 |
3 files changed, 36 insertions(+)
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
|
|
|
8c9246 |
index f549276b80..1415766054 100644
|
|
|
c4e3b2 |
--- a/MdeModulePkg/MdeModulePkg.dec
|
|
|
c4e3b2 |
+++ b/MdeModulePkg/MdeModulePkg.dec
|
|
|
8c9246 |
@@ -2092,6 +2092,10 @@
|
|
|
8c9246 |
# @Prompt The shared bit mask when Intel Tdx is enabled.
|
|
|
8c9246 |
gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10000025
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
+ ## Controls whether TerminalDxe outputs an XTerm resize sequence on terminal
|
|
|
c4e3b2 |
+ # mode change.
|
|
|
c4e3b2 |
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE|BOOLEAN|0x00010080
|
|
|
c4e3b2 |
+
|
|
|
c4e3b2 |
[PcdsPatchableInModule]
|
|
|
c4e3b2 |
## Specify memory size with page number for PEI code when
|
|
|
c4e3b2 |
# Loading Module at Fixed Address feature is enabled.
|
|
|
c4e3b2 |
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
|
|
|
8c9246 |
index 7809869e7d..0ce931d644 100644
|
|
|
c4e3b2 |
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
|
|
|
c4e3b2 |
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
|
|
|
c4e3b2 |
@@ -7,6 +7,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
**/
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
+#include <Library/PrintLib.h>
|
|
|
c4e3b2 |
+
|
|
|
c4e3b2 |
#include "Terminal.h"
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
//
|
|
|
8c9246 |
@@ -80,6 +82,16 @@ CHAR16 mSetCursorPositionString[] = { ESC, '[', '0', '0', ';', '0', '0', 'H', 0
|
|
|
8c9246 |
CHAR16 mCursorForwardString[] = { ESC, '[', '0', '0', 'C', 0 };
|
|
|
8c9246 |
CHAR16 mCursorBackwardString[] = { ESC, '[', '0', '0', 'D', 0 };
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
+//
|
|
|
c4e3b2 |
+// Note that this is an ASCII format string, taking two INT32 arguments:
|
|
|
c4e3b2 |
+// rows, columns.
|
|
|
c4e3b2 |
+//
|
|
|
c4e3b2 |
+// A %d (INT32) format specification can expand to at most 11 characters.
|
|
|
c4e3b2 |
+//
|
|
|
c4e3b2 |
+CHAR8 mResizeTextAreaFormatString[] = "\x1B[8;%d;%dt";
|
|
|
c4e3b2 |
+#define RESIZE_SEQ_SIZE (sizeof mResizeTextAreaFormatString + 2 * (11 - 2))
|
|
|
c4e3b2 |
+
|
|
|
c4e3b2 |
+
|
|
|
c4e3b2 |
//
|
|
|
c4e3b2 |
// Body of the ConOut functions
|
|
|
c4e3b2 |
//
|
|
|
8c9246 |
@@ -498,6 +510,24 @@ TerminalConOutSetMode (
|
|
|
c4e3b2 |
return EFI_DEVICE_ERROR;
|
|
|
c4e3b2 |
}
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
+ if (PcdGetBool (PcdResizeXterm)) {
|
|
|
c4e3b2 |
+ CHAR16 ResizeSequence[RESIZE_SEQ_SIZE];
|
|
|
c4e3b2 |
+
|
|
|
c4e3b2 |
+ UnicodeSPrintAsciiFormat (
|
|
|
c4e3b2 |
+ ResizeSequence,
|
|
|
c4e3b2 |
+ sizeof ResizeSequence,
|
|
|
c4e3b2 |
+ mResizeTextAreaFormatString,
|
|
|
c4e3b2 |
+ (INT32) TerminalDevice->TerminalConsoleModeData[ModeNumber].Rows,
|
|
|
c4e3b2 |
+ (INT32) TerminalDevice->TerminalConsoleModeData[ModeNumber].Columns
|
|
|
c4e3b2 |
+ );
|
|
|
c4e3b2 |
+ TerminalDevice->OutputEscChar = TRUE;
|
|
|
c4e3b2 |
+ Status = This->OutputString (This, ResizeSequence);
|
|
|
c4e3b2 |
+ TerminalDevice->OutputEscChar = FALSE;
|
|
|
c4e3b2 |
+ if (EFI_ERROR (Status)) {
|
|
|
c4e3b2 |
+ return EFI_DEVICE_ERROR;
|
|
|
c4e3b2 |
+ }
|
|
|
c4e3b2 |
+ }
|
|
|
c4e3b2 |
+
|
|
|
8c9246 |
This->Mode->Mode = (INT32)ModeNumber;
|
|
|
c4e3b2 |
|
|
|
8c9246 |
Status = This->ClearScreen (This);
|
|
|
c4e3b2 |
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
|
|
|
c4e3b2 |
index b2a8aeba85..eff6253465 100644
|
|
|
c4e3b2 |
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
|
|
|
c4e3b2 |
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
|
|
|
c4e3b2 |
@@ -55,6 +55,7 @@
|
|
|
c4e3b2 |
DebugLib
|
|
|
c4e3b2 |
PcdLib
|
|
|
c4e3b2 |
BaseLib
|
|
|
c4e3b2 |
+ PrintLib
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
[Guids]
|
|
|
c4e3b2 |
## SOMETIMES_PRODUCES ## Variable:L"ConInDev"
|
|
|
c4e3b2 |
@@ -87,6 +88,7 @@
|
|
|
c4e3b2 |
[Pcd]
|
|
|
c4e3b2 |
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType ## SOMETIMES_CONSUMES
|
|
|
c4e3b2 |
gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## CONSUMES
|
|
|
c4e3b2 |
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## CONSUMES
|
|
|
c4e3b2 |
|
|
|
c4e3b2 |
# [Event]
|
|
|
c4e3b2 |
# # Relative timer event set by UnicodeToEfiKey(), used to be one 2 seconds input timeout.
|
|
|
c4e3b2 |
--
|
|
|
8c9246 |
2.31.1
|
|
|
c4e3b2 |
|