File 0001-Revert-MdeModulePkg-TerminalDxe-Support-multiple-mod.patch of Package ovmf
From 5155d96d42dda31b499f1ad2e45aca51f6b42ea0 Mon Sep 17 00:00:00 2001
From: Chun-Yi Lee <jlee@suse.com>
Date: Thu, 9 Oct 2025 16:21:40 +0800
Subject: [PATCH] Revert "MdeModulePkg/TerminalDxe: Support multiple modes for
SetMode function"
This reverts commit 9224a2b91764ab17b2c1dbc9fdcb012eaed62da6.
---
.../Universal/Console/TerminalDxe/Terminal.c | 6 +----
.../Universal/Console/TerminalDxe/Terminal.h | 3 ---
.../Universal/Console/TerminalDxe/TerminalConOut.c | 29 +++-------------------
3 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 2f455719b7..d1c128de62 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -2,7 +2,6 @@
Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and
Simple Text Output Protocol upon Serial IO Protocol.
-Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.<BR>
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -115,10 +114,7 @@ TERMINAL_DEV mTerminalDevTemplate = {
TERMINAL_CONSOLE_MODE_DATA mTerminalConsoleModeData[] = {
{ 80, 25 },
{ 80, 50 },
- { 100, 31 }, // 800 x 600
- { 128, 40 }, // 1024 x 768
- { 160, 42 }, // 1280 x 800
- { 240, 56 }, // 1920 x 1080
+ { 100, 31 },
//
// New modes can be added here.
//
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index 66438bec7e..61fbd808ae 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -1,7 +1,6 @@
/** @file
Header file for Terminal driver.
-Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.<BR>
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -163,8 +162,6 @@ typedef union {
#define ROW_OFFSET 2
#define COLUMN_OFFSET 5
#define FW_BACK_OFFSET 2
-#define RESIZE_ROW_OFFSET 4
-#define RESIZE_COLUMN_OFFSET 8
typedef struct {
UINT16 Unicode;
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
index eb8658c892..7809869e7d 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
@@ -1,7 +1,6 @@
/** @file
Implementation for EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL protocol.
-Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.<BR>
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -75,7 +74,6 @@ UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {
};
CHAR16 mSetModeString[] = { ESC, '[', '=', '3', 'h', 0 };
-CHAR16 mSetModeStringResize[] = { ESC, '[', '8', ';', '0', '0', '0', ';', '0', '0', '0', 't', '0', 0 };
CHAR16 mSetAttributeString[] = { ESC, '[', '0', 'm', ESC, '[', '4', '0', 'm', ESC, '[', '4', '0', 'm', 0 };
CHAR16 mClearScreenString[] = { ESC, '[', '2', 'J', 0 };
CHAR16 mSetCursorPositionString[] = { ESC, '[', '0', '0', ';', '0', '0', 'H', 0 };
@@ -455,6 +453,7 @@ TerminalConOutQueryMode (
Implements EFI_SIMPLE_TEXT_OUT.SetMode().
Set the terminal to a specified display mode.
+ In this driver, we only support mode 0.
@param This Indicates the calling context.
@param ModeNumber The text mode to set.
@@ -474,12 +473,9 @@ TerminalConOutSetMode (
{
EFI_STATUS Status;
TERMINAL_DEV *TerminalDevice;
- CHAR16 *String;
- UINTN Columns;
- UINTN Rows;
//
- // Get Terminal device data structure pointer.
+ // get Terminal device data structure pointer.
//
TerminalDevice = TERMINAL_CON_OUT_DEV_FROM_THIS (This);
@@ -488,25 +484,6 @@ TerminalConOutSetMode (
}
//
- // Configure terminal string for the text mode to set.
- //
- if (ModeNumber == 0) {
- String = mSetModeString;
- } else {
- Columns = TerminalDevice->TerminalConsoleModeData[ModeNumber].Columns;
- Rows = TerminalDevice->TerminalConsoleModeData[ModeNumber].Rows;
-
- mSetModeStringResize[RESIZE_ROW_OFFSET + 0] = (CHAR16)('0' + (Rows / 100));
- mSetModeStringResize[RESIZE_ROW_OFFSET + 1] = (CHAR16)('0' + ((Rows - ((Rows / 100) * 100)) / 10));
- mSetModeStringResize[RESIZE_ROW_OFFSET + 2] = (CHAR16)('0' + (Rows % 10));
- mSetModeStringResize[RESIZE_COLUMN_OFFSET + 0] = (CHAR16)('0' + (Columns / 100));
- mSetModeStringResize[RESIZE_COLUMN_OFFSET + 1] = (CHAR16)('0' + ((Columns - ((Columns / 100) * 100)) / 10));
- mSetModeStringResize[RESIZE_COLUMN_OFFSET + 2] = (CHAR16)('0' + (Columns % 10));
-
- String = mSetModeStringResize;
- }
-
- //
// Set the current mode
//
This->Mode->Mode = (INT32)ModeNumber;
@@ -514,7 +491,7 @@ TerminalConOutSetMode (
This->ClearScreen (This);
TerminalDevice->OutputEscChar = TRUE;
- Status = This->OutputString (This, String);
+ Status = This->OutputString (This, mSetModeString);
TerminalDevice->OutputEscChar = FALSE;
if (EFI_ERROR (Status)) {
--
2.12.3