* [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF
@ 2023-02-17 13:01 Paweł Poławski
2023-02-17 13:01 ` [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change Paweł Poławski
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: Paweł Poławski @ 2023-02-17 13:01 UTC (permalink / raw)
To: devel
This set of patches adds xterm resize sequences support to OvmfPkg
and ArmVirtPkg. This way firmware will be able to sent resize
requests to user terminal (gnome-terminal, xterm, xfce4-terminal).
To test this feature you can use a new configuration option:
-fw_cfg name=opt/org.tianocore/PcdResizeXterm,string=1
Laszlo Ersek (3):
MdeModulePkg: TerminalDxe: set xterm resolution on mode change
ArmVirtPkg: take PcdResizeXterm from the QEMU command line
OvmfPkg: take PcdResizeXterm from the QEMU command line
MdeModulePkg/MdeModulePkg.dec | 4 ++
ArmVirtPkg/ArmVirtQemu.dsc | 7 +++-
OvmfPkg/AmdSev/AmdSevX64.dsc | 6 ++-
OvmfPkg/CloudHv/CloudHvX64.dsc | 6 ++-
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 6 ++-
OvmfPkg/Microvm/MicrovmX64.dsc | 6 ++-
OvmfPkg/OvmfPkgIa32.dsc | 6 ++-
OvmfPkg/OvmfPkgIa32X64.dsc | 6 ++-
OvmfPkg/OvmfPkgX64.dsc | 6 ++-
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 2 +
OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf | 33 ++++++++++++++++
OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 29 ++++++++++++++
OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c | 41 ++++++++++++++++++++
14 files changed, 151 insertions(+), 8 deletions(-)
create mode 100644 OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
create mode 100644 OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
--
2.39.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change
2023-02-17 13:01 [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF Paweł Poławski
@ 2023-02-17 13:01 ` Paweł Poławski
2023-04-04 15:12 ` Ard Biesheuvel
2023-02-17 13:01 ` [edk2-devel] PATCH v3 2/3 ArmVirtPkg: take PcdResizeXterm from the QEMU command line Paweł Poławski
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Paweł Poławski @ 2023-02-17 13:01 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Liming Gao
From: Laszlo Ersek <lersek@redhat.com>
TerminalDxe driver can send xterm control sequences.
Reference: <http://rtfm.etla.org/xterm/ctlseq.html>
This way it can trigger client window resize (xterm,
gnome-terminal etc.) accordingly, to a specified number
of rows and columns. It improves user experience
when handling text mode based operations.
New PcdResizeXterm config switch has been added to enable
or disable this behaviour.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Pawel Polawski: Updated commit message for re-submission
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
---
MdeModulePkg/MdeModulePkg.dec | 4 +++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 2 ++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 29 ++++++++++++++++++++
3 files changed, 35 insertions(+)
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 9605c617b7a8..76007e0af42a 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -2107,6 +2107,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
# @Prompt The shared bit mask when Intel Tdx is enabled.
gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10000025
+ ## Controls whether TerminalDxe outputs an XTerm resize sequence on terminal
+ # mode change.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE|BOOLEAN|0x00010080
+
[PcdsPatchableInModule]
## Specify memory size with page number for PEI code when
# Loading Module at Fixed Address feature is enabled.
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
index b2a8aeba8510..eff625346539 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
@@ -55,6 +55,7 @@ [LibraryClasses]
DebugLib
PcdLib
BaseLib
+ PrintLib
[Guids]
## SOMETIMES_PRODUCES ## Variable:L"ConInDev"
@@ -87,6 +88,7 @@ [Protocols]
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## CONSUMES
# [Event]
# # Relative timer event set by UnicodeToEfiKey(), used to be one 2 seconds input timeout.
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
index 7809869e7d49..496849458db4 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
@@ -7,6 +7,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+#include <Library/PrintLib.h>
+
#include "Terminal.h"
//
@@ -80,6 +82,15 @@ CHAR16 mSetCursorPositionString[] = { ESC, '[', '0', '0', ';', '0', '0', 'H', 0
CHAR16 mCursorForwardString[] = { ESC, '[', '0', '0', 'C', 0 };
CHAR16 mCursorBackwardString[] = { ESC, '[', '0', '0', 'D', 0 };
+//
+// Note that this is an ASCII format string, taking two INT32 arguments:
+// rows, columns.
+//
+// A %d (INT32) format specification can expand to at most 11 characters.
+//
+CHAR8 mResizeTextAreaFormatString[] = "\x1B[8;%d;%dt";
+#define RESIZE_SEQ_SIZE (sizeof mResizeTextAreaFormatString + 2 * (11 - 2))
+
//
// Body of the ConOut functions
//
@@ -498,6 +509,24 @@ TerminalConOutSetMode (
return EFI_DEVICE_ERROR;
}
+ if (PcdGetBool (PcdResizeXterm)) {
+ CHAR16 ResizeSequence[RESIZE_SEQ_SIZE];
+
+ UnicodeSPrintAsciiFormat (
+ ResizeSequence,
+ sizeof ResizeSequence,
+ mResizeTextAreaFormatString,
+ (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Rows,
+ (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Columns
+ );
+ TerminalDevice->OutputEscChar = TRUE;
+ Status = This->OutputString (This, ResizeSequence);
+ TerminalDevice->OutputEscChar = FALSE;
+ if (EFI_ERROR (Status)) {
+ return EFI_DEVICE_ERROR;
+ }
+ }
+
This->Mode->Mode = (INT32)ModeNumber;
Status = This->ClearScreen (This);
--
2.39.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [edk2-devel] PATCH v3 2/3 ArmVirtPkg: take PcdResizeXterm from the QEMU command line
2023-02-17 13:01 [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF Paweł Poławski
2023-02-17 13:01 ` [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change Paweł Poławski
@ 2023-02-17 13:01 ` Paweł Poławski
2023-02-17 13:01 ` [edk2-devel] PATCH v3 3/3 OvmfPkg: " Paweł Poławski
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Paweł Poławski @ 2023-02-17 13:01 UTC (permalink / raw)
To: devel; +Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Gerd Hoffmann
From: Laszlo Ersek <lersek@redhat.com>
This patch enables recognition of PcdResizeXterm config variable.
When enablet it will trigger passing xterm control sequences
from the ArmVirtPkg to the client terminal (xterm, gnome-terminal etc.).
This way client terminal window size will be alligned with
numbers of rows and columns used by firmware.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Pawel Polawski: Updated commit message for re-submission
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
---
ArmVirtPkg/ArmVirtQemu.dsc | 7 +++-
OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf | 33 ++++++++++++++++
OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c | 41 ++++++++++++++++++++
3 files changed, 80 insertions(+), 1 deletion(-)
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 0f1c6395488a..5f99c0a5104f 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -304,6 +304,8 @@ [PcdsPatchableInModule]
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
!endif
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
+
[PcdsDynamicHii]
gArmVirtTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gArmVirtVariableGuid|0x0|FALSE|NV,BS
@@ -418,7 +420,10 @@ [Components.common]
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
diff --git a/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
new file mode 100644
index 000000000000..b4108ec04b0b
--- /dev/null
+++ b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
@@ -0,0 +1,33 @@
+## @file
+# Plugin library for setting up dynamic PCDs for TerminalDxe, from fw_cfg
+#
+# Copyright (c) 2015-2020, Red Hat, Inc.
+# Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = TerminalPcdProducerLib
+ FILE_GUID = 4a0c5ed7-8c42-4c01-8f4c-7bf258316a96
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = NULL
+ CONSTRUCTOR = TerminalPcdProducerLibConstructor
+
+[Sources]
+ TerminalPcdProducerLib.c
+
+[Packages]
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+ DebugLib
+ PcdLib
+ QemuFwCfgSimpleParserLib
+
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## SOMETIMES_PRODUCES
diff --git a/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
new file mode 100644
index 000000000000..fe65273822a0
--- /dev/null
+++ b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
@@ -0,0 +1,41 @@
+/** @file
+
+ Copyright (c) 2015-2020, Red Hat, Inc.
+ Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ Plugin library for setting up dynamic PCDs for TerminalDxe, from fw_cfg
+
+**/
+
+#include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
+#include <Library/QemuFwCfgSimpleParserLib.h>
+
+#define UPDATE_BOOLEAN_PCD_FROM_FW_CFG(TokenName) \
+ do { \
+ BOOLEAN Setting; \
+ RETURN_STATUS PcdStatus; \
+ \
+ if (!RETURN_ERROR (QemuFwCfgParseBool ( \
+ "opt/org.tianocore/" #TokenName, &Setting))) { \
+ PcdStatus = PcdSetBoolS (TokenName, Setting); \
+ ASSERT_RETURN_ERROR (PcdStatus); \
+ } \
+ } while (0)
+
+/**
+ Update PCD configuration variable from firmware config.
+
+ @return Always returns RETURN_SUCCESS
+**/
+RETURN_STATUS
+EFIAPI
+TerminalPcdProducerLibConstructor (
+ VOID
+ )
+{
+ UPDATE_BOOLEAN_PCD_FROM_FW_CFG (PcdResizeXterm);
+ return RETURN_SUCCESS;
+}
--
2.39.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [edk2-devel] PATCH v3 3/3 OvmfPkg: take PcdResizeXterm from the QEMU command line
2023-02-17 13:01 [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF Paweł Poławski
2023-02-17 13:01 ` [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change Paweł Poławski
2023-02-17 13:01 ` [edk2-devel] PATCH v3 2/3 ArmVirtPkg: take PcdResizeXterm from the QEMU command line Paweł Poławski
@ 2023-02-17 13:01 ` Paweł Poławski
[not found] ` <17449E3B102C52E2.23192@groups.io>
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Paweł Poławski @ 2023-02-17 13:01 UTC (permalink / raw)
To: devel; +Cc: Ard Biesheuvel, Jiewen Yao, Jordan Justen, Gerd Hoffmann
From: Laszlo Ersek <lersek@redhat.com>
This patch enables recognition of PcdResizeXterm config variable
by the OvmfPkg. When enablet it will trigger passing xterm control sequences
from the OvmfPkg to the client terminal (xterm, gnome-terminal etc.).
This way client terminal window size will be alligned with
numbers of rows and columns requested by the firmware.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Pawel Polawski: Updated commit message for re-submission
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
---
OvmfPkg/AmdSev/AmdSevX64.dsc | 6 +++++-
OvmfPkg/CloudHv/CloudHvX64.dsc | 6 +++++-
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 6 +++++-
OvmfPkg/Microvm/MicrovmX64.dsc | 6 +++++-
OvmfPkg/OvmfPkgIa32.dsc | 6 +++++-
OvmfPkg/OvmfPkgIa32X64.dsc | 6 +++++-
OvmfPkg/OvmfPkgX64.dsc | 6 +++++-
OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
8 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index 36100f5fdc11..d4429526709b 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -477,6 +477,7 @@ [PcdsFixedAtBuild]
[PcdsDynamicDefault]
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
@@ -655,7 +656,10 @@ [Components]
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
}
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
<LibraryClasses>
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
index 7326417eab62..5877a418f6b6 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.dsc
+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
@@ -584,6 +584,7 @@ [PcdsDynamicDefault]
# ($(SMM_REQUIRE) == FALSE)
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
!if $(SMM_REQUIRE) == FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
@@ -778,7 +779,10 @@ [Components]
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
}
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
<LibraryClasses>
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index 0f1e970fbbb3..dc82398dbd62 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -482,6 +482,7 @@ [PcdsDynamicDefault]
# ($(SMM_REQUIRE) == FALSE)
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
@@ -661,7 +662,10 @@ [Components]
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
}
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
<LibraryClasses>
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 2d53b5c2950d..44056b6b334e 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -582,6 +582,7 @@ [PcdsDynamicDefault]
# ($(SMM_REQUIRE) == FALSE)
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
@@ -758,7 +759,10 @@ [Components]
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
}
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
<LibraryClasses>
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index f232de13a7b6..411d4288f6a1 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -603,6 +603,7 @@ [PcdsDynamicDefault]
# ($(SMM_REQUIRE) == FALSE)
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
!if $(SMM_REQUIRE) == FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
@@ -822,7 +823,10 @@ [Components]
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
}
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
<LibraryClasses>
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index a9d422bd9169..0988ad4b1db2 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -610,6 +610,7 @@ [PcdsDynamicDefault]
# ($(SMM_REQUIRE) == FALSE)
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
!if $(SMM_REQUIRE) == FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
@@ -835,7 +836,10 @@ [Components.X64]
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
}
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
<LibraryClasses>
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 3f970a79a08a..2c432af4eedc 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -632,6 +632,7 @@ [PcdsDynamicDefault]
# ($(SMM_REQUIRE) == FALSE)
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
!if $(SMM_REQUIRE) == FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
@@ -903,7 +904,10 @@ [Components]
<LibraryClasses>
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
}
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
+ }
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
<LibraryClasses>
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index 1fadadeb5565..3e28e1596d32 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -99,6 +99,7 @@ [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved
+ gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack
--
2.39.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change
[not found] ` <17449E3B102C52E2.23192@groups.io>
@ 2023-03-07 12:47 ` Paweł Poławski
0 siblings, 0 replies; 10+ messages in thread
From: Paweł Poławski @ 2023-03-07 12:47 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Liming Gao
[-- Attachment #1: Type: text/plain, Size: 5341 bytes --]
Hi all,
As a new stable version has been released recently and the freeze is over,
if there is a chance for review of this set of patches?
They have been already reviewed in the past and the last request was to
make commit
messages more meaningful for the end user.
Best regards,
Pawel
On Fri, Feb 17, 2023 at 2:02 PM Paweł Poławski <ppolawsk@redhat.com> wrote:
> From: Laszlo Ersek <lersek@redhat.com>
>
> TerminalDxe driver can send xterm control sequences.
> Reference: <http://rtfm.etla.org/xterm/ctlseq.html>
>
> This way it can trigger client window resize (xterm,
> gnome-terminal etc.) accordingly, to a specified number
> of rows and columns. It improves user experience
> when handling text mode based operations.
>
> New PcdResizeXterm config switch has been added to enable
> or disable this behaviour.
>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>
> Pawel Polawski: Updated commit message for re-submission
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>
> Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
> ---
> MdeModulePkg/MdeModulePkg.dec | 4 +++
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 2 ++
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 29
> ++++++++++++++++++++
> 3 files changed, 35 insertions(+)
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
> index 9605c617b7a8..76007e0af42a 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -2107,6 +2107,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule,
> PcdsDynamic, PcdsDynamicEx]
> # @Prompt The shared bit mask when Intel Tdx is enabled.
> gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10000025
>
> + ## Controls whether TerminalDxe outputs an XTerm resize sequence on
> terminal
> + # mode change.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE|BOOLEAN|0x00010080
> +
> [PcdsPatchableInModule]
> ## Specify memory size with page number for PEI code when
> # Loading Module at Fixed Address feature is enabled.
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> index b2a8aeba8510..eff625346539 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> @@ -55,6 +55,7 @@ [LibraryClasses]
> DebugLib
> PcdLib
> BaseLib
> + PrintLib
>
> [Guids]
> ## SOMETIMES_PRODUCES ## Variable:L"ConInDev"
> @@ -87,6 +88,7 @@ [Protocols]
> [Pcd]
> gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## CONSUMES
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## CONSUMES
>
> # [Event]
> # # Relative timer event set by UnicodeToEfiKey(), used to be one 2
> seconds input timeout.
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> index 7809869e7d49..496849458db4 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> @@ -7,6 +7,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> +#include <Library/PrintLib.h>
> +
> #include "Terminal.h"
>
> //
> @@ -80,6 +82,15 @@ CHAR16 mSetCursorPositionString[] = { ESC, '[', '0',
> '0', ';', '0', '0', 'H', 0
> CHAR16 mCursorForwardString[] = { ESC, '[', '0', '0', 'C', 0 };
> CHAR16 mCursorBackwardString[] = { ESC, '[', '0', '0', 'D', 0 };
>
> +//
> +// Note that this is an ASCII format string, taking two INT32 arguments:
> +// rows, columns.
> +//
> +// A %d (INT32) format specification can expand to at most 11 characters.
> +//
> +CHAR8 mResizeTextAreaFormatString[] = "\x1B[8;%d;%dt";
> +#define RESIZE_SEQ_SIZE (sizeof mResizeTextAreaFormatString + 2 * (11 -
> 2))
> +
> //
> // Body of the ConOut functions
> //
> @@ -498,6 +509,24 @@ TerminalConOutSetMode (
> return EFI_DEVICE_ERROR;
> }
>
> + if (PcdGetBool (PcdResizeXterm)) {
> + CHAR16 ResizeSequence[RESIZE_SEQ_SIZE];
> +
> + UnicodeSPrintAsciiFormat (
> + ResizeSequence,
> + sizeof ResizeSequence,
> + mResizeTextAreaFormatString,
> + (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Rows,
> + (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Columns
> + );
> + TerminalDevice->OutputEscChar = TRUE;
> + Status = This->OutputString (This,
> ResizeSequence);
> + TerminalDevice->OutputEscChar = FALSE;
> + if (EFI_ERROR (Status)) {
> + return EFI_DEVICE_ERROR;
> + }
> + }
> +
> This->Mode->Mode = (INT32)ModeNumber;
>
> Status = This->ClearScreen (This);
> --
> 2.39.1
>
>
>
>
>
>
>
--
Paweł Poławski
Red Hat <https://www.redhat.com/> Virtualization
ppolawsk@redhat.com
@RedHat <https://twitter.com/redhat> Red Hat
<https://www.linkedin.com/company/red-hat> Red Hat
<https://www.facebook.com/RedHatInc>
<https://red.ht/sig>
[-- Attachment #2: Type: text/html, Size: 8799 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* 回复: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF
2023-02-17 13:01 [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF Paweł Poławski
` (3 preceding siblings ...)
[not found] ` <17449E3B102C52E2.23192@groups.io>
@ 2023-03-10 2:31 ` gaoliming
2023-03-24 13:57 ` Paweł Poławski
[not found] ` <17449E3BBCD94462.23192@groups.io>
[not found] ` <17449E3B887C4E80.23192@groups.io>
6 siblings, 1 reply; 10+ messages in thread
From: gaoliming @ 2023-03-10 2:31 UTC (permalink / raw)
To: devel, ppolawsk
Pawel:
The change in MdeModulePkg looks good to me. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Pawe?
> Po?awski
> 发送时间: 2023年2月17日 21:02
> 收件人: devel@edk2.groups.io
> 主题: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF
>
> This set of patches adds xterm resize sequences support to OvmfPkg
> and ArmVirtPkg. This way firmware will be able to sent resize
> requests to user terminal (gnome-terminal, xterm, xfce4-terminal).
>
> To test this feature you can use a new configuration option:
> -fw_cfg name=opt/org.tianocore/PcdResizeXterm,string=1
>
> Laszlo Ersek (3):
> MdeModulePkg: TerminalDxe: set xterm resolution on mode change
> ArmVirtPkg: take PcdResizeXterm from the QEMU command line
> OvmfPkg: take PcdResizeXterm from the QEMU command line
>
> MdeModulePkg/MdeModulePkg.dec
> | 4 ++
> ArmVirtPkg/ArmVirtQemu.dsc
> | 7 +++-
> OvmfPkg/AmdSev/AmdSevX64.dsc
> | 6 ++-
> OvmfPkg/CloudHv/CloudHvX64.dsc
> | 6 ++-
> OvmfPkg/IntelTdx/IntelTdxX64.dsc
> | 6 ++-
> OvmfPkg/Microvm/MicrovmX64.dsc
> | 6 ++-
> OvmfPkg/OvmfPkgIa32.dsc
> | 6 ++-
> OvmfPkg/OvmfPkgIa32X64.dsc
> | 6 ++-
> OvmfPkg/OvmfPkgX64.dsc
> | 6 ++-
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf |
> 2 +
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf | 33
> ++++++++++++++++
> OvmfPkg/PlatformPei/PlatformPei.inf
> | 1 +
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> | 29 ++++++++++++++
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c |
> 41 ++++++++++++++++++++
> 14 files changed, 151 insertions(+), 8 deletions(-)
> create mode 100644
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> create mode 100644
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
>
> --
> 2.39.1
>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF
2023-03-10 2:31 ` 回复: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF gaoliming
@ 2023-03-24 13:57 ` Paweł Poławski
0 siblings, 0 replies; 10+ messages in thread
From: Paweł Poławski @ 2023-03-24 13:57 UTC (permalink / raw)
To: devel, gaoliming
[-- Attachment #1: Type: text/plain, Size: 2611 bytes --]
Hi Liming,
Thank you for the review.
Best regards,
Pawel
On Fri, Mar 10, 2023 at 3:31 AM gaoliming via groups.io <gaoliming=
byosoft.com.cn@groups.io> wrote:
> Pawel:
> The change in MdeModulePkg looks good to me. Reviewed-by: Liming Gao <
> gaoliming@byosoft.com.cn>
>
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Pawe?
> > Po?awski
> > 发送时间: 2023年2月17日 21:02
> > 收件人: devel@edk2.groups.io
> > 主题: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF
> >
> > This set of patches adds xterm resize sequences support to OvmfPkg
> > and ArmVirtPkg. This way firmware will be able to sent resize
> > requests to user terminal (gnome-terminal, xterm, xfce4-terminal).
> >
> > To test this feature you can use a new configuration option:
> > -fw_cfg name=opt/org.tianocore/PcdResizeXterm,string=1
> >
> > Laszlo Ersek (3):
> > MdeModulePkg: TerminalDxe: set xterm resolution on mode change
> > ArmVirtPkg: take PcdResizeXterm from the QEMU command line
> > OvmfPkg: take PcdResizeXterm from the QEMU command line
> >
> > MdeModulePkg/MdeModulePkg.dec
> > | 4 ++
> > ArmVirtPkg/ArmVirtQemu.dsc
> > | 7 +++-
> > OvmfPkg/AmdSev/AmdSevX64.dsc
> > | 6 ++-
> > OvmfPkg/CloudHv/CloudHvX64.dsc
> > | 6 ++-
> > OvmfPkg/IntelTdx/IntelTdxX64.dsc
> > | 6 ++-
> > OvmfPkg/Microvm/MicrovmX64.dsc
> > | 6 ++-
> > OvmfPkg/OvmfPkgIa32.dsc
> > | 6 ++-
> > OvmfPkg/OvmfPkgIa32X64.dsc
> > | 6 ++-
> > OvmfPkg/OvmfPkgX64.dsc
> > | 6 ++-
> > MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf |
> > 2 +
> > OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf | 33
> > ++++++++++++++++
> > OvmfPkg/PlatformPei/PlatformPei.inf
> > | 1 +
> > MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> > | 29 ++++++++++++++
> > OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c |
> > 41 ++++++++++++++++++++
> > 14 files changed, 151 insertions(+), 8 deletions(-)
> > create mode 100644
> > OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> > create mode 100644
> > OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
> >
> > --
> > 2.39.1
> >
> >
> >
> >
> >
>
>
>
>
>
>
>
>
>
--
Paweł Poławski
Red Hat <https://www.redhat.com/> Virtualization
ppolawsk@redhat.com
@RedHat <https://twitter.com/redhat> Red Hat
<https://www.linkedin.com/company/red-hat> Red Hat
<https://www.facebook.com/RedHatInc>
<https://red.ht/sig>
[-- Attachment #2: Type: text/html, Size: 5714 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] PATCH v3 3/3 OvmfPkg: take PcdResizeXterm from the QEMU command line
[not found] ` <17449E3BBCD94462.23192@groups.io>
@ 2023-03-24 13:59 ` Paweł Poławski
0 siblings, 0 replies; 10+ messages in thread
From: Paweł Poławski @ 2023-03-24 13:59 UTC (permalink / raw)
To: devel; +Cc: Ard Biesheuvel, Jiewen Yao, Jordan Justen, Gerd Hoffmann
[-- Attachment #1: Type: text/plain, Size: 10411 bytes --]
Hi all,
If someone had a chance to take a look at this patchset already and would
like to share thoughts?
The 1st patch from this series has been already successfully reviewed.
Best regards,
Pawel
On Fri, Feb 17, 2023 at 2:03 PM Paweł Poławski <ppolawsk@redhat.com> wrote:
> From: Laszlo Ersek <lersek@redhat.com>
>
> This patch enables recognition of PcdResizeXterm config variable
> by the OvmfPkg. When enablet it will trigger passing xterm control
> sequences
> from the OvmfPkg to the client terminal (xterm, gnome-terminal etc.).
> This way client terminal window size will be alligned with
> numbers of rows and columns requested by the firmware.
>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>
> Pawel Polawski: Updated commit message for re-submission
>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
>
> Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
> ---
> OvmfPkg/AmdSev/AmdSevX64.dsc | 6 +++++-
> OvmfPkg/CloudHv/CloudHvX64.dsc | 6 +++++-
> OvmfPkg/IntelTdx/IntelTdxX64.dsc | 6 +++++-
> OvmfPkg/Microvm/MicrovmX64.dsc | 6 +++++-
> OvmfPkg/OvmfPkgIa32.dsc | 6 +++++-
> OvmfPkg/OvmfPkgIa32X64.dsc | 6 +++++-
> OvmfPkg/OvmfPkgX64.dsc | 6 +++++-
> OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
> 8 files changed, 36 insertions(+), 7 deletions(-)
>
> diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
> index 36100f5fdc11..d4429526709b 100644
> --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
> +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
> @@ -477,6 +477,7 @@ [PcdsFixedAtBuild]
> [PcdsDynamicDefault]
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
> @@ -655,7 +656,10 @@ [Components]
> <LibraryClasses>
> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> }
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> <LibraryClasses>
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc
> b/OvmfPkg/CloudHv/CloudHvX64.dsc
> index 7326417eab62..5877a418f6b6 100644
> --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> @@ -584,6 +584,7 @@ [PcdsDynamicDefault]
> # ($(SMM_REQUIRE) == FALSE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> !if $(SMM_REQUIRE) == FALSE
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
> @@ -778,7 +779,10 @@ [Components]
> <LibraryClasses>
> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> }
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> <LibraryClasses>
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> index 0f1e970fbbb3..dc82398dbd62 100644
> --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> @@ -482,6 +482,7 @@ [PcdsDynamicDefault]
> # ($(SMM_REQUIRE) == FALSE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
> @@ -661,7 +662,10 @@ [Components]
> <LibraryClasses>
> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> }
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> <LibraryClasses>
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc
> b/OvmfPkg/Microvm/MicrovmX64.dsc
> index 2d53b5c2950d..44056b6b334e 100644
> --- a/OvmfPkg/Microvm/MicrovmX64.dsc
> +++ b/OvmfPkg/Microvm/MicrovmX64.dsc
> @@ -582,6 +582,7 @@ [PcdsDynamicDefault]
> # ($(SMM_REQUIRE) == FALSE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
> @@ -758,7 +759,10 @@ [Components]
> <LibraryClasses>
> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> }
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> <LibraryClasses>
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index f232de13a7b6..411d4288f6a1 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -603,6 +603,7 @@ [PcdsDynamicDefault]
> # ($(SMM_REQUIRE) == FALSE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> !if $(SMM_REQUIRE) == FALSE
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
> @@ -822,7 +823,10 @@ [Components]
> <LibraryClasses>
> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> }
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> <LibraryClasses>
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index a9d422bd9169..0988ad4b1db2 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -610,6 +610,7 @@ [PcdsDynamicDefault]
> # ($(SMM_REQUIRE) == FALSE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> !if $(SMM_REQUIRE) == FALSE
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
> @@ -835,7 +836,10 @@ [Components.X64]
> <LibraryClasses>
> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> }
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> <LibraryClasses>
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index 3f970a79a08a..2c432af4eedc 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -632,6 +632,7 @@ [PcdsDynamicDefault]
> # ($(SMM_REQUIRE) == FALSE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> !if $(SMM_REQUIRE) == FALSE
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
> @@ -903,7 +904,10 @@ [Components]
> <LibraryClasses>
> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> }
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
> <LibraryClasses>
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf
> b/OvmfPkg/PlatformPei/PlatformPei.inf
> index 1fadadeb5565..3e28e1596d32 100644
> --- a/OvmfPkg/PlatformPei/PlatformPei.inf
> +++ b/OvmfPkg/PlatformPei/PlatformPei.inf
> @@ -99,6 +99,7 @@ [Pcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
> gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm
> gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable
> gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack
> --
> 2.39.1
>
>
>
>
>
>
>
--
Paweł Poławski
Red Hat <https://www.redhat.com/> Virtualization
ppolawsk@redhat.com
@RedHat <https://twitter.com/redhat> Red Hat
<https://www.linkedin.com/company/red-hat> Red Hat
<https://www.facebook.com/RedHatInc>
<https://red.ht/sig>
[-- Attachment #2: Type: text/html, Size: 14207 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] PATCH v3 2/3 ArmVirtPkg: take PcdResizeXterm from the QEMU command line
[not found] ` <17449E3B887C4E80.23192@groups.io>
@ 2023-03-24 14:00 ` Paweł Poławski
0 siblings, 0 replies; 10+ messages in thread
From: Paweł Poławski @ 2023-03-24 14:00 UTC (permalink / raw)
To: devel; +Cc: Ard Biesheuvel, Leif Lindholm, Sami Mujawar, Gerd Hoffmann
[-- Attachment #1: Type: text/plain, Size: 5702 bytes --]
Hi all,
If someone had a chance to take a look at this patchset already and would
like to share thoughts?
The 1st patch from this series has been already successfully reviewed.
Best regards,
Pawel
On Fri, Feb 17, 2023 at 2:03 PM Paweł Poławski <ppolawsk@redhat.com> wrote:
> From: Laszlo Ersek <lersek@redhat.com>
>
> This patch enables recognition of PcdResizeXterm config variable.
> When enablet it will trigger passing xterm control sequences
> from the ArmVirtPkg to the client terminal (xterm, gnome-terminal etc.).
> This way client terminal window size will be alligned with
> numbers of rows and columns used by firmware.
>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>
> Pawel Polawski: Updated commit message for re-submission
>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
>
> Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
> ---
> ArmVirtPkg/ArmVirtQemu.dsc | 7
> +++-
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf | 33
> ++++++++++++++++
> OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c | 41
> ++++++++++++++++++++
> 3 files changed, 80 insertions(+), 1 deletion(-)
>
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 0f1c6395488a..5f99c0a5104f 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -304,6 +304,8 @@ [PcdsPatchableInModule]
> gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
> !endif
>
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
> +
> [PcdsDynamicHii]
>
> gArmVirtTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gArmVirtVariableGuid|0x0|FALSE|NV,BS
>
> @@ -418,7 +420,10 @@ [Components.common]
> MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
> - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
> + <LibraryClasses>
> +
> NULL|OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> + }
> MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
>
> MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
> diff --git
> a/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> new file mode 100644
> index 000000000000..b4108ec04b0b
> --- /dev/null
> +++ b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
> @@ -0,0 +1,33 @@
> +## @file
> +# Plugin library for setting up dynamic PCDs for TerminalDxe, from fw_cfg
> +#
> +# Copyright (c) 2015-2020, Red Hat, Inc.
> +# Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>
> +#
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> +##
> +
> +[Defines]
> + INF_VERSION = 0x00010005
> + BASE_NAME = TerminalPcdProducerLib
> + FILE_GUID = 4a0c5ed7-8c42-4c01-8f4c-7bf258316a96
> + MODULE_TYPE = BASE
> + VERSION_STRING = 1.0
> + LIBRARY_CLASS = NULL
> + CONSTRUCTOR = TerminalPcdProducerLibConstructor
> +
> +[Sources]
> + TerminalPcdProducerLib.c
> +
> +[Packages]
> + MdeModulePkg/MdeModulePkg.dec
> + MdePkg/MdePkg.dec
> + OvmfPkg/OvmfPkg.dec
> +
> +[LibraryClasses]
> + DebugLib
> + PcdLib
> + QemuFwCfgSimpleParserLib
> +
> +[Pcd]
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## SOMETIMES_PRODUCES
> diff --git
> a/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
> b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
> new file mode 100644
> index 000000000000..fe65273822a0
> --- /dev/null
> +++ b/OvmfPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
> @@ -0,0 +1,41 @@
> +/** @file
> +
> + Copyright (c) 2015-2020, Red Hat, Inc.
> + Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>
> +
> + SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> + Plugin library for setting up dynamic PCDs for TerminalDxe, from fw_cfg
> +
> +**/
> +
> +#include <Library/DebugLib.h>
> +#include <Library/PcdLib.h>
> +#include <Library/QemuFwCfgSimpleParserLib.h>
> +
> +#define UPDATE_BOOLEAN_PCD_FROM_FW_CFG(TokenName)
> \
> + do {
> \
> + BOOLEAN Setting;
> \
> + RETURN_STATUS PcdStatus;
> \
> +
> \
> + if (!RETURN_ERROR (QemuFwCfgParseBool (
> \
> + "opt/org.tianocore/" #TokenName, &Setting))) { \
> + PcdStatus = PcdSetBoolS (TokenName, Setting);
> \
> + ASSERT_RETURN_ERROR (PcdStatus);
> \
> + }
> \
> + } while (0)
> +
> +/**
> + Update PCD configuration variable from firmware config.
> +
> + @return Always returns RETURN_SUCCESS
> +**/
> +RETURN_STATUS
> +EFIAPI
> +TerminalPcdProducerLibConstructor (
> + VOID
> + )
> +{
> + UPDATE_BOOLEAN_PCD_FROM_FW_CFG (PcdResizeXterm);
> + return RETURN_SUCCESS;
> +}
> --
> 2.39.1
>
>
>
>
>
>
>
--
Paweł Poławski
Red Hat <https://www.redhat.com/> Virtualization
ppolawsk@redhat.com
@RedHat <https://twitter.com/redhat> Red Hat
<https://www.linkedin.com/company/red-hat> Red Hat
<https://www.facebook.com/RedHatInc>
<https://red.ht/sig>
[-- Attachment #2: Type: text/html, Size: 9684 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change
2023-02-17 13:01 ` [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change Paweł Poławski
@ 2023-04-04 15:12 ` Ard Biesheuvel
0 siblings, 0 replies; 10+ messages in thread
From: Ard Biesheuvel @ 2023-04-04 15:12 UTC (permalink / raw)
To: devel, ppolawsk; +Cc: Jian J Wang, Liming Gao
On Fri, 17 Feb 2023 at 14:02, Paweł Poławski <ppolawsk@redhat.com> wrote:
>
> From: Laszlo Ersek <lersek@redhat.com>
>
> TerminalDxe driver can send xterm control sequences.
> Reference: <http://rtfm.etla.org/xterm/ctlseq.html>
>
> This way it can trigger client window resize (xterm,
> gnome-terminal etc.) accordingly, to a specified number
> of rows and columns. It improves user experience
> when handling text mode based operations.
>
> New PcdResizeXterm config switch has been added to enable
> or disable this behaviour.
>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>
> Pawel Polawski: Updated commit message for re-submission
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>
> Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
> ---
> MdeModulePkg/MdeModulePkg.dec | 4 +++
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 2 ++
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 29 ++++++++++++++++++++
> 3 files changed, 35 insertions(+)
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
> index 9605c617b7a8..76007e0af42a 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -2107,6 +2107,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
> # @Prompt The shared bit mask when Intel Tdx is enabled.
> gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10000025
>
> + ## Controls whether TerminalDxe outputs an XTerm resize sequence on terminal
> + # mode change.
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE|BOOLEAN|0x00010080
> +
> [PcdsPatchableInModule]
> ## Specify memory size with page number for PEI code when
> # Loading Module at Fixed Address feature is enabled.
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> index b2a8aeba8510..eff625346539 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> @@ -55,6 +55,7 @@ [LibraryClasses]
> DebugLib
> PcdLib
> BaseLib
> + PrintLib
>
> [Guids]
> ## SOMETIMES_PRODUCES ## Variable:L"ConInDev"
> @@ -87,6 +88,7 @@ [Protocols]
> [Pcd]
> gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType ## SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## CONSUMES
> + gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## CONSUMES
>
> # [Event]
> # # Relative timer event set by UnicodeToEfiKey(), used to be one 2 seconds input timeout.
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> index 7809869e7d49..496849458db4 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> @@ -7,6 +7,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> +#include <Library/PrintLib.h>
> +
> #include "Terminal.h"
>
> //
> @@ -80,6 +82,15 @@ CHAR16 mSetCursorPositionString[] = { ESC, '[', '0', '0', ';', '0', '0', 'H', 0
> CHAR16 mCursorForwardString[] = { ESC, '[', '0', '0', 'C', 0 };
> CHAR16 mCursorBackwardString[] = { ESC, '[', '0', '0', 'D', 0 };
>
> +//
> +// Note that this is an ASCII format string, taking two INT32 arguments:
> +// rows, columns.
> +//
> +// A %d (INT32) format specification can expand to at most 11 characters.
> +//
> +CHAR8 mResizeTextAreaFormatString[] = "\x1B[8;%d;%dt";
> +#define RESIZE_SEQ_SIZE (sizeof mResizeTextAreaFormatString + 2 * (11 - 2))
> +
> //
> // Body of the ConOut functions
> //
> @@ -498,6 +509,24 @@ TerminalConOutSetMode (
> return EFI_DEVICE_ERROR;
> }
>
> + if (PcdGetBool (PcdResizeXterm)) {
> + CHAR16 ResizeSequence[RESIZE_SEQ_SIZE];
> +
> + UnicodeSPrintAsciiFormat (
> + ResizeSequence,
> + sizeof ResizeSequence,
> + mResizeTextAreaFormatString,
> + (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Rows,
> + (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Columns
> + );
> + TerminalDevice->OutputEscChar = TRUE;
> + Status = This->OutputString (This, ResizeSequence);
> + TerminalDevice->OutputEscChar = FALSE;
> + if (EFI_ERROR (Status)) {
> + return EFI_DEVICE_ERROR;
> + }
> + }
> +
> This->Mode->Mode = (INT32)ModeNumber;
>
> Status = This->ClearScreen (This);
> --
> 2.39.1
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-04-04 15:12 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-17 13:01 [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF Paweł Poławski
2023-02-17 13:01 ` [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change Paweł Poławski
2023-04-04 15:12 ` Ard Biesheuvel
2023-02-17 13:01 ` [edk2-devel] PATCH v3 2/3 ArmVirtPkg: take PcdResizeXterm from the QEMU command line Paweł Poławski
2023-02-17 13:01 ` [edk2-devel] PATCH v3 3/3 OvmfPkg: " Paweł Poławski
[not found] ` <17449E3B102C52E2.23192@groups.io>
2023-03-07 12:47 ` [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change Paweł Poławski
2023-03-10 2:31 ` 回复: [edk2-devel] PATCH v3 0/3 Add xterm resize support to OVMF gaoliming
2023-03-24 13:57 ` Paweł Poławski
[not found] ` <17449E3BBCD94462.23192@groups.io>
2023-03-24 13:59 ` [edk2-devel] PATCH v3 3/3 OvmfPkg: take PcdResizeXterm from the QEMU command line Paweł Poławski
[not found] ` <17449E3B887C4E80.23192@groups.io>
2023-03-24 14:00 ` [edk2-devel] PATCH v3 2/3 ArmVirtPkg: " Paweł Poławski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox