public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch v2 00/11] Remove all UGA support
@ 2022-07-15  1:50 Guomin Jiang
  2022-07-15  1:50 ` [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support Guomin Jiang
                   ` (11 more replies)
  0 siblings, 12 replies; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:50 UTC (permalink / raw)
  To: devel

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

The Plan:
1. Remove the upstream UGA code first but keep definition in Edk2 at
first
2. Then downstream owner to remove UGA related code
3. Remove Edk2 definition last.

GuoMinJ (9):
  UefiPayloadPkg: Remove All UGA Support
  ArmVirtPkg: Remove All UGA Support
  ArmPkg: Remove All UGA Support
  EmulatorPkg: Remove All UGA Support
  ShellPkg: Remove All UGA Support
  OvmfPkg: Remove All UGA Support
  MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  MdeModulePkg/GraphicsConsoleDxe: Remove All UGA Support
  MdeModulePkg: Remove All UGA Support

Guomin Jiang (2):
  BaseTools: Remove all UGA support
  MdePkg/UefiLib: Remove all UGA support

 .../PlatformBootManagerLib/PlatformBm.h       |   4 +-
 .../PlatformBootManagerLib.inf                |   5 +-
 ArmVirtPkg/ArmVirtQemu.dsc                    |   7 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc              |   7 +-
 .../Source/C/Include/Protocol/HiiFramework.h  |  53 +--
 BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 -------
 EmulatorPkg/EmuGopDxe/Gop.h                   |  10 +-
 EmulatorPkg/EmuGopDxe/GopScreen.c             |  14 +-
 EmulatorPkg/Include/Protocol/EmuFileSystem.h  |  24 +-
 .../Include/Protocol/EmuGraphicsWindow.h      |  18 +-
 .../Library/PlatformBmLib/PlatformBm.h        |   4 +-
 .../Library/PlatformBmLib/PlatformBmData.c    |   6 +-
 EmulatorPkg/Unix/Host/Gasket.h                |  12 +-
 EmulatorPkg/Unix/Host/Host.h                  |   3 +-
 EmulatorPkg/Unix/Host/Ia32/Gasket.S           |   2 +-
 EmulatorPkg/Unix/Host/X11GraphicsWindow.c     |  82 ++--
 EmulatorPkg/Unix/Host/X64/Gasket.S            |   2 +-
 EmulatorPkg/Win/Host/WinGopScreen.c           |  10 +-
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c       |   4 +-
 MdeModulePkg/Include/Library/BootLogoLib.h    |   4 +-
 .../Library/BootLogoLib/BootLogoLib.c         | 228 +++-------
 .../Library/BootLogoLib/BootLogoLib.inf       |   6 +-
 .../Console/ConSplitterDxe/ConSplitter.c      | 405 +++---------------
 .../Console/ConSplitterDxe/ConSplitter.h      | 138 +-----
 .../Console/ConSplitterDxe/ConSplitterDxe.inf |  17 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.uni |  12 +-
 .../ConSplitterDxe/ConSplitterGraphics.c      | 310 +-------------
 .../GraphicsConsoleDxe/GraphicsConsole.c      | 300 +------------
 .../GraphicsConsoleDxe/GraphicsConsole.h      |  21 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf |   8 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.uni |   6 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/Image.c |   4 +-
 MdePkg/Library/UefiLib/UefiLib.inf            |   4 +-
 MdePkg/Library/UefiLib/UefiLibInternal.h      |   3 +-
 MdePkg/Library/UefiLib/UefiLibPrint.c         |  91 +---
 MdePkg/MdePkg.dsc                             |   3 -
 OvmfPkg/AmdSev/AmdSevX64.dsc                  |   4 +-
 OvmfPkg/Bhyve/BhyveX64.dsc                    |   4 +-
 OvmfPkg/Microvm/MicrovmX64.dsc                |   4 +-
 OvmfPkg/OvmfPkgIa32.dsc                       |   2 -
 OvmfPkg/OvmfPkgIa32X64.dsc                    |   2 -
 OvmfPkg/OvmfPkgX64.dsc                        |   2 -
 OvmfPkg/OvmfXen.dsc                           |   4 +-
 .../UefiHandleParsingLib.c                    |   4 +-
 .../UefiHandleParsingLib.h                    |   4 +-
 .../UefiHandleParsingLib.inf                  |   4 +-
 .../UefiHandleParsingLib.uni                  |   4 +-
 .../PlatformBootManager.h                     |   4 +-
 .../PlatformBootManagerLib.inf                |   4 +-
 UefiPayloadPkg/UefiPayloadPkg.dsc             |   2 -
 50 files changed, 276 insertions(+), 1760 deletions(-)
 delete mode 100644 BaseTools/Source/C/Include/Protocol/UgaDraw.h

-- 
2.26.2.windows.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
@ 2022-07-15  1:50 ` Guomin Jiang
  2022-07-15  2:21   ` Ni, Ray
  2022-07-15  1:50 ` [Patch v2 02/11] ArmVirtPkg: " Guomin Jiang
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:50 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Guo Dong, Ray Ni, Maurice Ma, Benjamin You, Sean Rhodes

From: GuoMinJ <newexplorerj@gmail.com>

REF: https//bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove PcdConOutGopSupport, it is unnecessary any more.
Remove All UGA Support in UefiPayloadPkg.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
---
 .../Library/PlatformBootManagerLib/PlatformBootManager.h      | 4 ++--
 .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 4 +---
 UefiPayloadPkg/UefiPayloadPkg.dsc                             | 2 --
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
index 5614aadafb98..0f93287ac1f7 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
@@ -1,7 +1,7 @@
 /** @file
    Head file for BDS Platform specific code
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -98,7 +98,7 @@ PlatformBootManagerEnableQuietBoot (
   Use SystemTable Conout to turn on video based Simple Text Out consoles. The
   Simple Text Out screens will now be synced up with all non video output devices
 
-  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.
+  @retval EFI_SUCCESS     Graphic devices are back in text mode and synced up.
 
 **/
 EFI_STATUS
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9f58c460cd6b..2ebe7b3fd960 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Include all platform action which can be customized by IBV/OEM.
 #
-#  Copyright (c) 2012 - 2021, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR>
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -55,7 +55,6 @@
 [Protocols]
   gEfiGenericMemTestProtocolGuid  ## CONSUMES
   gEfiGraphicsOutputProtocolGuid  ## CONSUMES
-  gEfiUgaDrawProtocolGuid         ## CONSUMES
   gEfiBootLogoProtocolGuid        ## CONSUMES
   gEfiDxeSmmReadyToLockProtocolGuid
   gEfiSmmAccess2ProtocolGuid
@@ -65,7 +64,6 @@
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
   gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 2428bb2ce9a9..50b9b017588d 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -373,8 +373,6 @@
 ################################################################################
 [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   ## This PCD specified whether ACPI SDT protocol is installed.
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 02/11] ArmVirtPkg: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
  2022-07-15  1:50 ` [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support Guomin Jiang
@ 2022-07-15  1:50 ` Guomin Jiang
  2022-07-15  9:42   ` Sami Mujawar
  2022-07-15  1:50 ` [Patch v2 03/11] ArmPkg: " Guomin Jiang
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:50 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Ard Biesheuvel, Leif Lindholm, Sami Mujawar,
	Gerd Hoffmann

From: GuoMinJ <newexplorerj@gmail.com>

REF: https//bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove PcdConOutGopSupport, it is unnecessary any more.
Remove All UGA Support in ArmVirtPkg

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
 ArmVirtPkg/ArmVirtQemu.dsc       | 7 +------
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 7 +------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 9369a88858fd..dc87050f3f3a 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -1,7 +1,7 @@
 #
 #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 #  Copyright (c) 2014, Linaro Limited. All rights reserved.
-#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -125,11 +125,6 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
 
-  ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
-  #  It could be set FALSE to save size.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
-
   gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
 
   gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE)
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 7f7d15d6eee3..0d13d8edb407 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -1,7 +1,7 @@
 #
 #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 #  Copyright (c) 2014, Linaro Limited. All rights reserved.
-#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -107,11 +107,6 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
 
-  ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
-  #  It could be set FALSE to save size.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
-
   gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
 
 [PcdsFixedAtBuild.common]
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 03/11] ArmPkg: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
  2022-07-15  1:50 ` [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support Guomin Jiang
  2022-07-15  1:50 ` [Patch v2 02/11] ArmVirtPkg: " Guomin Jiang
@ 2022-07-15  1:50 ` Guomin Jiang
  2022-07-15 13:32   ` Sami Mujawar
  2022-07-15  1:50 ` [Patch v2 04/11] EmulatorPkg: " Guomin Jiang
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:50 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Leif Lindholm, Ard Biesheuvel, Sami Mujawar

From: GuoMinJ <newexplorerj@gmail.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove All UGA Support in ArmPkg.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
---
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h           | 4 ++--
 .../PlatformBootManagerLib/PlatformBootManagerLib.inf        | 5 +----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
index a40a2ff5cb4f..a2ec4c4ad6c7 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
@@ -2,7 +2,7 @@
   Head file for BDS Platform specific code
 
   Copyright (C) 2015-2016, Red Hat, Inc.
-  Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2004 - 2022, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -43,7 +43,7 @@ EnableQuietBoot (
   Simple Text Out screens will now be synced up with all non video output
   devices
 
-  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.
+  @retval EFI_SUCCESS     Graphic devices are back in text mode and synced up.
 **/
 EFI_STATUS
 DisableQuietBoot (
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 86751b45f82b..63d1d83ab0ef 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -3,7 +3,7 @@
 #
 #  Copyright (C) 2015-2016, Red Hat, Inc.
 #  Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -51,9 +51,6 @@
   UefiLib
   UefiRuntimeServicesTableLib
 
-[FeaturePcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
-
 [FixedPcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (2 preceding siblings ...)
  2022-07-15  1:50 ` [Patch v2 03/11] ArmPkg: " Guomin Jiang
@ 2022-07-15  1:50 ` Guomin Jiang
  2022-07-15  2:23   ` Ni, Ray
  2022-07-15  1:51 ` [Patch v2 05/11] ShellPkg: " Guomin Jiang
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:50 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Andrew Fish, Ray Ni

From: GuoMinJ <newexplorerj@gmail.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove All UGA Support in EmulatorPkg.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
---
 EmulatorPkg/EmuGopDxe/Gop.h                   | 10 +--
 EmulatorPkg/EmuGopDxe/GopScreen.c             | 14 ++--
 EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 24 +++---
 .../Include/Protocol/EmuGraphicsWindow.h      | 18 ++--
 .../Library/PlatformBmLib/PlatformBm.h        |  4 +-
 .../Library/PlatformBmLib/PlatformBmData.c    |  6 +-
 EmulatorPkg/Unix/Host/Gasket.h                | 12 +--
 EmulatorPkg/Unix/Host/Host.h                  |  3 +-
 EmulatorPkg/Unix/Host/Ia32/Gasket.S           |  2 +-
 EmulatorPkg/Unix/Host/X11GraphicsWindow.c     | 82 +++++++++----------
 EmulatorPkg/Unix/Host/X64/Gasket.S            |  2 +-
 EmulatorPkg/Win/Host/WinGopScreen.c           | 10 +--
 12 files changed, 92 insertions(+), 95 deletions(-)

diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h
index 7f7dc4e8eb9f..59ebfda912eb 100644
--- a/EmulatorPkg/EmuGopDxe/Gop.h
+++ b/EmulatorPkg/EmuGopDxe/Gop.h
@@ -1,13 +1,13 @@
 /*++ @file
 
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2010,Apple Inc. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#ifndef __UGA_H_
-#define __UGA_H_
+#ifndef GOP_H_
+#define GOP_H_
 
 #include <PiDxe.h>
 
@@ -60,8 +60,6 @@ typedef struct {
 extern EFI_DRIVER_BINDING_PROTOCOL  gEmuGopDriverBinding;
 extern EFI_COMPONENT_NAME_PROTOCOL  gEmuGopComponentName;
 
-#define EMU_UGA_CLASS_NAME  L"EmuGopWindow"
-
 #define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('G', 'o', 'p', 'N')
 typedef struct {
   UINT64                               Signature;
@@ -83,7 +81,7 @@ typedef struct {
   GOP_MODE_DATA                        *ModeData;
 
   //
-  // UGA Private Data knowing when to start hardware
+  // Private Data knowing when to start hardware
   //
   BOOLEAN                              HardwareNeedsStarting;
 
diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c
index 88d95b88e162..113b496861b4 100644
--- a/EmulatorPkg/EmuGopDxe/GopScreen.c
+++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
@@ -10,7 +10,7 @@ Module Name:
 
 Abstract:
 
-  This file produces the graphics abstration of UGA. It is called by
+  This file produces the graphics abstration of GOP. It is called by
   EmuGopDriver.c file which deals with the EFI 1.1 driver model.
   This file just does graphics.
 
@@ -209,7 +209,7 @@ EmuGopBlt (
   // the number of bytes in each row can be computed.
   //
   if (Delta == 0) {
-    Delta = Width * sizeof (EFI_UGA_PIXEL);
+    Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
   }
 
   //
@@ -220,8 +220,8 @@ EmuGopBlt (
   OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
 
   //
-  // Pack UGA Draw protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
-  // GopBlt() API of Unix UGA IO protocol.
+  // Pack GOP protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
+  // GopBlt() API of GOP protocol.
   //
   GopBltArgs.DestinationX = DestinationX;
   GopBltArgs.DestinationY = DestinationY;
@@ -232,8 +232,8 @@ EmuGopBlt (
   GopBltArgs.Delta        = Delta;
   Status                  = Private->EmuGraphicsWindow->Blt (
                                                           Private->EmuGraphicsWindow,
-                                                          (EFI_UGA_PIXEL *)BltBuffer,
-                                                          (EFI_UGA_BLT_OPERATION)BltOperation,
+                                                          BltBuffer,
+                                                          BltOperation,
                                                           &GopBltArgs
                                                           );
 
@@ -384,7 +384,7 @@ ShutdownGopEvent (
 
 Routine Description:
 
-  This is the UGA screen's callback notification function for exit-boot-services.
+  This is the screen's callback notification function for exit-boot-services.
   All we do here is call EmuGopDestructor().
 
 Arguments:
diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
index 15de43ac022e..062508fafc9d 100644
--- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
+++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
@@ -7,19 +7,19 @@
 
   UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem.
 
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2011, Apple Inc. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#ifndef _EMU_UGA_IO_H_
-#define _EMU_UGA_IO_H_
+#ifndef EMU_GRAPHICS_WINDOW_H_
+#define EMU_GRAPHICS_WINDOW_H_
 
 #include <Protocol/SimplePointer.h>
 #include <Protocol/SimpleTextIn.h>
 #include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
+#include <Protocol/GraphicsOutput.h>
 
 #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
  { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8, 0xCA, 0xC1 } }
@@ -29,13 +29,13 @@ typedef struct _EMU_GRAPHICS_WINDOW_PROTOCOL EMU_GRAPHICS_WINDOW_PROTOCOL;
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
   );
 
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
+  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
   UINT32                        Width,
   UINT32                        Height
   );
@@ -43,13 +43,13 @@ EFI_STATUS
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
   );
 
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
+  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
   EFI_KEY_DATA                  *key
   );
 
@@ -88,10 +88,10 @@ typedef struct {
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
-  IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
-  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
-  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
+  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
+  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
   );
 
 typedef
diff --git a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
index 7c495b25eb1b..ed7b71611f90 100644
--- a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
+++ b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
@@ -6,13 +6,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#ifndef _EMU_UGA_IO_H_
-#define _EMU_UGA_IO_H_
+#ifndef EMU_GRAPHICS_WINDOW_H_
+#define EMU_GRAPHICS_WINDOW_H_
 
 #include <Protocol/SimplePointer.h>
 #include <Protocol/SimpleTextIn.h>
 #include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
+#include <Protocol/GraphicsOutput.h>
 
 #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
  { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8, 0xCA, 0xC1 } }
@@ -22,13 +22,13 @@ typedef struct _EMU_GRAPHICS_WINDOW_PROTOCOL EMU_GRAPHICS_WINDOW_PROTOCOL;
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
   );
 
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
+  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
   UINT32                        Width,
   UINT32                        Height
   );
@@ -36,13 +36,13 @@ EFI_STATUS
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
   );
 
 typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
-  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
+  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
   EFI_KEY_DATA                  *key
   );
 
@@ -83,8 +83,8 @@ typedef
 EFI_STATUS
 (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
   IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
-  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer OPTIONAL,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,
   IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
   );
 
diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
index b89ffd77e4de..462049e2b048 100644
--- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
+++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2011, Apple Inc. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -60,7 +60,7 @@ typedef struct {
   EMU_VENDOR_DEVICE_PATH_NODE    EmuBus;
   EMU_VENDOR_DEVICE_PATH_NODE    EmuGraphicsWindow;
   EFI_DEVICE_PATH_PROTOCOL       End;
-} EMU_PLATFORM_UGA_DEVICE_PATH;
+} EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH;
 
 //
 // Platform BDS Functions
diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
index efb03def37eb..b69c4728d1a7 100644
--- a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
+++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2011, Apple Inc. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -8,7 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "PlatformBm.h"
 
-EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath = {
+EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH  gGopDevicePath = {
   {
     {
       {
@@ -40,7 +40,7 @@ EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath = {
   gEndEntire
 };
 
-EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath2 = {
+EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH  gGopDevicePath2 = {
   {
     {
       {
diff --git a/EmulatorPkg/Unix/Host/Gasket.h b/EmulatorPkg/Unix/Host/Gasket.h
index 6dafc903cfce..1ffdfb334524 100644
--- a/EmulatorPkg/Unix/Host/Gasket.h
+++ b/EmulatorPkg/Unix/Host/Gasket.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
-  Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -200,7 +200,7 @@ ReverseGasketUint64Uint64 (
   );
 
 //
-// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
+// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
 //
 
 EFI_STATUS
@@ -243,10 +243,10 @@ GasketX11RegisterKeyNotify (
 EFI_STATUS
 EFIAPI
 GasketX11Blt (
-  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsWindows,
-  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION           BltOperation,
-  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
+  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
+  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
   );
 
 EFI_STATUS
diff --git a/EmulatorPkg/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h
index 0c81cdfc01f5..ff30f5dce567 100644
--- a/EmulatorPkg/Unix/Host/Host.h
+++ b/EmulatorPkg/Unix/Host/Host.h
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -106,7 +106,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Protocol/SimplePointer.h>
 #include <Protocol/SimpleTextIn.h>
 #include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
 #include <Protocol/SimpleFileSystem.h>
 
 #include <Protocol/EmuThunk.h>
diff --git a/EmulatorPkg/Unix/Host/Ia32/Gasket.S b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
index 36197ff26028..6fcdd265cf30 100644
--- a/EmulatorPkg/Unix/Host/Ia32/Gasket.S
+++ b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
@@ -371,7 +371,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
   ret
 
 //
-// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
+// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
 //
 
 ASM_GLOBAL ASM_PFX(GasketX11Size)
diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
index a30cc19dbe0a..b3880e198855 100644
--- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
+++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2022, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -700,8 +700,8 @@ HandleEvents (
 
 unsigned long
 X11PixelToColor (
-  IN  GRAPHICS_IO_PRIVATE  *Drv,
-  IN  EFI_UGA_PIXEL        pixel
+  IN  GRAPHICS_IO_PRIVATE            *Drv,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  pixel
   )
 {
   return ((pixel.Red   >> Drv->r.csize) << Drv->r.shift)
@@ -709,15 +709,15 @@ X11PixelToColor (
          | ((pixel.Blue  >> Drv->b.csize) << Drv->b.shift);
 }
 
-EFI_UGA_PIXEL
+EFI_GRAPHICS_OUTPUT_BLT_PIXEL
 X11ColorToPixel (
   IN  GRAPHICS_IO_PRIVATE  *Drv,
   IN  unsigned long        val
   )
 {
-  EFI_UGA_PIXEL  Pixel;
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Pixel;
 
-  memset (&Pixel, 0, sizeof (EFI_UGA_PIXEL));
+  memset (&Pixel, 0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
 
   // Truncation not an issue since X11 and EFI are both using 8 bits per color
   Pixel.Red   =   (val >> Drv->r.shift) << Drv->r.csize;
@@ -782,7 +782,7 @@ X11KeySetState (
     if ((Drv->KeyState.KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == 0) {
       //
       // We could create an XKeyEvent and send a XK_Caps_Lock to
-      // the UGA/GOP Window
+      // the GOP Window
       //
     }
   }
@@ -812,32 +812,32 @@ X11RegisterKeyNotify (
 
 EFI_STATUS
 X11Blt (
-  IN EMU_GRAPHICS_WINDOW_PROTOCOL     *GraphicsIo,
-  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION           BltOperation,
-  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
+  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
+  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
   )
 {
-  GRAPHICS_IO_PRIVATE  *Private;
-  UINTN                DstY;
-  UINTN                SrcY;
-  UINTN                DstX;
-  UINTN                SrcX;
-  UINTN                Index;
-  EFI_UGA_PIXEL        *Blt;
-  UINT8                *Dst;
-  UINT8                *Src;
-  UINTN                Nbr;
-  unsigned long        Color;
-  XEvent               ev;
+  GRAPHICS_IO_PRIVATE            *Private;
+  UINTN                          DstY;
+  UINTN                          SrcY;
+  UINTN                          DstX;
+  UINTN                          SrcX;
+  UINTN                          Index;
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  *Blt;
+  UINT8                          *Dst;
+  UINT8                          *Src;
+  UINTN                          Nbr;
+  unsigned long                  Color;
+  XEvent                         ev;
 
   Private = (GRAPHICS_IO_PRIVATE *)GraphicsIo;
 
   //
   //  Check bounds
   //
-  if (  (BltOperation == EfiUgaVideoToBltBuffer)
-     || (BltOperation == EfiUgaVideoToVideo))
+  if (  (BltOperation == EfiBltVideoToBltBuffer)
+     || (BltOperation == EfiBltVideoToVideo))
   {
     //
     // Source is Video.
@@ -851,9 +851,9 @@ X11Blt (
     }
   }
 
-  if (  (BltOperation == EfiUgaBltBufferToVideo)
-     || (BltOperation == EfiUgaVideoToVideo)
-     || (BltOperation == EfiUgaVideoFill))
+  if (  (BltOperation == EfiBltBufferToVideo)
+     || (BltOperation == EfiBltVideoToVideo)
+     || (BltOperation == EfiBltVideoFill))
   {
     //
     // Destination is Video
@@ -868,32 +868,32 @@ X11Blt (
   }
 
   switch (BltOperation) {
-    case EfiUgaVideoToBltBuffer:
-      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY * Args->Delta) + Args->DestinationX * sizeof (EFI_UGA_PIXEL));
-      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
+    case EfiBltVideoToBltBuffer:
+      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY * Args->Delta) + Args->DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
+      Args->Delta -= Args->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
       for (SrcY = Args->SourceY; SrcY < (Args->Height + Args->SourceY); SrcY++) {
         for (SrcX = Args->SourceX; SrcX < (Args->Width + Args->SourceX); SrcX++) {
           *Blt++ = X11ColorToPixel (Private, XGetPixel (Private->image, SrcX, SrcY));
         }
 
-        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
+        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt + Args->Delta);
       }
 
       break;
-    case EfiUgaBltBufferToVideo:
-      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY * Args->Delta) + Args->SourceX * sizeof (EFI_UGA_PIXEL));
-      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
+    case EfiBltBufferToVideo:
+      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY * Args->Delta) + Args->SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
+      Args->Delta -= Args->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
       for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
         for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
           XPutPixel (Private->image, DstX, DstY, X11PixelToColor (Private, *Blt));
           Blt++;
         }
 
-        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
+        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt + Args->Delta);
       }
 
       break;
-    case EfiUgaVideoToVideo:
+    case EfiBltVideoToVideo:
       Dst = Private->image_data + (Args->DestinationX << Private->pixel_shift)
             + Args->DestinationY * Private->line_bytes;
       Src = Private->image_data + (Args->SourceX << Private->pixel_shift)
@@ -920,7 +920,7 @@ X11Blt (
       }
 
       break;
-    case EfiUgaVideoFill:
+    case EfiBltVideoFill:
       Color = X11PixelToColor (Private, *BltBuffer);
       for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
         for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
@@ -937,7 +937,7 @@ X11Blt (
   //  Refresh screen.
   //
   switch (BltOperation) {
-    case EfiUgaVideoToVideo:
+    case EfiBltVideoToVideo:
       XCopyArea (
         Private->display,
         Private->win,
@@ -960,7 +960,7 @@ X11Blt (
       }
 
       break;
-    case EfiUgaVideoFill:
+    case EfiBltVideoFill:
       Color = X11PixelToColor (Private, *BltBuffer);
       XSetForeground (Private->display, Private->gc, Color);
       XFillRectangle (
@@ -974,7 +974,7 @@ X11Blt (
         );
       XFlush (Private->display);
       break;
-    case EfiUgaBltBufferToVideo:
+    case EfiBltBufferToVideo:
       Redraw (Private, Args->DestinationX, Args->DestinationY, Args->Width, Args->Height);
       break;
     default:
diff --git a/EmulatorPkg/Unix/Host/X64/Gasket.S b/EmulatorPkg/Unix/Host/X64/Gasket.S
index 030faa8e4c36..1b4614ab618d 100644
--- a/EmulatorPkg/Unix/Host/X64/Gasket.S
+++ b/EmulatorPkg/Unix/Host/X64/Gasket.S
@@ -427,7 +427,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
   ret
 
 //
-// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
+// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
 //
 
 ASM_GLOBAL ASM_PFX(GasketX11Size)
diff --git a/EmulatorPkg/Win/Host/WinGopScreen.c b/EmulatorPkg/Win/Host/WinGopScreen.c
index 661573d7771c..69abcfc79564 100644
--- a/EmulatorPkg/Win/Host/WinGopScreen.c
+++ b/EmulatorPkg/Win/Host/WinGopScreen.c
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 Module Name:
@@ -396,10 +396,10 @@ WinNtWndSize (
 // TODO:    Delta - add argument and description to function comment
 EFI_STATUS
 WinNtWndBlt (
-  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsIo,
-  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION           BltOperation,
-  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
+  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
+  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
+  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
   )
 {
   RETURN_STATUS          RStatus;
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 05/11] ShellPkg: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (3 preceding siblings ...)
  2022-07-15  1:50 ` [Patch v2 04/11] EmulatorPkg: " Guomin Jiang
@ 2022-07-15  1:51 ` Guomin Jiang
  2022-07-15  2:20   ` Ni, Ray
  2022-07-15  1:51 ` [Patch v2 06/11] OvmfPkg: " Guomin Jiang
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:51 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Ray Ni, Zhichao Gao

From: GuoMinJ <newexplorerj@gmail.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove All UGA Support in ShellPkg.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c  | 4 +---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h  | 4 +---
 .../Library/UefiHandleParsingLib/UefiHandleParsingLib.inf     | 4 +---
 .../Library/UefiHandleParsingLib/UefiHandleParsingLib.uni     | 4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index aa0115bdd498..08215ab8039c 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -1,7 +1,7 @@
 /** @file
   Provides interface to advanced shell functionality for parsing both handle and protocol database.
 
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
   (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -2238,8 +2238,6 @@ STATIC CONST GUID_INFO_BLOCK  mGuidStringList[] = {
   { STRING_TOKEN (STR_SHELL_ENV2),          &gEfiShellEnvironment2Guid,                        NULL                                             },
   { STRING_TOKEN (STR_SHELL_ENV),           &gEfiShellEnvironment2Guid,                        NULL                                             },
   { STRING_TOKEN (STR_DEVICE_IO),           &gEfiDeviceIoProtocolGuid,                         NULL                                             },
-  { STRING_TOKEN (STR_UGA_DRAW),            &gEfiUgaDrawProtocolGuid,                          NULL                                             },
-  { STRING_TOKEN (STR_UGA_IO),              &gEfiUgaIoProtocolGuid,                            NULL                                             },
   { STRING_TOKEN (STR_ESP),                 &gEfiPartTypeSystemPartGuid,                       NULL                                             },
   { STRING_TOKEN (STR_GPT_NBR),             &gEfiPartTypeLegacyMbrGuid,                        NULL                                             },
   { STRING_TOKEN (STR_DRIVER_CONFIG),       &gEfiDriverConfigurationProtocolGuid,              NULL                                             },
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
index 6be0d78c4c5a..b3433eda029b 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
@@ -1,7 +1,7 @@
 /** @file
   Provides interface to advanced shell functionality for parsing both handle and protocol database.
 
-  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
   (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -94,8 +94,6 @@
 #include <Protocol/HiiConfigAccess.h>
 #include <Protocol/FormBrowser2.h>
 #include <Protocol/DeviceIo.h>
-#include <Protocol/UgaDraw.h>
-#include <Protocol/UgaIo.h>
 #include <Protocol/DriverConfiguration.h>
 #include <Protocol/DriverConfiguration2.h>
 #include <Protocol/DevicePathUtilities.h>
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
index 0d483805e712..af16569b07bd 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
@@ -1,6 +1,6 @@
 ##  @file
 #  Provides interface to advanced shell functionality for parsing both handle and protocol database.
-#  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
+#  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved. <BR>
 #  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
 #  (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
 #
@@ -129,8 +129,6 @@
   gEfiHiiConfigAccessProtocolGuid                         ## UNDEFINED
   gEfiFormBrowser2ProtocolGuid                            ## UNDEFINED
   gEfiDeviceIoProtocolGuid                                ## UNDEFINED
-  gEfiUgaDrawProtocolGuid                                 ## UNDEFINED
-  gEfiUgaIoProtocolGuid                                   ## UNDEFINED
   gEfiDriverConfigurationProtocolGuid                     ## UNDEFINED
   gEfiDriverConfiguration2ProtocolGuid                    ## UNDEFINED
   gEfiSimpleTextInputExProtocolGuid                       ## UNDEFINED
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index aa3396cea94d..04beea8e7f3e 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -1,6 +1,6 @@
 // /**
 //
-// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>
+// Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved. <BR>
 // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
 // (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
 // SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -161,8 +161,6 @@
 #string STR_SHELL_ALIAS           #language en-US "ShellAlias"
 #string STR_DEVICE_IO             #language en-US "DeviceIO"
 #string STR_TCP                   #language en-US "TCP"
-#string STR_UGA_DRAW              #language en-US "UGADraw"
-#string STR_UGA_IO                #language en-US "UGAIO"
 #string STR_ESP                   #language en-US "EFISystemPartition"
 #string STR_GPT_NBR               #language en-US "LegacyMBR"
 #string STR_DRIVER_CONFIG         #language en-US "DriverConfiguration"
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 06/11] OvmfPkg: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (4 preceding siblings ...)
  2022-07-15  1:51 ` [Patch v2 05/11] ShellPkg: " Guomin Jiang
@ 2022-07-15  1:51 ` Guomin Jiang
  2022-07-15  1:51 ` [Patch v2 07/11] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:51 UTC (permalink / raw)
  To: devel
  Cc: GuoMinJ, Ard Biesheuvel, Jiewen Yao, Jordan Justen, Gerd Hoffmann,
	Brijesh Singh, Erdem Aktas, James Bottomley, Min Xu, Tom Lendacky,
	Rebecca Cran, Peter Grehan, Anthony Perard, Julien Grall

From: GuoMinJ <newexplorerj@gmail.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Delete PcdConOutGopSupport, it is unnecessary any more.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
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>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>
---
 OvmfPkg/AmdSev/AmdSevX64.dsc   | 4 +---
 OvmfPkg/Bhyve/BhyveX64.dsc     | 4 +---
 OvmfPkg/Microvm/MicrovmX64.dsc | 4 +---
 OvmfPkg/OvmfPkgIa32.dsc        | 2 --
 OvmfPkg/OvmfPkgIa32X64.dsc     | 2 --
 OvmfPkg/OvmfPkgX64.dsc         | 2 --
 OvmfPkg/OvmfXen.dsc            | 4 +---
 7 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index 726521c94381..8fc1f85ad012 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -3,7 +3,7 @@
 #  virtual machine remote attestation and secret injection
 #
 #  Copyright (c) 2020 James Bottomley, IBM Corporation.
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -379,8 +379,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 
 [PcdsFixedAtBuild]
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index d4f0c90b8e00..d827adec363c 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -1,6 +1,6 @@
 #
 #  Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 #  Copyright (c) 2014, Pluribus Networks, Inc.
 #
@@ -419,8 +419,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 
 [PcdsFixedAtBuild]
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 61db9b6e4c83..bea69475387d 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
 #
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 #  Copyright (c) Microsoft Corporation.
 #
@@ -454,8 +454,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 
 [PcdsFixedAtBuild]
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index e708411076ca..92355f67aa50 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -458,8 +458,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 0b036d8bb53f..a73e52701d17 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -464,8 +464,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 8ad04b50f74f..8c4e4d9ec578 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -481,8 +481,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 58a7c97cddf7..388fb3267efe 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
 #
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 #  Copyright (c) 2019, Citrix Systems, Inc.
 #  Copyright (c) Microsoft Corporation.
@@ -359,8 +359,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 07/11] MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (5 preceding siblings ...)
  2022-07-15  1:51 ` [Patch v2 06/11] OvmfPkg: " Guomin Jiang
@ 2022-07-15  1:51 ` Guomin Jiang
  2022-07-15  1:51 ` [Patch v2 08/11] MdeModulePkg/GraphicsConsoleDxe: " Guomin Jiang
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:51 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jian J Wang, Liming Gao, Zhichao Gao, Ray Ni

From: GuoMinJ <newexplorerj@gmail.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove the PcdConOutGopSupport, it is unnecessary any more.
Remove All UGA Support in ConSplitterDxe component.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
---
 .../Console/ConSplitterDxe/ConSplitter.c      | 405 +++---------------
 .../Console/ConSplitterDxe/ConSplitter.h      | 138 +-----
 .../Console/ConSplitterDxe/ConSplitterDxe.inf |  17 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.uni |  12 +-
 .../ConSplitterDxe/ConSplitterGraphics.c      | 310 +-------------
 5 files changed, 80 insertions(+), 802 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 8b5e62e3a883..663fccff046d 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -16,7 +16,7 @@
   never removed. Such design ensures system function well during none console
   device situation.
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -107,15 +107,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_IN_SPLITTER_PRIVATE_DATA  mConIn = {
   FALSE
 };
 
-//
-// Uga Draw Protocol Private Data template
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL  mUgaDrawProtocolTemplate = {
-  ConSplitterUgaDrawGetMode,
-  ConSplitterUgaDrawSetMode,
-  ConSplitterUgaDrawBlt
-};
-
 //
 // Graphics Output Protocol Private Data template
 //
@@ -153,16 +144,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA  mConOut = {
     FALSE,
   },
 
-  {
-    NULL,
-    NULL,
-    NULL
-  },
-  0,
-  0,
-  0,
-  0,
-
   {
     NULL,
     NULL,
@@ -171,7 +152,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA  mConOut = {
   },
   (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL,
   0,
-  0,
 
   0,
   (TEXT_OUT_AND_GOP_DATA *)NULL,
@@ -209,16 +189,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA  mStdErr = {
     FALSE,
   },
 
-  {
-    NULL,
-    NULL,
-    NULL
-  },
-  0,
-  0,
-  0,
-  0,
-
   {
     NULL,
     NULL,
@@ -227,7 +197,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA  mStdErr = {
   },
   (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL,
   0,
-  0,
 
   0,
   (TEXT_OUT_AND_GOP_DATA *)NULL,
@@ -422,7 +391,7 @@ ToggleStateSyncReInitialization (
   Installs driver module protocols and. Creates virtual device handles for ConIn,
   ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,
   Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
-  Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+  Installs Graphics Output protocol if need.
 
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.
   @param[in] SystemTable    A pointer to the EFI System Table.
@@ -493,14 +462,6 @@ ConSplitterDriverEntry (
              );
   ASSERT_EFI_ERROR (Status);
 
-  //
-  // Either Graphics Output protocol or UGA Draw protocol must be supported.
-  //
-  ASSERT (
-    FeaturePcdGet (PcdConOutGopSupport) ||
-    FeaturePcdGet (PcdConOutUgaSupport)
-    );
-
   //
   // The driver creates virtual handles for ConIn, ConOut, StdErr.
   // The virtual handles will always exist even if no console exist in the
@@ -757,13 +718,7 @@ ConSplitterTextOutConstructor (
   //
   // Copy protocols template
   //
-  if (FeaturePcdGet (PcdConOutUgaSupport)) {
-    CopyMem (&ConOutPrivate->UgaDraw, &mUgaDrawProtocolTemplate, sizeof (EFI_UGA_DRAW_PROTOCOL));
-  }
-
-  if (FeaturePcdGet (PcdConOutGopSupport)) {
-    CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));
-  }
+  CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));
 
   //
   // Initialize console output splitter's private data.
@@ -806,56 +761,47 @@ ConSplitterTextOutConstructor (
   ConOutPrivate->TextOutQueryData[0].Rows    = 25;
   TextOutSetMode (ConOutPrivate, 0);
 
-  if (FeaturePcdGet (PcdConOutUgaSupport)) {
-    //
-    // Setup the UgaDraw to 800 x 600 x 32 bits per pixel, 60Hz.
-    //
-    ConSplitterUgaDrawSetMode (&ConOutPrivate->UgaDraw, 800, 600, 32, 60);
+  //
+  // Setup resource for mode information in Graphics Output Protocol interface
+  //
+  if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) == NULL) {
+    return EFI_OUT_OF_RESOURCES;
   }
 
-  if (FeaturePcdGet (PcdConOutGopSupport)) {
-    //
-    // Setup resource for mode information in Graphics Output Protocol interface
-    //
-    if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) == NULL) {
-      return EFI_OUT_OF_RESOURCES;
-    }
-
-    if ((ConOutPrivate->GraphicsOutput.Mode->Info = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) {
-      return EFI_OUT_OF_RESOURCES;
-    }
+  if ((ConOutPrivate->GraphicsOutput.Mode->Info = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) {
+    return EFI_OUT_OF_RESOURCES;
+  }
 
-    //
-    // Setup the DevNullGraphicsOutput to 800 x 600 x 32 bits per pixel
-    // DevNull will be updated to user-defined mode after driver has started.
-    //
-    if ((ConOutPrivate->GraphicsOutputModeBuffer = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) {
-      return EFI_OUT_OF_RESOURCES;
-    }
+  //
+  // Setup the DevNullGraphicsOutput to 800 x 600 x 32 bits per pixel
+  // DevNull will be updated to user-defined mode after driver has started.
+  //
+  if ((ConOutPrivate->GraphicsOutputModeBuffer = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) {
+    return EFI_OUT_OF_RESOURCES;
+  }
 
-    Info                       = &ConOutPrivate->GraphicsOutputModeBuffer[0];
-    Info->Version              = 0;
-    Info->HorizontalResolution = 800;
-    Info->VerticalResolution   = 600;
-    Info->PixelFormat          = PixelBltOnly;
-    Info->PixelsPerScanLine    = 800;
-    CopyMem (ConOutPrivate->GraphicsOutput.Mode->Info, Info, sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-    ConOutPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
+  Info                       = &ConOutPrivate->GraphicsOutputModeBuffer[0];
+  Info->Version              = 0;
+  Info->HorizontalResolution = 800;
+  Info->VerticalResolution   = 600;
+  Info->PixelFormat          = PixelBltOnly;
+  Info->PixelsPerScanLine    = 800;
+  CopyMem (ConOutPrivate->GraphicsOutput.Mode->Info, Info, sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
+  ConOutPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
 
-    //
-    // Initialize the following items, theset items remain unchanged in GraphicsOutput->SetMode()
-    // GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBufferSize
-    //
-    ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS)(UINTN)NULL;
-    ConOutPrivate->GraphicsOutput.Mode->FrameBufferSize = 0;
+  //
+  // Initialize the following items, theset items remain unchanged in GraphicsOutput->SetMode()
+  // GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBufferSize
+  //
+  ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS)(UINTN)NULL;
+  ConOutPrivate->GraphicsOutput.Mode->FrameBufferSize = 0;
 
-    ConOutPrivate->GraphicsOutput.Mode->MaxMode = 1;
-    //
-    // Initial current mode to unknown state, and then set to mode 0
-    //
-    ConOutPrivate->GraphicsOutput.Mode->Mode = 0xffff;
-    ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0);
-  }
+  ConOutPrivate->GraphicsOutput.Mode->MaxMode = 1;
+  //
+  // Initial current mode to unknown state, and then set to mode 0
+  //
+  ConOutPrivate->GraphicsOutput.Mode->Mode = 0xffff;
+  ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0);
 
   return EFI_SUCCESS;
 }
@@ -1332,12 +1278,9 @@ ConSplitterConOutDriverBindingStart (
   IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath
   )
 {
-  EFI_STATUS                            Status;
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL       *TextOut;
-  EFI_GRAPHICS_OUTPUT_PROTOCOL          *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL                 *UgaDraw;
-  UINTN                                 SizeOfInfo;
-  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *Info;
+  EFI_STATUS                       Status;
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut;
+  EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput;
 
   //
   // Start ConSplitter on ControllerHandle, and create the virtual
@@ -1356,7 +1299,6 @@ ConSplitterConOutDriverBindingStart (
   }
 
   GraphicsOutput = NULL;
-  UgaDraw        = NULL;
   //
   // Try to Open Graphics Output protocol
   //
@@ -1369,20 +1311,6 @@ ConSplitterConOutDriverBindingStart (
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL
                   );
 
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-    //
-    // Open UGA DRAW protocol
-    //
-    gBS->OpenProtocol (
-           ControllerHandle,
-           &gEfiUgaDrawProtocolGuid,
-           (VOID **)&UgaDraw,
-           This->DriverBindingHandle,
-           mConOut.VirtualHandle,
-           EFI_OPEN_PROTOCOL_GET_PROTOCOL
-           );
-  }
-
   //
   // When new console device is added, the new mode will be set later,
   // so put current mode back to init state.
@@ -1393,38 +1321,9 @@ ConSplitterConOutDriverBindingStart (
   // If both ConOut and StdErr incorporate the same Text Out device,
   // their MaxMode and QueryData should be the intersection of both.
   //
-  Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput, UgaDraw);
+  Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput);
   ConSplitterTextOutSetAttribute (&mConOut.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
 
-  if (FeaturePcdGet (PcdConOutUgaSupport)) {
-    //
-    // Get the UGA mode data of ConOut from the current mode
-    //
-    if (GraphicsOutput != NULL) {
-      Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
-      if (EFI_ERROR (Status)) {
-        return Status;
-      }
-
-      ASSERT (SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-
-      mConOut.UgaHorizontalResolution = Info->HorizontalResolution;
-      mConOut.UgaVerticalResolution   = Info->VerticalResolution;
-      mConOut.UgaColorDepth           = 32;
-      mConOut.UgaRefreshRate          = 60;
-
-      FreePool (Info);
-    } else if (UgaDraw != NULL) {
-      Status = UgaDraw->GetMode (
-                          UgaDraw,
-                          &mConOut.UgaHorizontalResolution,
-                          &mConOut.UgaVerticalResolution,
-                          &mConOut.UgaColorDepth,
-                          &mConOut.UgaRefreshRate
-                          );
-    }
-  }
-
   return Status;
 }
 
@@ -1477,7 +1376,7 @@ ConSplitterStdErrDriverBindingStart (
   // If both ConOut and StdErr incorporate the same Text Out device,
   // their MaxMode and QueryData should be the intersection of both.
   //
-  Status = ConSplitterTextOutAddDevice (&mStdErr, TextOut, NULL, NULL);
+  Status = ConSplitterTextOutAddDevice (&mStdErr, TextOut, NULL);
   ConSplitterTextOutSetAttribute (&mStdErr.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
 
   return Status;
@@ -2737,7 +2636,6 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr (
 
   @param  Private               Text Out Splitter pointer.
   @param  GraphicsOutput        Graphics Output protocol pointer.
-  @param  UgaDraw               UGA Draw protocol pointer.
 
   @retval EFI_SUCCESS           Output mode added successfully.
   @retval other                 Failed to add output mode.
@@ -2746,8 +2644,7 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr (
 EFI_STATUS
 ConSplitterAddGraphicsOutputMode (
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL    *GraphicsOutput,
-  IN  EFI_UGA_DRAW_PROTOCOL           *UgaDraw
+  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL    *GraphicsOutput
   )
 {
   EFI_STATUS                            Status;
@@ -2762,12 +2659,8 @@ ConSplitterAddGraphicsOutputMode (
   UINTN                                 NumberIndex;
   BOOLEAN                               Match;
   BOOLEAN                               AlreadyExist;
-  UINT32                                UgaHorizontalResolution;
-  UINT32                                UgaVerticalResolution;
-  UINT32                                UgaColorDepth;
-  UINT32                                UgaRefreshRate;
 
-  ASSERT (GraphicsOutput != NULL || UgaDraw != NULL);
+  ASSERT (GraphicsOutput != NULL);
 
   CurrentGraphicsOutputMode = Private->GraphicsOutput.Mode;
 
@@ -2775,15 +2668,6 @@ ConSplitterAddGraphicsOutputMode (
   CurrentIndex = 0;
   Status       = EFI_SUCCESS;
 
-  if (Private->CurrentNumberOfUgaDraw != 0) {
-    //
-    // If any UGA device has already been added, then there is no need to
-    // calculate intersection of display mode of different GOP/UGA device,
-    // since only one display mode will be exported (i.e. user-defined mode)
-    //
-    goto Done;
-  }
-
   if (GraphicsOutput != NULL) {
     if (Private->CurrentNumberOfGraphicsOutput == 0) {
       //
@@ -2937,51 +2821,12 @@ ConSplitterAddGraphicsOutputMode (
         }
       }
     }
-  } else if (UgaDraw != NULL) {
-    //
-    // Graphics console driver can ensure the same mode for all GOP devices
-    // so we can get the current mode from this video device
-    //
-    UgaDraw->GetMode (
-               UgaDraw,
-               &UgaHorizontalResolution,
-               &UgaVerticalResolution,
-               &UgaColorDepth,
-               &UgaRefreshRate
-               );
-
-    CurrentGraphicsOutputMode->MaxMode         = 1;
-    Info                                       = CurrentGraphicsOutputMode->Info;
-    Info->Version                              = 0;
-    Info->HorizontalResolution                 = UgaHorizontalResolution;
-    Info->VerticalResolution                   = UgaVerticalResolution;
-    Info->PixelFormat                          = PixelBltOnly;
-    Info->PixelsPerScanLine                    = UgaHorizontalResolution;
-    CurrentGraphicsOutputMode->SizeOfInfo      = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
-    CurrentGraphicsOutputMode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS)(UINTN)NULL;
-    CurrentGraphicsOutputMode->FrameBufferSize = 0;
-
-    //
-    // Update the private mode buffer
-    //
-    CopyMem (&Private->GraphicsOutputModeBuffer[0], Info, sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-
-    //
-    // Only mode 0 is available to be set
-    //
-    CurrentIndex = 0;
   }
 
-Done:
-
   if (GraphicsOutput != NULL) {
     Private->CurrentNumberOfGraphicsOutput++;
   }
 
-  if (UgaDraw != NULL) {
-    Private->CurrentNumberOfUgaDraw++;
-  }
-
   //
   // Force GraphicsOutput mode to be set,
   //
@@ -3130,7 +2975,6 @@ ConsplitterSetConsoleOutMode (
   @param  Private                  Text Out Splitter pointer.
   @param  TextOut                  Simple Text Output protocol pointer.
   @param  GraphicsOutput           Graphics Output protocol pointer.
-  @param  UgaDraw                  UGA Draw protocol pointer.
 
   @retval EFI_SUCCESS              Text Output Device added successfully.
   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
@@ -3140,21 +2984,14 @@ EFI_STATUS
 ConSplitterTextOutAddDevice (
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA   *Private,
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut,
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput,
-  IN  EFI_UGA_DRAW_PROTOCOL            *UgaDraw
+  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput
   )
 {
-  EFI_STATUS                            Status;
-  UINTN                                 CurrentNumOfConsoles;
-  INT32                                 MaxMode;
-  UINT32                                UgaHorizontalResolution;
-  UINT32                                UgaVerticalResolution;
-  UINT32                                UgaColorDepth;
-  UINT32                                UgaRefreshRate;
-  TEXT_OUT_AND_GOP_DATA                 *TextAndGop;
-  UINTN                                 SizeOfInfo;
-  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *Info;
-  EFI_STATUS                            DeviceStatus;
+  EFI_STATUS             Status;
+  UINTN                  CurrentNumOfConsoles;
+  INT32                  MaxMode;
+  TEXT_OUT_AND_GOP_DATA  *TextAndGop;
+  EFI_STATUS             DeviceStatus;
 
   Status                      = EFI_SUCCESS;
   CurrentNumOfConsoles        = Private->CurrentNumberOfConsoles;
@@ -3186,7 +3023,6 @@ ConSplitterTextOutAddDevice (
 
   TextAndGop->TextOut        = TextOut;
   TextAndGop->GraphicsOutput = GraphicsOutput;
-  TextAndGop->UgaDraw        = UgaDraw;
 
   if (CurrentNumOfConsoles == 0) {
     //
@@ -3215,101 +3051,21 @@ ConSplitterTextOutAddDevice (
   //
   // This device display mode will be added into Graphics Ouput modes.
   //
-  if ((GraphicsOutput != NULL) || (UgaDraw != NULL)) {
-    DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);
+  if (GraphicsOutput != NULL) {
+    DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput);
   }
 
-  if (FeaturePcdGet (PcdConOutUgaSupport)) {
+  if (!EFI_ERROR (DeviceStatus)) {
     //
-    // If UGA is produced by Consplitter
+    // Graphics Output Protocol is installed
+    // on virtual handle.
     //
-    if (GraphicsOutput != NULL) {
-      Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
-      if (EFI_ERROR (Status)) {
-        return Status;
-      }
-
-      ASSERT (SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-
-      UgaHorizontalResolution = Info->HorizontalResolution;
-      UgaVerticalResolution   = Info->VerticalResolution;
-
-      FreePool (Info);
-    } else if (UgaDraw != NULL) {
-      Status = UgaDraw->GetMode (
-                          UgaDraw,
-                          &UgaHorizontalResolution,
-                          &UgaVerticalResolution,
-                          &UgaColorDepth,
-                          &UgaRefreshRate
-                          );
-      if (!EFI_ERROR (Status) && EFI_ERROR (DeviceStatus)) {
-        //
-        // if GetMode is successfully and UGA device hasn't been set, set it
-        //
-        Status = ConSplitterUgaDrawSetMode (
-                   &Private->UgaDraw,
-                   UgaHorizontalResolution,
-                   UgaVerticalResolution,
-                   UgaColorDepth,
-                   UgaRefreshRate
-                   );
-      }
-
-      //
-      // If GetMode/SetMode is failed, set to 800x600 mode
-      //
-      if (EFI_ERROR (Status)) {
-        Status = ConSplitterUgaDrawSetMode (
-                   &Private->UgaDraw,
-                   800,
-                   600,
-                   32,
-                   60
-                   );
-      }
-    }
-  }
-
-  if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) &&
-      ((Private->CurrentNumberOfGraphicsOutput + Private->CurrentNumberOfUgaDraw) == 1))
-  {
-    if (!FeaturePcdGet (PcdConOutGopSupport)) {
-      //
-      // If Graphics Outpurt protocol not supported, UGA Draw protocol is installed
-      // on the virtual handle.
-      //
-      Status = gBS->InstallMultipleProtocolInterfaces (
-                      &mConOut.VirtualHandle,
-                      &gEfiUgaDrawProtocolGuid,
-                      &mConOut.UgaDraw,
-                      NULL
-                      );
-    } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {
-      //
-      // If UGA Draw protocol not supported, Graphics Output Protocol is installed
-      // on virtual handle.
-      //
-      Status = gBS->InstallMultipleProtocolInterfaces (
-                      &mConOut.VirtualHandle,
-                      &gEfiGraphicsOutputProtocolGuid,
-                      &mConOut.GraphicsOutput,
-                      NULL
-                      );
-    } else {
-      //
-      // Boot Graphics Output protocol and UGA Draw protocol are supported,
-      // both they will be installed on virtual handle.
-      //
-      Status = gBS->InstallMultipleProtocolInterfaces (
-                      &mConOut.VirtualHandle,
-                      &gEfiGraphicsOutputProtocolGuid,
-                      &mConOut.GraphicsOutput,
-                      &gEfiUgaDrawProtocolGuid,
-                      &mConOut.UgaDraw,
-                      NULL
-                      );
-    }
+    Status = gBS->InstallMultipleProtocolInterfaces (
+                    &mConOut.VirtualHandle,
+                    &gEfiGraphicsOutputProtocolGuid,
+                    &mConOut.GraphicsOutput,
+                    NULL
+                    );
   }
 
   //
@@ -3353,10 +3109,6 @@ ConSplitterTextOutDeleteDevice (
   TextOutList          = Private->TextOutList;
   while (Index >= 0) {
     if (TextOutList->TextOut == TextOut) {
-      if (TextOutList->UgaDraw != NULL) {
-        Private->CurrentNumberOfUgaDraw--;
-      }
-
       if (TextOutList->GraphicsOutput != NULL) {
         Private->CurrentNumberOfGraphicsOutput--;
       }
@@ -3377,33 +3129,16 @@ ConSplitterTextOutDeleteDevice (
     return EFI_NOT_FOUND;
   }
 
-  if ((Private->CurrentNumberOfGraphicsOutput == 0) && (Private->CurrentNumberOfUgaDraw == 0)) {
+  if (Private->CurrentNumberOfGraphicsOutput == 0) {
     //
-    // If there is not any physical GOP and UGA device in system,
-    // Consplitter GOP or UGA protocol will be uninstalled
+    // If there is not any physical GOP in system,
+    // Consplitter GOP protocol will be uninstalled
     //
-    if (!FeaturePcdGet (PcdConOutGopSupport)) {
-      Status = gBS->UninstallProtocolInterface (
-                      Private->VirtualHandle,
-                      &gEfiUgaDrawProtocolGuid,
-                      &Private->UgaDraw
-                      );
-    } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {
-      Status = gBS->UninstallProtocolInterface (
-                      Private->VirtualHandle,
-                      &gEfiGraphicsOutputProtocolGuid,
-                      &Private->GraphicsOutput
-                      );
-    } else {
-      Status = gBS->UninstallMultipleProtocolInterfaces (
-                      Private->VirtualHandle,
-                      &gEfiUgaDrawProtocolGuid,
-                      &Private->UgaDraw,
-                      &gEfiGraphicsOutputProtocolGuid,
-                      &Private->GraphicsOutput,
-                      NULL
-                      );
-    }
+    Status = gBS->UninstallProtocolInterface (
+                    Private->VirtualHandle,
+                    &gEfiGraphicsOutputProtocolGuid,
+                    &Private->GraphicsOutput
+                    );
   }
 
   if (CurrentNumOfConsoles == 0) {
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
index a1fe74726058..15e4e913638e 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
@@ -1,7 +1,7 @@
 /** @file
   Private data structures for the Console Splitter driver
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -21,7 +21,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Protocol/SimpleTextIn.h>
 #include <Protocol/SimpleTextInEx.h>
 #include <Protocol/GraphicsOutput.h>
-#include <Protocol/UgaDraw.h>
 
 #include <Guid/ConsoleInDevice.h>
 #include <Guid/StandardErrorDevice.h>
@@ -182,7 +181,6 @@ typedef struct {
 
 typedef struct {
   EFI_GRAPHICS_OUTPUT_PROTOCOL       *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL              *UgaDraw;
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *TextOut;
 } TEXT_OUT_AND_GOP_DATA;
 
@@ -195,16 +193,9 @@ typedef struct {
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL         TextOut;
   EFI_SIMPLE_TEXT_OUTPUT_MODE             TextOutMode;
 
-  EFI_UGA_DRAW_PROTOCOL                   UgaDraw;
-  UINT32                                  UgaHorizontalResolution;
-  UINT32                                  UgaVerticalResolution;
-  UINT32                                  UgaColorDepth;
-  UINT32                                  UgaRefreshRate;
-
   EFI_GRAPHICS_OUTPUT_PROTOCOL            GraphicsOutput;
   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION    *GraphicsOutputModeBuffer;
   UINTN                                   CurrentNumberOfGraphicsOutput;
-  UINTN                                   CurrentNumberOfUgaDraw;
 
   UINTN                                   CurrentNumberOfConsoles;
   TEXT_OUT_AND_GOP_DATA                   *TextOutList;
@@ -230,13 +221,6 @@ typedef struct {
       TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE              \
       )
 
-#define UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
-  CR ((a),                                          \
-      TEXT_OUT_SPLITTER_PRIVATE_DATA,               \
-      UgaDraw,                                      \
-      TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE      \
-      )
-
 #define CONSOLE_CONTROL_SPLITTER_PRIVATE_DATA_FROM_THIS(a)  \
   CR ((a),                                                  \
       TEXT_OUT_SPLITTER_PRIVATE_DATA,                       \
@@ -254,7 +238,7 @@ typedef struct {
   Installs driver module protocols and. Creates virtual device handles for ConIn,
   ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,
   Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
-  Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+  Installs Graphics Output protocol if needed.
 
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.
   @param[in] SystemTable    A pointer to the EFI System Table.
@@ -1202,7 +1186,6 @@ ConSplitterSimplePointerDeleteDevice (
   @param  Private                  Text Out Splitter pointer.
   @param  TextOut                  Simple Text Output protocol pointer.
   @param  GraphicsOutput           Graphics Output protocol pointer.
-  @param  UgaDraw                  UGA Draw protocol pointer.
 
   @retval EFI_SUCCESS              Text Output Device added successfully.
   @retval EFI_OUT_OF_RESOURCES     Could not grow the buffer size.
@@ -1212,8 +1195,7 @@ EFI_STATUS
 ConSplitterTextOutAddDevice (
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA   *Private,
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut,
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput,
-  IN  EFI_UGA_DRAW_PROTOCOL            *UgaDraw
+  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput
   );
 
 /**
@@ -1848,119 +1830,7 @@ ConSplitterGraphicsOutputBlt (
   IN  UINTN                              DestinationY,
   IN  UINTN                              Width,
   IN  UINTN                              Height,
-  IN  UINTN                              Delta         OPTIONAL
-  );
-
-/**
-  Return the current video mode information.
-
-  @param  This                  The EFI_UGA_DRAW_PROTOCOL instance.
-  @param  HorizontalResolution  The size of video screen in pixels in the X dimension.
-  @param  VerticalResolution    The size of video screen in pixels in the Y dimension.
-  @param  ColorDepth            Number of bits per pixel, currently defined to be 32.
-  @param  RefreshRate           The refresh rate of the monitor in Hertz.
-
-  @retval EFI_SUCCESS           Mode information returned.
-  @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()
-  @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawGetMode (
-  IN  EFI_UGA_DRAW_PROTOCOL  *This,
-  OUT UINT32                 *HorizontalResolution,
-  OUT UINT32                 *VerticalResolution,
-  OUT UINT32                 *ColorDepth,
-  OUT UINT32                 *RefreshRate
-  );
-
-/**
-  Set the current video mode information.
-
-  @param  This                 The EFI_UGA_DRAW_PROTOCOL instance.
-  @param  HorizontalResolution The size of video screen in pixels in the X dimension.
-  @param  VerticalResolution   The size of video screen in pixels in the Y dimension.
-  @param  ColorDepth           Number of bits per pixel, currently defined to be 32.
-  @param  RefreshRate          The refresh rate of the monitor in Hertz.
-
-  @retval EFI_SUCCESS          Mode information returned.
-  @retval EFI_NOT_STARTED      Video display is not initialized. Call SetMode ()
-  @retval EFI_OUT_OF_RESOURCES Out of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawSetMode (
-  IN  EFI_UGA_DRAW_PROTOCOL  *This,
-  IN UINT32                  HorizontalResolution,
-  IN UINT32                  VerticalResolution,
-  IN UINT32                  ColorDepth,
-  IN UINT32                  RefreshRate
-  );
-
-/**
-  Blt a rectangle of pixels on the graphics screen.
-
-  The following table defines actions for BltOperations.
-
-  EfiUgaVideoFill:
-    Write data from the  BltBuffer pixel (SourceX, SourceY)
-    directly to every pixel of the video display rectangle
-    (DestinationX, DestinationY)
-    (DestinationX + Width, DestinationY + Height).
-    Only one pixel will be used from the BltBuffer. Delta is NOT used.
-  EfiUgaVideoToBltBuffer:
-    Read data from the video display rectangle
-    (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
-    the BltBuffer rectangle (DestinationX, DestinationY )
-    (DestinationX + Width, DestinationY + Height). If DestinationX or
-    DestinationY is not zero then Delta must be set to the length in bytes
-    of a row in the BltBuffer.
-  EfiUgaBltBufferToVideo:
-    Write data from the  BltBuffer rectangle
-    (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
-    video display rectangle (DestinationX, DestinationY)
-    (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
-    not zero then Delta must be set to the length in bytes of a row in the
-    BltBuffer.
-  EfiUgaVideoToVideo:
-    Copy from the video display rectangle
-    (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
-    to the video display rectangle (DestinationX, DestinationY)
-    (DestinationX + Width, DestinationY + Height).
-    The BltBuffer and Delta  are not used in this mode.
-
-  @param  This           Protocol instance pointer.
-  @param  BltBuffer      Buffer containing data to blit into video buffer. This
-                         buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
-  @param  BltOperation   Operation to perform on BlitBuffer and video memory
-  @param  SourceX        X coordinate of source for the BltBuffer.
-  @param  SourceY        Y coordinate of source for the BltBuffer.
-  @param  DestinationX   X coordinate of destination for the BltBuffer.
-  @param  DestinationY   Y coordinate of destination for the BltBuffer.
-  @param  Width          Width of rectangle in BltBuffer in pixels.
-  @param  Height         Hight of rectangle in BltBuffer in pixels.
-  @param  Delta          OPTIONAL
-
-  @retval EFI_SUCCESS            The Blt operation completed.
-  @retval EFI_INVALID_PARAMETER  BltOperation is not valid.
-  @retval EFI_DEVICE_ERROR       A hardware error occurred writting to the video buffer.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawBlt (
-  IN  EFI_UGA_DRAW_PROTOCOL  *This,
-  IN  EFI_UGA_PIXEL          *BltBuffer  OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION  BltOperation,
-  IN  UINTN                  SourceX,
-  IN  UINTN                  SourceY,
-  IN  UINTN                  DestinationX,
-  IN  UINTN                  DestinationY,
-  IN  UINTN                  Width,
-  IN  UINTN                  Height,
-  IN  UINTN                  Delta         OPTIONAL
+  IN  UINTN                              Delta       OPTIONAL
   );
 
 /**
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
index 9aa1dade752a..7e3df4b013e9 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
@@ -3,14 +3,9 @@
 #
 # This driver acts as a virtual console, takes over the console I/O control from selected
 # standard console devices, and transmits console I/O to related console device drivers.
-# Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system
-# table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always
-# consumes Graphics Output protocol which is produced by display device, and consumes UGA Draw
-# protocol which is produced by display device according to PcdUgaConsumeSupport value.
-# Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be
-# set to TRUE.
+# It always consumes Graphics Output protocol which is produced by display device
 #
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -92,14 +87,6 @@
   ## SOMETIMES_PRODUCES
   ## SOMETIMES_CONSUMES
   gEfiGraphicsOutputProtocolGuid
-  ## SOMETIMES_PRODUCES
-  ## SOMETIMES_CONSUMES
-  gEfiUgaDrawProtocolGuid
-
-[FeaturePcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport   ## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport   ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport        ## CONSUMES
 
 [Pcd]
   ## SOMETIMES_PRODUCES
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
index 13c25b2a4ffc..902ffd5fc2ec 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
@@ -3,14 +3,9 @@
 //
 // This driver acts as a virtual console, takes over the console I/O control from selected
 // standard console devices, and transmits console I/O to related console device drivers.
-// Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system
-// table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always
-// consumes Graphics Output protocol which is produced by display device, and consumes UGA Draw
-// protocol which is produced by display device according to PcdUgaConsumeSupport value.
-// Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be
-// set to TRUE.
+// It always consumes Graphics Output protocol which is produced by display device
 //
-// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 //
 // SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -19,5 +14,4 @@
 
 #string STR_MODULE_ABSTRACT             #language en-US "Provides multi console support"
 
-#string STR_MODULE_DESCRIPTION          #language en-US "This driver acts as a virtual console, takes over the console I/O control from selected standard console devices, and transmits console I/O to related console device drivers. Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always consumes Graphics Output protocol, which is produced by display device, and consumes UGA Draw protocol, which is produced by display device according to PcdUgaConsumeSupport value. Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be set to TRUE."
-
+#string STR_MODULE_DESCRIPTION          #language en-US "This driver acts as a virtual console, takes over the console I/O control from selected standard console devices, and transmits console I/O to related console device drivers. It always consumes Graphics Output protocol, which is produced by display device."
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
index 64ad567a6d7d..09469b621741 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
@@ -1,7 +1,7 @@
 /** @file
   Support for Graphics output spliter.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 
@@ -117,7 +117,6 @@ ConSplitterGraphicsOutputSetMode (
   UINTN                                 NumberIndex;
   UINTN                                 SizeOfInfo;
   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *Info;
-  EFI_UGA_DRAW_PROTOCOL                 *UgaDraw;
 
   if (ModeNumber >= This->Mode->MaxMode) {
     return EFI_UNSUPPORTED;
@@ -157,20 +156,6 @@ ConSplitterGraphicsOutputSetMode (
       if (EFI_ERROR (Status)) {
         ReturnStatus = Status;
       }
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      UgaDraw = Private->TextOutList[Index].UgaDraw;
-      if (UgaDraw != NULL) {
-        Status = UgaDraw->SetMode (
-                            UgaDraw,
-                            Mode->HorizontalResolution,
-                            Mode->VerticalResolution,
-                            32,
-                            60
-                            );
-        if (EFI_ERROR (Status)) {
-          ReturnStatus = Status;
-        }
-      }
     }
   }
 
@@ -261,7 +246,6 @@ ConSplitterGraphicsOutputBlt (
   TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;
   UINTN                           Index;
   EFI_GRAPHICS_OUTPUT_PROTOCOL    *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL           *UgaDraw;
 
   if ((This == NULL) || (((UINTN)BltOperation) >= EfiGraphicsOutputBltOperationMax)) {
     return EFI_INVALID_PARAMETER;
@@ -298,298 +282,6 @@ ConSplitterGraphicsOutputBlt (
         return EFI_SUCCESS;
       }
     }
-
-    UgaDraw = Private->TextOutList[Index].UgaDraw;
-    if ((UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-      Status = UgaDraw->Blt (
-                          UgaDraw,
-                          (EFI_UGA_PIXEL *)BltBuffer,
-                          (EFI_UGA_BLT_OPERATION)BltOperation,
-                          SourceX,
-                          SourceY,
-                          DestinationX,
-                          DestinationY,
-                          Width,
-                          Height,
-                          Delta
-                          );
-      if (EFI_ERROR (Status)) {
-        ReturnStatus = Status;
-      } else if (BltOperation == EfiBltVideoToBltBuffer) {
-        //
-        // Only need to read the data into buffer one time
-        //
-        return EFI_SUCCESS;
-      }
-    }
-  }
-
-  return ReturnStatus;
-}
-
-/**
-  Return the current video mode information.
-
-  @param  This                  The EFI_UGA_DRAW_PROTOCOL instance.
-  @param  HorizontalResolution  The size of video screen in pixels in the X dimension.
-  @param  VerticalResolution    The size of video screen in pixels in the Y dimension.
-  @param  ColorDepth            Number of bits per pixel, currently defined to be 32.
-  @param  RefreshRate           The refresh rate of the monitor in Hertz.
-
-  @retval EFI_SUCCESS           Mode information returned.
-  @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()
-  @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawGetMode (
-  IN  EFI_UGA_DRAW_PROTOCOL  *This,
-  OUT UINT32                 *HorizontalResolution,
-  OUT UINT32                 *VerticalResolution,
-  OUT UINT32                 *ColorDepth,
-  OUT UINT32                 *RefreshRate
-  )
-{
-  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;
-
-  if ((HorizontalResolution == NULL) ||
-      (VerticalResolution   == NULL) ||
-      (RefreshRate          == NULL) ||
-      (ColorDepth           == NULL))
-  {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  //
-  // retrieve private data
-  //
-  Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
-
-  *HorizontalResolution = Private->UgaHorizontalResolution;
-  *VerticalResolution   = Private->UgaVerticalResolution;
-  *ColorDepth           = Private->UgaColorDepth;
-  *RefreshRate          = Private->UgaRefreshRate;
-
-  return EFI_SUCCESS;
-}
-
-/**
-  Set the current video mode information.
-
-  @param  This                 The EFI_UGA_DRAW_PROTOCOL instance.
-  @param  HorizontalResolution The size of video screen in pixels in the X dimension.
-  @param  VerticalResolution   The size of video screen in pixels in the Y dimension.
-  @param  ColorDepth           Number of bits per pixel, currently defined to be 32.
-  @param  RefreshRate          The refresh rate of the monitor in Hertz.
-
-  @retval EFI_SUCCESS          Mode information returned.
-  @retval EFI_NOT_STARTED      Video display is not initialized. Call SetMode ()
-  @retval EFI_OUT_OF_RESOURCES Out of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawSetMode (
-  IN  EFI_UGA_DRAW_PROTOCOL  *This,
-  IN UINT32                  HorizontalResolution,
-  IN UINT32                  VerticalResolution,
-  IN UINT32                  ColorDepth,
-  IN UINT32                  RefreshRate
-  )
-{
-  EFI_STATUS                            Status;
-  TEXT_OUT_SPLITTER_PRIVATE_DATA        *Private;
-  UINTN                                 Index;
-  EFI_STATUS                            ReturnStatus;
-  EFI_GRAPHICS_OUTPUT_PROTOCOL          *GraphicsOutput;
-  UINTN                                 NumberIndex;
-  UINTN                                 SizeOfInfo;
-  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *Info;
-  EFI_UGA_DRAW_PROTOCOL                 *UgaDraw;
-
-  Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
-
-  ReturnStatus = EFI_SUCCESS;
-
-  //
-  // Update the Mode data
-  //
-  Private->UgaHorizontalResolution = HorizontalResolution;
-  Private->UgaVerticalResolution   = VerticalResolution;
-  Private->UgaColorDepth           = ColorDepth;
-  Private->UgaRefreshRate          = RefreshRate;
-
-  //
-  // return the worst status met
-  //
-  for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
-    GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
-    if (GraphicsOutput != NULL) {
-      //
-      // Find corresponding ModeNumber of this GraphicsOutput instance
-      //
-      for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex++) {
-        Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32)NumberIndex, &SizeOfInfo, &Info);
-        if (EFI_ERROR (Status)) {
-          return Status;
-        }
-
-        if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) {
-          FreePool (Info);
-          break;
-        }
-
-        FreePool (Info);
-      }
-
-      Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32)NumberIndex);
-      if (EFI_ERROR (Status)) {
-        ReturnStatus = Status;
-      }
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      UgaDraw = Private->TextOutList[Index].UgaDraw;
-      if (UgaDraw != NULL) {
-        Status = UgaDraw->SetMode (
-                            UgaDraw,
-                            HorizontalResolution,
-                            VerticalResolution,
-                            ColorDepth,
-                            RefreshRate
-                            );
-        if (EFI_ERROR (Status)) {
-          ReturnStatus = Status;
-        }
-      }
-    }
-  }
-
-  return ReturnStatus;
-}
-
-/**
-  Blt a rectangle of pixels on the graphics screen.
-
-  The following table defines actions for BltOperations.
-
-  EfiUgaVideoFill:
-    Write data from the  BltBuffer pixel (SourceX, SourceY)
-    directly to every pixel of the video display rectangle
-    (DestinationX, DestinationY)
-    (DestinationX + Width, DestinationY + Height).
-    Only one pixel will be used from the BltBuffer. Delta is NOT used.
-  EfiUgaVideoToBltBuffer:
-    Read data from the video display rectangle
-    (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
-    the BltBuffer rectangle (DestinationX, DestinationY )
-    (DestinationX + Width, DestinationY + Height). If DestinationX or
-    DestinationY is not zero then Delta must be set to the length in bytes
-    of a row in the BltBuffer.
-  EfiUgaBltBufferToVideo:
-    Write data from the  BltBuffer rectangle
-    (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
-    video display rectangle (DestinationX, DestinationY)
-    (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
-    not zero then Delta must be set to the length in bytes of a row in the
-    BltBuffer.
-  EfiUgaVideoToVideo:
-    Copy from the video display rectangle
-    (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
-    to the video display rectangle (DestinationX, DestinationY)
-    (DestinationX + Width, DestinationY + Height).
-    The BltBuffer and Delta  are not used in this mode.
-
-  @param  This           Protocol instance pointer.
-  @param  BltBuffer      Buffer containing data to blit into video buffer. This
-                         buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
-  @param  BltOperation   Operation to perform on BlitBuffer and video memory
-  @param  SourceX        X coordinate of source for the BltBuffer.
-  @param  SourceY        Y coordinate of source for the BltBuffer.
-  @param  DestinationX   X coordinate of destination for the BltBuffer.
-  @param  DestinationY   Y coordinate of destination for the BltBuffer.
-  @param  Width          Width of rectangle in BltBuffer in pixels.
-  @param  Height         Hight of rectangle in BltBuffer in pixels.
-  @param  Delta          OPTIONAL
-
-  @retval EFI_SUCCESS            The Blt operation completed.
-  @retval EFI_INVALID_PARAMETER  BltOperation is not valid.
-  @retval EFI_DEVICE_ERROR       A hardware error occurred writting to the video buffer.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawBlt (
-  IN  EFI_UGA_DRAW_PROTOCOL  *This,
-  IN  EFI_UGA_PIXEL          *BltBuffer  OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION  BltOperation,
-  IN  UINTN                  SourceX,
-  IN  UINTN                  SourceY,
-  IN  UINTN                  DestinationX,
-  IN  UINTN                  DestinationY,
-  IN  UINTN                  Width,
-  IN  UINTN                  Height,
-  IN  UINTN                  Delta         OPTIONAL
-  )
-{
-  EFI_STATUS                      Status;
-  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private;
-  UINTN                           Index;
-  EFI_STATUS                      ReturnStatus;
-  EFI_GRAPHICS_OUTPUT_PROTOCOL    *GraphicsOutput;
-
-  Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
-
-  ReturnStatus = EFI_SUCCESS;
-  //
-  // return the worst status met
-  //
-  for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
-    GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
-    if (GraphicsOutput != NULL) {
-      Status = GraphicsOutput->Blt (
-                                 GraphicsOutput,
-                                 (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)BltBuffer,
-                                 (EFI_GRAPHICS_OUTPUT_BLT_OPERATION)BltOperation,
-                                 SourceX,
-                                 SourceY,
-                                 DestinationX,
-                                 DestinationY,
-                                 Width,
-                                 Height,
-                                 Delta
-                                 );
-      if (EFI_ERROR (Status)) {
-        ReturnStatus = Status;
-      } else if (BltOperation == EfiUgaVideoToBltBuffer) {
-        //
-        // Only need to read the data into buffer one time
-        //
-        return EFI_SUCCESS;
-      }
-    }
-
-    if ((Private->TextOutList[Index].UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-      Status = Private->TextOutList[Index].UgaDraw->Blt (
-                                                      Private->TextOutList[Index].UgaDraw,
-                                                      BltBuffer,
-                                                      BltOperation,
-                                                      SourceX,
-                                                      SourceY,
-                                                      DestinationX,
-                                                      DestinationY,
-                                                      Width,
-                                                      Height,
-                                                      Delta
-                                                      );
-      if (EFI_ERROR (Status)) {
-        ReturnStatus = Status;
-      } else if (BltOperation == EfiUgaVideoToBltBuffer) {
-        //
-        // Only need to read the data into buffer one time
-        //
-        return EFI_SUCCESS;
-      }
-    }
   }
 
   return ReturnStatus;
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 08/11] MdeModulePkg/GraphicsConsoleDxe: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (6 preceding siblings ...)
  2022-07-15  1:51 ` [Patch v2 07/11] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
@ 2022-07-15  1:51 ` Guomin Jiang
  2022-07-15  1:51 ` [Patch v2 09/11] MdeModulePkg: " Guomin Jiang
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:51 UTC (permalink / raw)
  To: devel
  Cc: GuoMinJ, Jian J Wang, Liming Gao, Zhichao Gao, Ray Ni, Dandan Bi,
	Eric Dong

From: GuoMinJ <newexplorerj@gmail.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove All UGA Support in GraphicsConsoleDxe, remove comment about UGA
in HiiDatabaseDxe.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
---
 .../GraphicsConsoleDxe/GraphicsConsole.c      | 300 +-----------------
 .../GraphicsConsoleDxe/GraphicsConsole.h      |  21 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf |   8 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.uni |   6 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/Image.c |   4 +-
 5 files changed, 23 insertions(+), 316 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index b895dafedeaa..facb813276cd 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -14,7 +14,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 GRAPHICS_CONSOLE_DEV  mGraphicsConsoleDevTemplate = {
   GRAPHICS_CONSOLE_DEV_SIGNATURE,
   (EFI_GRAPHICS_OUTPUT_PROTOCOL *)NULL,
-  (EFI_UGA_DRAW_PROTOCOL *)NULL,
   {
     GraphicsConsoleConOutReset,
     GraphicsConsoleConOutOutputString,
@@ -104,9 +103,8 @@ EFI_DRIVER_BINDING_PROTOCOL  gGraphicsConsoleDriverBinding = {
 /**
   Test to see if Graphics Console could be supported on the Controller.
 
-  Graphics Console could be supported if Graphics Output Protocol or UGA Draw
-  Protocol exists on the Controller. (UGA Draw Protocol could be skipped
-  if PcdUgaConsumeSupport is set to FALSE.)
+  Graphics Console could be supported if Graphics Output Protocol
+  exists on the Controller.
 
   @param  This                Protocol instance pointer.
   @param  Controller          Handle of device to test.
@@ -127,11 +125,9 @@ GraphicsConsoleControllerDriverSupported (
 {
   EFI_STATUS                    Status;
   EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL         *UgaDraw;
   EFI_DEVICE_PATH_PROTOCOL      *DevicePath;
 
   GraphicsOutput = NULL;
-  UgaDraw        = NULL;
   //
   // Open the IO Abstraction(s) needed to perform the supported test
   //
@@ -143,21 +139,6 @@ GraphicsConsoleControllerDriverSupported (
                   Controller,
                   EFI_OPEN_PROTOCOL_BY_DRIVER
                   );
-
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-    //
-    // Open Graphics Output Protocol failed, try to open UGA Draw Protocol
-    //
-    Status = gBS->OpenProtocol (
-                    Controller,
-                    &gEfiUgaDrawProtocolGuid,
-                    (VOID **)&UgaDraw,
-                    This->DriverBindingHandle,
-                    Controller,
-                    EFI_OPEN_PROTOCOL_BY_DRIVER
-                    );
-  }
-
   if (EFI_ERROR (Status)) {
     return Status;
   }
@@ -202,13 +183,6 @@ Error:
            This->DriverBindingHandle,
            Controller
            );
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    gBS->CloseProtocol (
-           Controller,
-           &gEfiUgaDrawProtocolGuid,
-           This->DriverBindingHandle,
-           Controller
-           );
   }
 
   return Status;
@@ -369,9 +343,8 @@ InitializeGraphicsConsoleTextMode (
 }
 
 /**
-  Start this driver on Controller by opening Graphics Output protocol or
-  UGA Draw protocol, and installing Simple Text Out protocol on Controller.
-  (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
+  Start this driver on Controller by opening Graphics Output protocol
+  and installing Simple Text Out protocol on Controller.
 
   @param  This                 Protocol instance pointer.
   @param  Controller           Handle of device to bind driver to
@@ -394,8 +367,6 @@ GraphicsConsoleControllerDriverStart (
   GRAPHICS_CONSOLE_DEV                  *Private;
   UINT32                                HorizontalResolution;
   UINT32                                VerticalResolution;
-  UINT32                                ColorDepth;
-  UINT32                                RefreshRate;
   UINT32                                ModeIndex;
   UINTN                                 MaxMode;
   UINT32                                ModeNumber;
@@ -432,18 +403,6 @@ GraphicsConsoleControllerDriverStart (
                   Controller,
                   EFI_OPEN_PROTOCOL_BY_DRIVER
                   );
-
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-    Status = gBS->OpenProtocol (
-                    Controller,
-                    &gEfiUgaDrawProtocolGuid,
-                    (VOID **)&Private->UgaDraw,
-                    This->DriverBindingHandle,
-                    Controller,
-                    EFI_OPEN_PROTOCOL_BY_DRIVER
-                    );
-  }
-
   if (EFI_ERROR (Status)) {
     goto Error;
   }
@@ -534,43 +493,6 @@ GraphicsConsoleControllerDriverStart (
         goto Error;
       }
     }
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    //
-    // At first try to set user-defined resolution
-    //
-    ColorDepth  = 32;
-    RefreshRate = 60;
-    Status      = Private->UgaDraw->SetMode (
-                                      Private->UgaDraw,
-                                      HorizontalResolution,
-                                      VerticalResolution,
-                                      ColorDepth,
-                                      RefreshRate
-                                      );
-    if (EFI_ERROR (Status)) {
-      //
-      // Try to set 800*600 which is required by UEFI/EFI spec
-      //
-      Status = Private->UgaDraw->SetMode (
-                                   Private->UgaDraw,
-                                   800,
-                                   600,
-                                   ColorDepth,
-                                   RefreshRate
-                                   );
-      if (EFI_ERROR (Status)) {
-        Status = Private->UgaDraw->GetMode (
-                                     Private->UgaDraw,
-                                     &HorizontalResolution,
-                                     &VerticalResolution,
-                                     &ColorDepth,
-                                     &RefreshRate
-                                     );
-        if (EFI_ERROR (Status)) {
-          goto Error;
-        }
-      }
-    }
   }
 
   DEBUG ((DEBUG_INFO, "GraphicsConsole video resolution %d x %d\n", HorizontalResolution, VerticalResolution));
@@ -638,7 +560,7 @@ GraphicsConsoleControllerDriverStart (
 Error:
   if (EFI_ERROR (Status)) {
     //
-    // Close the GOP and UGA Draw Protocol
+    // Close the GOP
     //
     if (Private->GraphicsOutput != NULL) {
       gBS->CloseProtocol (
@@ -647,13 +569,6 @@ Error:
              This->DriverBindingHandle,
              Controller
              );
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      gBS->CloseProtocol (
-             Controller,
-             &gEfiUgaDrawProtocolGuid,
-             This->DriverBindingHandle,
-             Controller
-             );
     }
 
     if (Private->LineBuffer != NULL) {
@@ -675,9 +590,7 @@ Error:
 
 /**
   Stop this driver on Controller by removing Simple Text Out protocol
-  and closing the Graphics Output Protocol or UGA Draw protocol on Controller.
-  (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
+  and closing the Graphics Output Protocol on Controller.
 
   @param  This              Protocol instance pointer.
   @param  Controller        Handle of device to stop driver on
@@ -726,7 +639,7 @@ GraphicsConsoleControllerDriverStop (
 
   if (!EFI_ERROR (Status)) {
     //
-    // Close the GOP or UGA IO Protocol
+    // Close the GOP Protocol
     //
     if (Private->GraphicsOutput != NULL) {
       gBS->CloseProtocol (
@@ -735,13 +648,6 @@ GraphicsConsoleControllerDriverStop (
              This->DriverBindingHandle,
              Controller
              );
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      gBS->CloseProtocol (
-             Controller,
-             &gEfiUgaDrawProtocolGuid,
-             This->DriverBindingHandle,
-             Controller
-             );
     }
 
     if (Private->LineBuffer != NULL) {
@@ -933,7 +839,6 @@ GraphicsConsoleConOutOutputString (
 {
   GRAPHICS_CONSOLE_DEV           *Private;
   EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL          *UgaDraw;
   INTN                           Mode;
   UINTN                          MaxColumn;
   UINTN                          MaxRow;
@@ -967,7 +872,6 @@ GraphicsConsoleConOutOutputString (
   Mode           = This->Mode->Mode;
   Private        = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
   GraphicsOutput = Private->GraphicsOutput;
-  UgaDraw        = Private->UgaDraw;
 
   MaxColumn = Private->ModeData[Mode].Columns;
   MaxRow    = Private->ModeData[Mode].Rows;
@@ -1055,38 +959,6 @@ GraphicsConsoleConOutOutputString (
                             EFI_GLYPH_HEIGHT,
                             Delta
                             );
-        } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-          //
-          // Scroll Screen Up One Row
-          //
-          UgaDraw->Blt (
-                     UgaDraw,
-                     NULL,
-                     EfiUgaVideoToVideo,
-                     DeltaX,
-                     DeltaY + EFI_GLYPH_HEIGHT,
-                     DeltaX,
-                     DeltaY,
-                     Width,
-                     Height,
-                     Delta
-                     );
-
-          //
-          // Print Blank Line at last line
-          //
-          UgaDraw->Blt (
-                     UgaDraw,
-                     (EFI_UGA_PIXEL *)(UINTN)&Background,
-                     EfiUgaVideoFill,
-                     0,
-                     0,
-                     DeltaX,
-                     DeltaY + Height,
-                     Width,
-                     EFI_GLYPH_HEIGHT,
-                     Delta
-                     );
         }
       } else {
         This->Mode->CursorRow++;
@@ -1320,19 +1192,13 @@ GraphicsConsoleConOutSetMode (
   GRAPHICS_CONSOLE_DEV           *Private;
   GRAPHICS_CONSOLE_MODE_DATA     *ModeData;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL  *NewLineBuffer;
-  UINT32                         HorizontalResolution;
-  UINT32                         VerticalResolution;
   EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL          *UgaDraw;
-  UINT32                         ColorDepth;
-  UINT32                         RefreshRate;
   EFI_TPL                        OldTpl;
 
   OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
 
   Private        = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
   GraphicsOutput = Private->GraphicsOutput;
-  UgaDraw        = Private->UgaDraw;
 
   //
   // Make sure the requested mode number is supported
@@ -1366,7 +1232,7 @@ GraphicsConsoleConOutSetMode (
     }
 
     //
-    // Otherwise, the size of the text console and/or the GOP/UGA mode will be changed,
+    // Otherwise, the size of the text console and/or the GOP mode will be changed,
     // so erase the cursor, and free the LineBuffer for the current mode
     //
     FlushCursor (This);
@@ -1422,51 +1288,6 @@ GraphicsConsoleConOutSetMode (
                                  0
                                  );
     }
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    //
-    // Get the current UGA Draw mode information
-    //
-    Status = UgaDraw->GetMode (
-                        UgaDraw,
-                        &HorizontalResolution,
-                        &VerticalResolution,
-                        &ColorDepth,
-                        &RefreshRate
-                        );
-    if (EFI_ERROR (Status) || (HorizontalResolution != ModeData->GopWidth) || (VerticalResolution != ModeData->GopHeight)) {
-      //
-      // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode
-      //
-      Status = UgaDraw->SetMode (
-                          UgaDraw,
-                          ModeData->GopWidth,
-                          ModeData->GopHeight,
-                          32,
-                          60
-                          );
-      if (EFI_ERROR (Status)) {
-        //
-        // The mode set operation failed
-        //
-        goto Done;
-      }
-    } else {
-      //
-      // The current graphics mode is correct, so simply clear the entire display
-      //
-      Status = UgaDraw->Blt (
-                          UgaDraw,
-                          (EFI_UGA_PIXEL *)(UINTN)&mGraphicsEfiColors[0],
-                          EfiUgaVideoFill,
-                          0,
-                          0,
-                          0,
-                          0,
-                          ModeData->GopWidth,
-                          ModeData->GopHeight,
-                          0
-                          );
-    }
   }
 
   //
@@ -1558,7 +1379,6 @@ GraphicsConsoleConOutClearScreen (
   GRAPHICS_CONSOLE_DEV           *Private;
   GRAPHICS_CONSOLE_MODE_DATA     *ModeData;
   EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL          *UgaDraw;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Foreground;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Background;
   EFI_TPL                        OldTpl;
@@ -1574,7 +1394,6 @@ GraphicsConsoleConOutClearScreen (
 
   Private        = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
   GraphicsOutput = Private->GraphicsOutput;
-  UgaDraw        = Private->UgaDraw;
   ModeData       = &(Private->ModeData[This->Mode->Mode]);
 
   GetTextColors (This, &Foreground, &Background);
@@ -1591,19 +1410,6 @@ GraphicsConsoleConOutClearScreen (
                                ModeData->GopHeight,
                                0
                                );
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    Status = UgaDraw->Blt (
-                        UgaDraw,
-                        (EFI_UGA_PIXEL *)(UINTN)&Background,
-                        EfiUgaVideoFill,
-                        0,
-                        0,
-                        0,
-                        0,
-                        ModeData->GopWidth,
-                        ModeData->GopHeight,
-                        0
-                        );
   } else {
     Status = EFI_UNSUPPORTED;
   }
@@ -1764,7 +1570,7 @@ GetTextColors (
   @param  Count                 The count of Unicode string.
 
   @retval EFI_OUT_OF_RESOURCES  If no memory resource to use.
-  @retval EFI_UNSUPPORTED       If no Graphics Output protocol and UGA Draw
+  @retval EFI_UNSUPPORTED       If no Graphics Output protocol
                                 protocol exist.
   @retval EFI_SUCCESS           Drawing Unicode string implemented successfully.
 
@@ -1781,9 +1587,6 @@ DrawUnicodeWeightAtCursorN (
   EFI_IMAGE_OUTPUT       *Blt;
   EFI_STRING             String;
   EFI_FONT_DISPLAY_INFO  *FontInfo;
-  EFI_UGA_DRAW_PROTOCOL  *UgaDraw;
-  EFI_HII_ROW_INFO       *RowInfoArray;
-  UINTN                  RowInfoArraySize;
 
   Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
   Blt     = (EFI_IMAGE_OUTPUT *)AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
@@ -1835,63 +1638,6 @@ DrawUnicodeWeightAtCursorN (
                          NULL,
                          NULL
                          );
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    //
-    // If Graphics Output protocol cannot be found and PcdUgaConsumeSupport enabled,
-    // using UGA Draw protocol to draw.
-    //
-    ASSERT (Private->UgaDraw != NULL);
-
-    UgaDraw = Private->UgaDraw;
-
-    Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-    if (Blt->Image.Bitmap == NULL) {
-      FreePool (Blt);
-      FreePool (String);
-      return EFI_OUT_OF_RESOURCES;
-    }
-
-    RowInfoArray = NULL;
-    //
-    //  StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
-    //  we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
-    //
-    Status = mHiiFont->StringToImage (
-                         mHiiFont,
-                         EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_IGNORE_LINE_BREAK,
-                         String,
-                         FontInfo,
-                         &Blt,
-                         This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
-                         This->Mode->CursorRow * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
-                         &RowInfoArray,
-                         &RowInfoArraySize,
-                         NULL
-                         );
-
-    if (!EFI_ERROR (Status)) {
-      //
-      // Line breaks are handled by caller of DrawUnicodeWeightAtCursorN, so the updated parameter RowInfoArraySize by StringToImage will
-      // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
-      //
-      ASSERT (RowInfoArraySize <= 1);
-
-      Status = UgaDraw->Blt (
-                          UgaDraw,
-                          (EFI_UGA_PIXEL *)Blt->Image.Bitmap,
-                          EfiUgaBltBufferToVideo,
-                          This->Mode->CursorColumn * EFI_GLYPH_WIDTH  + Private->ModeData[This->Mode->Mode].DeltaX,
-                          (This->Mode->CursorRow) * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
-                          This->Mode->CursorColumn * EFI_GLYPH_WIDTH  + Private->ModeData[This->Mode->Mode].DeltaX,
-                          (This->Mode->CursorRow) * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
-                          RowInfoArray[0].LineWidth,
-                          RowInfoArray[0].LineHeight,
-                          Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-                          );
-    }
-
-    FreePool (RowInfoArray);
-    FreePool (Blt->Image.Bitmap);
   } else {
     Status = EFI_UNSUPPORTED;
   }
@@ -1934,7 +1680,6 @@ FlushCursor (
   INTN                                 GlyphX;
   INTN                                 GlyphY;
   EFI_GRAPHICS_OUTPUT_PROTOCOL         *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL                *UgaDraw;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION  Foreground;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION  Background;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION  BltChar[EFI_GLYPH_HEIGHT][EFI_GLYPH_WIDTH];
@@ -1949,7 +1694,6 @@ FlushCursor (
 
   Private        = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
   GraphicsOutput = Private->GraphicsOutput;
-  UgaDraw        = Private->UgaDraw;
 
   //
   // In this driver, only narrow character was supported.
@@ -1972,19 +1716,6 @@ FlushCursor (
                       EFI_GLYPH_HEIGHT,
                       EFI_GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
                       );
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    UgaDraw->Blt (
-               UgaDraw,
-               (EFI_UGA_PIXEL *)(UINTN)BltChar,
-               EfiUgaVideoToBltBuffer,
-               GlyphX,
-               GlyphY,
-               0,
-               0,
-               EFI_GLYPH_WIDTH,
-               EFI_GLYPH_HEIGHT,
-               EFI_GLYPH_WIDTH * sizeof (EFI_UGA_PIXEL)
-               );
   }
 
   GetTextColors (This, &Foreground.Pixel, &Background.Pixel);
@@ -2013,19 +1744,6 @@ FlushCursor (
                       EFI_GLYPH_HEIGHT,
                       EFI_GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
                       );
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    UgaDraw->Blt (
-               UgaDraw,
-               (EFI_UGA_PIXEL *)(UINTN)BltChar,
-               EfiUgaBltBufferToVideo,
-               0,
-               0,
-               GlyphX,
-               GlyphY,
-               EFI_GLYPH_WIDTH,
-               EFI_GLYPH_HEIGHT,
-               EFI_GLYPH_WIDTH * sizeof (EFI_UGA_PIXEL)
-               );
   }
 
   return EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
index e4abad40f49a..83f4c58df508 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
@@ -1,7 +1,7 @@
 /** @file
   Header file for GraphicsConsole driver.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -12,7 +12,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Uefi.h>
 #include <Protocol/SimpleTextOut.h>
 #include <Protocol/GraphicsOutput.h>
-#include <Protocol/UgaDraw.h>
 #include <Protocol/DevicePath.h>
 #include <Library/DebugLib.h>
 #include <Library/UefiDriverEntryPoint.h>
@@ -59,7 +58,6 @@ typedef struct {
 typedef struct {
   UINTN                              Signature;
   EFI_GRAPHICS_OUTPUT_PROTOCOL       *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL              *UgaDraw;
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    SimpleTextOutput;
   EFI_SIMPLE_TEXT_OUTPUT_MODE        SimpleTextOutputMode;
   GRAPHICS_CONSOLE_MODE_DATA         *ModeData;
@@ -417,9 +415,8 @@ GraphicsConsoleConOutEnableCursor (
 /**
   Test to see if Graphics Console could be supported on the Controller.
 
-  Graphics Console could be supported if Graphics Output Protocol or UGADraw
-  Protocol exists on the Controller. (UGA Draw Protocol could be skipped
-  if PcdUgaConsumeSupport is set to FALSE.)
+  Graphics Console could be supported if Graphics Output Protocol
+  exists on the Controller.
 
   @param  This                Protocol instance pointer.
   @param  Controller          Handle of device to test.
@@ -439,9 +436,8 @@ GraphicsConsoleControllerDriverSupported (
   );
 
 /**
-  Start this driver on Controller by opening Graphics Output protocol or
-  UGA Draw protocol, and installing Simple Text Out protocol on Controller.
-  (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
+  Start this driver on Controller by opening Graphics Output protocol
+  and installing Simple Text Out protocol on Controller.
 
   @param  This                 Protocol instance pointer.
   @param  Controller           Handle of device to bind driver to
@@ -462,9 +458,7 @@ GraphicsConsoleControllerDriverStart (
 
 /**
   Stop this driver on Controller by removing Simple Text Out protocol
-  and closing the Graphics Output Protocol or UGA Draw protocol on Controller.
-  (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
+  and closing the Graphics Output Protocol on Controller.
 
   @param  This              Protocol instance pointer.
   @param  Controller        Handle of device to stop driver on
@@ -526,8 +520,7 @@ GetTextColors (
   @param  Count                 The count of Unicode string.
 
   @retval EFI_OUT_OF_RESOURCES  If no memory resource to use.
-  @retval EFI_UNSUPPORTED       If no Graphics Output protocol and UGA Draw
-                                protocol exist.
+  @retval EFI_UNSUPPORTED       If no Graphics Output protocol exist.
   @retval EFI_SUCCESS           Drawing Unicode string implemented successfully.
 
 **/
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
index bcfd306eee13..85cd91f293f0 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
@@ -2,9 +2,9 @@
 #  Console support on graphic devices.
 #
 #  This driver will install Simple Text Output protocol by consuming Graphices Output
-#  protocol or UGA Draw protocol on graphic devices.
+#  protocol on graphic devices.
 #
-#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 #
@@ -53,15 +53,11 @@
   gEfiDevicePathProtocolGuid                    ## TO_START
   gEfiSimpleTextOutProtocolGuid                 ## BY_START
   gEfiGraphicsOutputProtocolGuid                ## TO_START
-  gEfiUgaDrawProtocolGuid                       ## TO_START
   gEfiHiiFontProtocolGuid                       ## TO_START
   ## TO_START
   ## NOTIFY
   gEfiHiiDatabaseProtocolGuid
 
-[FeaturePcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
-
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## SOMETIMES_CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution   ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
index aec5d57f9038..7336d5e6e5d5 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
@@ -2,9 +2,9 @@
 // Console support on graphic devices.
 //
 // This driver will install Simple Text Output protocol by consuming Graphices Output
-// protocol or UGA Draw protocol on graphic devices.
+// protocol on graphic devices.
 //
-// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 //
 // SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -14,5 +14,5 @@
 #string STR_MODULE_ABSTRACT             #language en-US "Console support on graphic devices"
 
 #string STR_MODULE_DESCRIPTION          #language en-US "This driver will install SimpleTextOutputProtocol by consuming GraphicesOutput\n"
-                                                        "Protocol or UgaDrawProtocol on graphics devices."
+                                                        "Protocol on graphics devices."
 
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
index b5b962596968..50c1a5b74d74 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
@@ -2,7 +2,7 @@
 Implementation for EFI_HII_IMAGE_PROTOCOL.
 
 
-Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -1401,7 +1401,7 @@ HiiDrawImage (
     //
     if ((Flags & EFI_HII_DIRECT_TO_SCREEN) == EFI_HII_DIRECT_TO_SCREEN) {
       //
-      // Caller should make sure the current UGA console is grarphic mode.
+      // Caller should make sure the current console is grarphic mode.
       //
 
       //
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 09/11] MdeModulePkg: Remove All UGA Support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (7 preceding siblings ...)
  2022-07-15  1:51 ` [Patch v2 08/11] MdeModulePkg/GraphicsConsoleDxe: " Guomin Jiang
@ 2022-07-15  1:51 ` Guomin Jiang
  2022-07-15  1:51 ` [Patch v2 10/11] BaseTools: Remove all UGA support Guomin Jiang
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:51 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jian J Wang, Liming Gao, Zhichao Gao, Ray Ni, Hao A Wu

From: GuoMinJ <newexplorerj@gmail.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove All UGA Support in MdeModulePkg, first remove from library.
Remove the PcdConOutGopSupport definition.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c       |   4 +-
 MdeModulePkg/Include/Library/BootLogoLib.h    |   4 +-
 .../Library/BootLogoLib/BootLogoLib.c         | 228 +++++-------------
 .../Library/BootLogoLib/BootLogoLib.inf       |   6 +-
 4 files changed, 61 insertions(+), 181 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
index 337b2090d98e..50ce9a9eaff2 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
@@ -8,7 +8,7 @@
   PCI Root Bridges. So it means platform needs install PCI Root Bridge IO protocol for each
   PCI Root Bus and install PCI Host Bridge Resource Allocation Protocol.
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -49,7 +49,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PCI_HOTPLUG_REQUEST_PROTOCOL  mPciHotPlugReque
   Installs driver module protocols and. Creates virtual device handles for ConIn,
   ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,
   Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
-  Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+  Installs Graphics Output protocol if needed.
 
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.
   @param[in] SystemTable    A pointer to the EFI System Table.
diff --git a/MdeModulePkg/Include/Library/BootLogoLib.h b/MdeModulePkg/Include/Library/BootLogoLib.h
index 2d6209a2789b..854d5b636713 100644
--- a/MdeModulePkg/Include/Library/BootLogoLib.h
+++ b/MdeModulePkg/Include/Library/BootLogoLib.h
@@ -2,7 +2,7 @@
   This library is only intended to be used by PlatformBootManagerLib
   to show progress bar and LOGO.
 
-Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -26,7 +26,7 @@ BootLogoEnableLogo (
   Use SystemTable ConOut to turn on video based Simple Text Out consoles. The
   Simple Text Out screens will now be synced up with all non-video output devices.
 
-  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.
+  @retval EFI_SUCCESS     Graphic device are back in text mode and synced up.
 
 **/
 EFI_STATUS
diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
index 478ec2d40e2b..4a823912e014 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -2,7 +2,7 @@
   This library is only intended to be used by PlatformBootManagerLib
   to show progress bar and LOGO.
 
-Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
 Copyright (c) 2016, Microsoft Corporation<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -12,7 +12,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Protocol/GraphicsOutput.h>
 #include <Protocol/SimpleTextOut.h>
 #include <Protocol/PlatformLogo.h>
-#include <Protocol/UgaDraw.h>
 #include <Protocol/BootLogo.h>
 #include <Protocol/BootLogo2.h>
 #include <Library/BaseLib.h>
@@ -47,9 +46,6 @@ BootLogoEnableLogo (
   UINT32                                 Instance;
   EFI_IMAGE_INPUT                        Image;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL          *Blt;
-  EFI_UGA_DRAW_PROTOCOL                  *UgaDraw;
-  UINT32                                 ColorDepth;
-  UINT32                                 RefreshRate;
   EFI_GRAPHICS_OUTPUT_PROTOCOL           *GraphicsOutput;
   EFI_BOOT_LOGO_PROTOCOL                 *BootLogo;
   EDKII_BOOT_LOGO2_PROTOCOL              *BootLogo2;
@@ -68,21 +64,10 @@ BootLogoEnableLogo (
     return EFI_UNSUPPORTED;
   }
 
-  UgaDraw = NULL;
   //
   // Try to open GOP first
   //
   Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-    GraphicsOutput = NULL;
-    //
-    // Open GOP failed, try to open UGA
-    //
-    Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **)&UgaDraw);
-    if (EFI_ERROR (Status)) {
-      UgaDraw = NULL;
-    }
-  }
 
   if (EFI_ERROR (Status)) {
     return EFI_UNSUPPORTED;
@@ -109,16 +94,8 @@ BootLogoEnableLogo (
   //
   gST->ConOut->EnableCursor (gST->ConOut, FALSE);
 
-  if (GraphicsOutput != NULL) {
-    SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
-    SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
-  } else {
-    ASSERT (UgaDraw != NULL);
-    Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);
-    if (EFI_ERROR (Status)) {
-      return EFI_UNSUPPORTED;
-    }
-  }
+  SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
+  SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
 
   Blt           = NULL;
   NumberOfLogos = 0;
@@ -206,34 +183,18 @@ BootLogoEnableLogo (
     DestY += OffsetY;
 
     if ((DestX >= 0) && (DestY >= 0)) {
-      if (GraphicsOutput != NULL) {
-        Status = GraphicsOutput->Blt (
-                                   GraphicsOutput,
-                                   Blt,
-                                   EfiBltBufferToVideo,
-                                   0,
-                                   0,
-                                   (UINTN)DestX,
-                                   (UINTN)DestY,
-                                   Image.Width,
-                                   Image.Height,
-                                   Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-                                   );
-      } else {
-        ASSERT (UgaDraw != NULL);
-        Status = UgaDraw->Blt (
-                            UgaDraw,
-                            (EFI_UGA_PIXEL *)Blt,
-                            EfiUgaBltBufferToVideo,
-                            0,
-                            0,
-                            (UINTN)DestX,
-                            (UINTN)DestY,
-                            Image.Width,
-                            Image.Height,
-                            Image.Width * sizeof (EFI_UGA_PIXEL)
-                            );
-      }
+      Status = GraphicsOutput->Blt (
+                                 GraphicsOutput,
+                                 Blt,
+                                 EfiBltBufferToVideo,
+                                 0,
+                                 0,
+                                 (UINTN)DestX,
+                                 (UINTN)DestY,
+                                 Image.Width,
+                                 Image.Height,
+                                 Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+                                 );
 
       //
       // Report displayed Logo information.
@@ -307,33 +268,18 @@ BootLogoEnableLogo (
       return EFI_OUT_OF_RESOURCES;
     }
 
-    if (GraphicsOutput != NULL) {
-      Status = GraphicsOutput->Blt (
-                                 GraphicsOutput,
-                                 LogoBlt,
-                                 EfiBltVideoToBltBuffer,
-                                 LogoDestX,
-                                 LogoDestY,
-                                 0,
-                                 0,
-                                 LogoWidth,
-                                 LogoHeight,
-                                 LogoWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-                                 );
-    } else {
-      Status = UgaDraw->Blt (
-                          UgaDraw,
-                          (EFI_UGA_PIXEL *)LogoBlt,
-                          EfiUgaVideoToBltBuffer,
-                          LogoDestX,
-                          LogoDestY,
-                          0,
-                          0,
-                          LogoWidth,
-                          LogoHeight,
-                          LogoWidth * sizeof (EFI_UGA_PIXEL)
-                          );
-    }
+    Status = GraphicsOutput->Blt (
+                               GraphicsOutput,
+                               LogoBlt,
+                               EfiBltVideoToBltBuffer,
+                               LogoDestX,
+                               LogoDestY,
+                               0,
+                               0,
+                               LogoWidth,
+                               LogoHeight,
+                               LogoWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+                               );
   }
 
   if (!EFI_ERROR (Status)) {
@@ -368,7 +314,7 @@ BootLogoEnableLogo (
   Use SystemTable Conout to turn on video based Simple Text Out consoles. The
   Simple Text Out screens will now be synced up with all non video output devices
 
-  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.
+  @retval EFI_SUCCESS     Graphic devices are back in text mode and synced up.
 
 **/
 EFI_STATUS
@@ -411,11 +357,8 @@ BootLogoUpdateProgress (
 {
   EFI_STATUS                     Status;
   EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL          *UgaDraw;
   UINT32                         SizeOfX;
   UINT32                         SizeOfY;
-  UINT32                         ColorDepth;
-  UINT32                         RefreshRate;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Color;
   UINTN                          BlockHeight;
   UINTN                          BlockWidth;
@@ -428,40 +371,14 @@ BootLogoUpdateProgress (
     return EFI_INVALID_PARAMETER;
   }
 
-  UgaDraw = NULL;
-  Status  = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-    GraphicsOutput = NULL;
-
-    Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **)&UgaDraw);
-    if (EFI_ERROR (Status)) {
-      UgaDraw = NULL;
-    }
-  }
+  Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
 
   if (EFI_ERROR (Status)) {
     return EFI_UNSUPPORTED;
   }
 
-  SizeOfX = 0;
-  SizeOfY = 0;
-  if (GraphicsOutput != NULL) {
-    SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
-    SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
-  } else if (UgaDraw != NULL) {
-    Status = UgaDraw->GetMode (
-                        UgaDraw,
-                        &SizeOfX,
-                        &SizeOfY,
-                        &ColorDepth,
-                        &RefreshRate
-                        );
-    if (EFI_ERROR (Status)) {
-      return EFI_UNSUPPORTED;
-    }
-  } else {
-    return EFI_UNSUPPORTED;
-  }
+  SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
+  SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
 
   BlockWidth  = SizeOfX / 100;
   BlockHeight = SizeOfY / 50;
@@ -477,35 +394,18 @@ BootLogoUpdateProgress (
     //
     SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
 
-    if (GraphicsOutput != NULL) {
-      Status = GraphicsOutput->Blt (
-                                 GraphicsOutput,
-                                 &Color,
-                                 EfiBltVideoFill,
-                                 0,
-                                 0,
-                                 0,
-                                 PosY - EFI_GLYPH_HEIGHT - 1,
-                                 SizeOfX,
-                                 SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
-                                 SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-                                 );
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      Status = UgaDraw->Blt (
-                          UgaDraw,
-                          (EFI_UGA_PIXEL *)&Color,
-                          EfiUgaVideoFill,
-                          0,
-                          0,
-                          0,
-                          PosY - EFI_GLYPH_HEIGHT - 1,
-                          SizeOfX,
-                          SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
-                          SizeOfX * sizeof (EFI_UGA_PIXEL)
-                          );
-    } else {
-      return EFI_UNSUPPORTED;
-    }
+    Status = GraphicsOutput->Blt (
+                               GraphicsOutput,
+                               &Color,
+                               EfiBltVideoFill,
+                               0,
+                               0,
+                               0,
+                               PosY - EFI_GLYPH_HEIGHT - 1,
+                               SizeOfX,
+                               SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
+                               SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+                               );
   }
 
   //
@@ -513,35 +413,19 @@ BootLogoUpdateProgress (
   //
   for (Index = PreviousValue; Index < BlockNum; Index++) {
     PosX = Index * BlockWidth;
-    if (GraphicsOutput != NULL) {
-      Status = GraphicsOutput->Blt (
-                                 GraphicsOutput,
-                                 &ProgressColor,
-                                 EfiBltVideoFill,
-                                 0,
-                                 0,
-                                 PosX,
-                                 PosY,
-                                 BlockWidth - 1,
-                                 BlockHeight,
-                                 (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-                                 );
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      Status = UgaDraw->Blt (
-                          UgaDraw,
-                          (EFI_UGA_PIXEL *)&ProgressColor,
-                          EfiUgaVideoFill,
-                          0,
-                          0,
-                          PosX,
-                          PosY,
-                          BlockWidth - 1,
-                          BlockHeight,
-                          (BlockWidth) * sizeof (EFI_UGA_PIXEL)
-                          );
-    } else {
-      return EFI_UNSUPPORTED;
-    }
+
+    Status = GraphicsOutput->Blt (
+                               GraphicsOutput,
+                               &ProgressColor,
+                               EfiBltVideoFill,
+                               0,
+                               0,
+                               PosX,
+                               PosY,
+                               BlockWidth - 1,
+                               BlockHeight,
+                               (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+                               );
   }
 
   PrintXY (
diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
index 7d50f2dfa3ab..f59e4e0705e7 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
@@ -2,7 +2,7 @@
 #  This library is only intended to be used by PlatformBootManagerLib
 #  to show progress bar and logo.
 #
-#  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2016, Microsoft Corporation<BR>
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -42,11 +42,7 @@
 
 [Protocols]
   gEfiGraphicsOutputProtocolGuid                ## SOMETIMES_CONSUMES
-  gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES
   gEfiBootLogoProtocolGuid                      ## SOMETIMES_CONSUMES
   gEdkiiBootLogo2ProtocolGuid                   ## SOMETIMES_CONSUMES
   gEfiUserManagerProtocolGuid                   ## CONSUMES
   gEdkiiPlatformLogoProtocolGuid                ## CONSUMES
-
-[FeaturePcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 10/11] BaseTools: Remove all UGA support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (8 preceding siblings ...)
  2022-07-15  1:51 ` [Patch v2 09/11] MdeModulePkg: " Guomin Jiang
@ 2022-07-15  1:51 ` Guomin Jiang
  2022-07-24  5:37   ` Bob Feng
  2022-07-15  1:51 ` [Patch v2 11/11] MdePkg/UefiLib: " Guomin Jiang
  2022-10-24 18:06 ` [edk2-devel] [Patch v2 00/11] " Michael D Kinney
  11 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:51 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove UGA code in BaseTools

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
---
 .../Source/C/Include/Protocol/HiiFramework.h  |  53 +-----
 BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 ------------------
 2 files changed, 1 insertion(+), 213 deletions(-)
 delete mode 100644 BaseTools/Source/C/Include/Protocol/UgaDraw.h

diff --git a/BaseTools/Source/C/Include/Protocol/HiiFramework.h b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
index 448350967bbf..4c651f89e0eb 100644
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
@@ -6,7 +6,7 @@
   @par Revision Reference:
   This protocol is defined in HII spec 0.92.
 
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -28,20 +28,6 @@
     0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
   }
 
-// BugBug:
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-// If UGA goes away we need to put this some place. I'm not sure where?
-//
-//typedef struct {
-//  UINT8 Blue;
-//  UINT8 Green;
-//  UINT8 Red;
-//  UINT8 Reserved;
-//} EFI_UGA_PIXEL;
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//
-
 typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;
 
 //
@@ -575,39 +561,6 @@ EFI_STATUS
   IN OUT UINT32            *InternalStatus
   );
 
-/**
-  Translates a glyph into the format required for input to the Universal
-  Graphics Adapter (UGA) Block Transfer (BLT) routines.
-
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.
-  @param  GlyphBuffer           A pointer to the buffer that contains glyph data.
-  @param  Foreground            The foreground setting requested to be used for the
-                                generated BltBuffer data.
-  @param  Background            The background setting requested to be used for the
-                                generated BltBuffer data.
-  @param  Count                 The entry in the BltBuffer upon which to act.
-  @param  Width                 The width in bits of the glyph being converted.
-  @param  Height                The height in bits of the glyph being converted
-  @param  BltBuffer             A pointer to the buffer that contains the data that is
-                                ready to be used by the UGA BLT routines.
-
-  @retval EFI_SUCCESS           It worked.
-  @retval EFI_NOT_FOUND         A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
-  IN     EFI_HII_PROTOCOL             *This,
-  IN     UINT8                        *GlyphBuffer,
-  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
-  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
-  IN     UINTN                         Count,
-  IN     UINTN                         Width,
-  IN     UINTN                         Height,
-  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
-  );
-
 /**
   Allows a new string to be added to an already existing string package.
 
@@ -878,9 +831,6 @@ EFI_STATUS
   @param GetGlyph
   Translates a Unicode character into the corresponding font glyph.
 
-  @param GlyphToBlt
-  Converts a glyph value into a format that is ready for a UGA BLT command.
-
   @param NewString
   Allows a new string to be added to an already existing string package.
 
@@ -924,7 +874,6 @@ struct _EFI_HII_PROTOCOL {
 
   EFI_HII_TEST_STRING         TestString;
   EFI_HII_GET_GLYPH           GetGlyph;
-  EFI_HII_GLYPH_TO_BLT        GlyphToBlt;
 
   EFI_HII_NEW_STRING          NewString;
   EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;
diff --git a/BaseTools/Source/C/Include/Protocol/UgaDraw.h b/BaseTools/Source/C/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 412b000aeb6b..000000000000
--- a/BaseTools/Source/C/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
-  UGA Draw protocol from the EFI 1.1 specification.
-
-  Abstraction of a very simple graphics device.
-
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
-  { \
-    0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
-  }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
-  Return the current video mode information.
-
-  @param  This                  Protocol instance pointer.
-  @param  HorizontalResolution  Current video horizontal resolution in pixels
-  @param  VerticalResolution    Current video vertical resolution in pixels
-  @param  ColorDepth            Current video color depth in bits per pixel
-  @param  RefreshRate           Current video refresh rate in Hz.
-
-  @retval EFI_SUCCESS           Mode information returned.
-  @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()
-  @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
-  IN  EFI_UGA_DRAW_PROTOCOL *This,
-  OUT UINT32                *HorizontalResolution,
-  OUT UINT32                *VerticalResolution,
-  OUT UINT32                *ColorDepth,
-  OUT UINT32                *RefreshRate
-  )
-;
-
-/**
-  Return the current video mode information.
-
-  @param  This                 Protocol instance pointer.
-  @param  HorizontalResolution Current video horizontal resolution in pixels
-  @param  VerticalResolution   Current video vertical resolution in pixels
-  @param  ColorDepth           Current video color depth in bits per pixel
-  @param  RefreshRate          Current video refresh rate in Hz.
-
-  @retval EFI_SUCCESS          Mode information returned.
-  @retval EFI_NOT_STARTED      Video display is not initialized. Call SetMode ()
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
-  IN  EFI_UGA_DRAW_PROTOCOL *This,
-  IN  UINT32                HorizontalResolution,
-  IN  UINT32                VerticalResolution,
-  IN  UINT32                ColorDepth,
-  IN  UINT32                RefreshRate
-  )
-;
-
-typedef struct {
-  UINT8 Blue;
-  UINT8 Green;
-  UINT8 Red;
-  UINT8 Reserved;
-} EFI_UGA_PIXEL;
-
-typedef union {
-  EFI_UGA_PIXEL Pixel;
-  UINT32        Raw;
-} EFI_UGA_PIXEL_UNION;
-
-typedef enum {
-  EfiUgaVideoFill,
-  EfiUgaVideoToBltBuffer,
-  EfiUgaBltBufferToVideo,
-  EfiUgaVideoToVideo,
-  EfiUgaBltMax
-} EFI_UGA_BLT_OPERATION;
-
-/**
-  Type specifying a pointer to a function to perform an UGA Blt operation.
-
-    The following table defines actions for BltOperations:
-
-    <B>EfiUgaVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY)
-      directly to every pixel of the video display rectangle
-      (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
-      Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
-    <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
-      the BltBuffer rectangle (DestinationX, DestinationY )
-      (DestinationX + Width, DestinationY + Height). If DestinationX or
-      DestinationY is not zero then Delta must be set to the length in bytes
-      of a row in the BltBuffer.
-
-    <B>EfiUgaBltBufferToVideo</B> - Write data from the  BltBuffer rectangle
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
-      video display rectangle (DestinationX, DestinationY)
-      (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
-      not zero then Delta must be set to the length in bytes of a row in the
-      BltBuffer.
-
-    <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
-     (SourceX + Width, SourceY + Height) .to the video display rectangle
-     (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
-     The BltBuffer and Delta  are not used in this mode.
-
-
-    @param[in] This          - Protocol instance pointer.
-    @param[in] BltBuffer     - Buffer containing data to blit into video buffer. This
-                               buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
-    @param[in] BltOperation  - Operation to perform on BlitBuffer and video memory
-    @param[in] SourceX       - X coordinate of source for the BltBuffer.
-    @param[in] SourceY       - Y coordinate of source for the BltBuffer.
-    @param[in] DestinationX  - X coordinate of destination for the BltBuffer.
-    @param[in] DestinationY  - Y coordinate of destination for the BltBuffer.
-    @param[in] Width         - Width of rectangle in BltBuffer in pixels.
-    @param[in] Height        - Height of rectangle in BltBuffer in pixels.
-    @param[in] Delta         - OPTIONAL
-
-    @retval EFI_SUCCESS           - The Blt operation completed.
-    @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
-    @retval EFI_DEVICE_ERROR      - A hardware error occurred writing to the video buffer.
-
---*/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
-  IN  EFI_UGA_DRAW_PROTOCOL                   * This,
-  IN  EFI_UGA_PIXEL                           * BltBuffer, OPTIONAL
-  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
-  IN  UINTN                                   SourceX,
-  IN  UINTN                                   SourceY,
-  IN  UINTN                                   DestinationX,
-  IN  UINTN                                   DestinationY,
-  IN  UINTN                                   Width,
-  IN  UINTN                                   Height,
-  IN  UINTN                                   Delta         OPTIONAL
-  );
-
-struct _EFI_UGA_DRAW_PROTOCOL {
-  EFI_UGA_DRAW_PROTOCOL_GET_MODE  GetMode;
-  EFI_UGA_DRAW_PROTOCOL_SET_MODE  SetMode;
-  EFI_UGA_DRAW_PROTOCOL_BLT       Blt;
-};
-
-extern EFI_GUID gEfiUgaDrawProtocolGuid;
-
-#endif
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Patch v2 11/11] MdePkg/UefiLib: Remove all UGA support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (9 preceding siblings ...)
  2022-07-15  1:51 ` [Patch v2 10/11] BaseTools: Remove all UGA support Guomin Jiang
@ 2022-07-15  1:51 ` Guomin Jiang
  2022-07-15 16:23   ` Michael D Kinney
  2022-10-24 18:06 ` [edk2-devel] [Patch v2 00/11] " Michael D Kinney
  11 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-15  1:51 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove all UGA code in MdePkg except the definition

The reason why keep definition is because downstream need it to pass
build.
It will be removed when all downstream remove UGA support

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
---
 MdePkg/Library/UefiLib/UefiLib.inf       |  4 +-
 MdePkg/Library/UefiLib/UefiLibInternal.h |  3 +-
 MdePkg/Library/UefiLib/UefiLibPrint.c    | 91 +-----------------------
 MdePkg/MdePkg.dsc                        |  3 -
 4 files changed, 3 insertions(+), 98 deletions(-)

diff --git a/MdePkg/Library/UefiLib/UefiLib.inf b/MdePkg/Library/UefiLib/UefiLib.inf
index 01ed92092da2..ac9d68907261 100644
--- a/MdePkg/Library/UefiLib/UefiLib.inf
+++ b/MdePkg/Library/UefiLib/UefiLib.inf
@@ -7,7 +7,7 @@
 #  EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
 #  and print messages on the console output and standard error devices.
 #
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -67,7 +67,6 @@
   gEfiGraphicsOutputProtocolGuid                  ## SOMETIMES_CONSUMES
   gEfiHiiFontProtocolGuid                         ## SOMETIMES_CONSUMES
   gEfiSimpleFileSystemProtocolGuid                ## SOMETIMES_CONSUMES
-  gEfiUgaDrawProtocolGuid | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport                 ## SOMETIMES_CONSUMES # Consumes if gEfiGraphicsOutputProtocolGuid uninstalled
   gEfiComponentNameProtocolGuid  | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable   ## SOMETIMES_PRODUCES # User chooses to produce it
   gEfiComponentName2ProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable  ## SOMETIMES_PRODUCES # User chooses to produce it
   gEfiDriverConfigurationProtocolGuid                            ## SOMETIMES_PRODUCES # User chooses to produce it
@@ -84,5 +83,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable        ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable   ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable       ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport           ## CONSUMES
 
diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/UefiLib/UefiLibInternal.h
index 4365282cf213..be5c9ddcdde8 100644
--- a/MdePkg/Library/UefiLib/UefiLibInternal.h
+++ b/MdePkg/Library/UefiLib/UefiLibInternal.h
@@ -1,7 +1,7 @@
 /** @file
   Internal include file for UefiLib.
 
-  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
    SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -18,7 +18,6 @@
 #include <Protocol/DriverDiagnostics2.h>
 #include <Protocol/LoadedImage.h>
 #include <Protocol/GraphicsOutput.h>
-#include <Protocol/UgaDraw.h>
 #include <Protocol/HiiFont.h>
 
 #include <Guid/EventGroup.h>
diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib/UefiLibPrint.c
index 39edeb7283dd..2451775aeb90 100644
--- a/MdePkg/Library/UefiLib/UefiLibPrint.c
+++ b/MdePkg/Library/UefiLib/UefiLibPrint.c
@@ -2,7 +2,7 @@
   Mde UEFI library API implementation.
   Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
 
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -344,20 +344,14 @@ InternalPrintGraphic (
   EFI_STATUS                       Status;
   UINT32                           HorizontalResolution;
   UINT32                           VerticalResolution;
-  UINT32                           ColorDepth;
-  UINT32                           RefreshRate;
   EFI_HII_FONT_PROTOCOL            *HiiFont;
   EFI_IMAGE_OUTPUT                 *Blt;
   EFI_FONT_DISPLAY_INFO            FontInfo;
   EFI_HII_ROW_INFO                 *RowInfoArray;
   UINTN                            RowInfoArraySize;
   EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL            *UgaDraw;
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Sto;
   EFI_HANDLE                       ConsoleHandle;
-  UINTN                            Width;
-  UINTN                            Height;
-  UINTN                            Delta;
 
   HorizontalResolution = 0;
   VerticalResolution   = 0;
@@ -374,20 +368,6 @@ InternalPrintGraphic (
                   (VOID **)&GraphicsOutput
                   );
 
-  UgaDraw = NULL;
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-    //
-    // If no GOP available, try to open UGA Draw protocol if supported.
-    //
-    GraphicsOutput = NULL;
-
-    Status = gBS->HandleProtocol (
-                    ConsoleHandle,
-                    &gEfiUgaDrawProtocolGuid,
-                    (VOID **)&UgaDraw
-                    );
-  }
-
   if (EFI_ERROR (Status)) {
     goto Error;
   }
@@ -405,8 +385,6 @@ InternalPrintGraphic (
   if (GraphicsOutput != NULL) {
     HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
     VerticalResolution   = GraphicsOutput->Mode->Info->VerticalResolution;
-  } else if ((UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-    UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);
   } else {
     goto Error;
   }
@@ -466,73 +444,6 @@ InternalPrintGraphic (
     if (EFI_ERROR (Status)) {
       goto Error;
     }
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    ASSERT (UgaDraw != NULL);
-
-    //
-    // Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow.
-    //
-    if (Blt->Width > DivU64x32 (MAX_UINTN, Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL))) {
-      goto Error;
-    }
-
-    Blt->Image.Bitmap = AllocateZeroPool ((UINT32)Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-    ASSERT (Blt->Image.Bitmap != NULL);
-
-    //
-    //  StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
-    //  we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
-    //
-    Status = HiiFont->StringToImage (
-                        HiiFont,
-                        EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_OUT_FLAG_CLIP |
-                        EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
-                        EFI_HII_IGNORE_LINE_BREAK,
-                        Buffer,
-                        &FontInfo,
-                        &Blt,
-                        PointX,
-                        PointY,
-                        &RowInfoArray,
-                        &RowInfoArraySize,
-                        NULL
-                        );
-
-    if (!EFI_ERROR (Status)) {
-      ASSERT (RowInfoArray != NULL);
-      //
-      // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will
-      // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
-      //
-      ASSERT (RowInfoArraySize <= 1);
-
-      if (RowInfoArraySize != 0) {
-        Width  = RowInfoArray[0].LineWidth;
-        Height = RowInfoArray[0].LineHeight;
-        Delta  = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
-      } else {
-        Width  = 0;
-        Height = 0;
-        Delta  = 0;
-      }
-
-      Status = UgaDraw->Blt (
-                          UgaDraw,
-                          (EFI_UGA_PIXEL *)Blt->Image.Bitmap,
-                          EfiUgaBltBufferToVideo,
-                          PointX,
-                          PointY,
-                          PointX,
-                          PointY,
-                          Width,
-                          Height,
-                          Delta
-                          );
-    } else {
-      goto Error;
-    }
-
-    FreePool (Blt->Image.Bitmap);
   } else {
     goto Error;
   }
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 3d8874e64782..e67d4716df21 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -23,9 +23,6 @@
 
 !include MdePkg/MdeLibs.dsc.inc
 
-[PcdsFeatureFlag]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE
-
 [PcdsFixedAtBuild]
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
-- 
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [Patch v2 05/11] ShellPkg: Remove All UGA Support
  2022-07-15  1:51 ` [Patch v2 05/11] ShellPkg: " Guomin Jiang
@ 2022-07-15  2:20   ` Ni, Ray
  0 siblings, 0 replies; 24+ messages in thread
From: Ni, Ray @ 2022-07-15  2:20 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: GuoMinJ, Gao, Zhichao

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Friday, July 15, 2022 9:51 AM
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Subject: [Patch v2 05/11] ShellPkg: Remove All UGA Support
> 
> From: GuoMinJ <newexplorerj@gmail.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove All UGA Support in ShellPkg.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> ---
>  ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c  | 4 +---
>  ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h  | 4 +---
>  .../Library/UefiHandleParsingLib/UefiHandleParsingLib.inf     | 4 +---
>  .../Library/UefiHandleParsingLib/UefiHandleParsingLib.uni     | 4 +---
>  4 files changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> index aa0115bdd498..08215ab8039c 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>    Provides interface to advanced shell functionality for parsing both handle and protocol database.
> 
> -  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
>    (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -2238,8 +2238,6 @@ STATIC CONST GUID_INFO_BLOCK  mGuidStringList[] = {
>    { STRING_TOKEN (STR_SHELL_ENV2),          &gEfiShellEnvironment2Guid,                        NULL                                             },
>    { STRING_TOKEN (STR_SHELL_ENV),           &gEfiShellEnvironment2Guid,                        NULL                                             },
>    { STRING_TOKEN (STR_DEVICE_IO),           &gEfiDeviceIoProtocolGuid,                         NULL                                             },
> -  { STRING_TOKEN (STR_UGA_DRAW),            &gEfiUgaDrawProtocolGuid,                          NULL                                             },
> -  { STRING_TOKEN (STR_UGA_IO),              &gEfiUgaIoProtocolGuid,                            NULL                                             },
>    { STRING_TOKEN (STR_ESP),                 &gEfiPartTypeSystemPartGuid,                       NULL                                             },
>    { STRING_TOKEN (STR_GPT_NBR),             &gEfiPartTypeLegacyMbrGuid,                        NULL                                             },
>    { STRING_TOKEN (STR_DRIVER_CONFIG),       &gEfiDriverConfigurationProtocolGuid,
> NULL                                             },
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> index 6be0d78c4c5a..b3433eda029b 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> @@ -1,7 +1,7 @@
>  /** @file
>    Provides interface to advanced shell functionality for parsing both handle and protocol database.
> 
> -  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>    (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -94,8 +94,6 @@
>  #include <Protocol/HiiConfigAccess.h>
>  #include <Protocol/FormBrowser2.h>
>  #include <Protocol/DeviceIo.h>
> -#include <Protocol/UgaDraw.h>
> -#include <Protocol/UgaIo.h>
>  #include <Protocol/DriverConfiguration.h>
>  #include <Protocol/DriverConfiguration2.h>
>  #include <Protocol/DevicePathUtilities.h>
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> index 0d483805e712..af16569b07bd 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> @@ -1,6 +1,6 @@
>  ##  @file
>  #  Provides interface to advanced shell functionality for parsing both handle and protocol database.
> -#  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
> +#  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved. <BR>
>  #  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
>  #  (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
>  #
> @@ -129,8 +129,6 @@
>    gEfiHiiConfigAccessProtocolGuid                         ## UNDEFINED
>    gEfiFormBrowser2ProtocolGuid                            ## UNDEFINED
>    gEfiDeviceIoProtocolGuid                                ## UNDEFINED
> -  gEfiUgaDrawProtocolGuid                                 ## UNDEFINED
> -  gEfiUgaIoProtocolGuid                                   ## UNDEFINED
>    gEfiDriverConfigurationProtocolGuid                     ## UNDEFINED
>    gEfiDriverConfiguration2ProtocolGuid                    ## UNDEFINED
>    gEfiSimpleTextInputExProtocolGuid                       ## UNDEFINED
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> index aa3396cea94d..04beea8e7f3e 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> @@ -1,6 +1,6 @@
>  // /**
>  //
> -// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>
> +// Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved. <BR>
>  // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
>  // (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
>  // SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -161,8 +161,6 @@
>  #string STR_SHELL_ALIAS           #language en-US "ShellAlias"
>  #string STR_DEVICE_IO             #language en-US "DeviceIO"
>  #string STR_TCP                   #language en-US "TCP"
> -#string STR_UGA_DRAW              #language en-US "UGADraw"
> -#string STR_UGA_IO                #language en-US "UGAIO"
>  #string STR_ESP                   #language en-US "EFISystemPartition"
>  #string STR_GPT_NBR               #language en-US "LegacyMBR"
>  #string STR_DRIVER_CONFIG         #language en-US "DriverConfiguration"
> --
> 2.26.2.windows.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support
  2022-07-15  1:50 ` [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support Guomin Jiang
@ 2022-07-15  2:21   ` Ni, Ray
  0 siblings, 0 replies; 24+ messages in thread
From: Ni, Ray @ 2022-07-15  2:21 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io
  Cc: GuoMinJ, Dong, Guo, Maurice Ma, You, Benjamin, Rhodes, Sean

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Friday, July 15, 2022 9:51 AM
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Maurice Ma
> <maurice.ma@intel.com>; You, Benjamin <benjamin.you@intel.com>; Rhodes, Sean <sean@starlabs.systems>
> Subject: [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support
> 
> From: GuoMinJ <newexplorerj@gmail.com>
> 
> REF: https//bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove PcdConOutGopSupport, it is unnecessary any more.
> Remove All UGA Support in UefiPayloadPkg.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Cc: Sean Rhodes <sean@starlabs.systems>
> ---
>  .../Library/PlatformBootManagerLib/PlatformBootManager.h      | 4 ++--
>  .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 4 +---
>  UefiPayloadPkg/UefiPayloadPkg.dsc                             | 2 --
>  3 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> index 5614aadafb98..0f93287ac1f7 100644
> --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> @@ -1,7 +1,7 @@
>  /** @file
>     Head file for BDS Platform specific code
> 
> -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
>  **/
> 
> @@ -98,7 +98,7 @@ PlatformBootManagerEnableQuietBoot (
>    Use SystemTable Conout to turn on video based Simple Text Out consoles. The
>    Simple Text Out screens will now be synced up with all non video output devices
> 
> -  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.
> +  @retval EFI_SUCCESS     Graphic devices are back in text mode and synced up.
> 
>  **/
>  EFI_STATUS
> diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index 9f58c460cd6b..2ebe7b3fd960 100644
> --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Include all platform action which can be customized by IBV/OEM.
>  #
> -#  Copyright (c) 2012 - 2021, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.<BR>
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
>  ##
> @@ -55,7 +55,6 @@
>  [Protocols]
>    gEfiGenericMemTestProtocolGuid  ## CONSUMES
>    gEfiGraphicsOutputProtocolGuid  ## CONSUMES
> -  gEfiUgaDrawProtocolGuid         ## CONSUMES
>    gEfiBootLogoProtocolGuid        ## CONSUMES
>    gEfiDxeSmmReadyToLockProtocolGuid
>    gEfiSmmAccess2ProtocolGuid
> @@ -65,7 +64,6 @@
> 
>  [Pcd]
>    gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
> -  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 2428bb2ce9a9..50b9b017588d 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -373,8 +373,6 @@
>  ################################################################################
>  [PcdsFeatureFlag]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
>    ## This PCD specified whether ACPI SDT protocol is installed.
>    gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
>    gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
> --
> 2.26.2.windows.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
  2022-07-15  1:50 ` [Patch v2 04/11] EmulatorPkg: " Guomin Jiang
@ 2022-07-15  2:23   ` Ni, Ray
  2022-07-19  0:54     ` Guomin Jiang
  0 siblings, 1 reply; 24+ messages in thread
From: Ni, Ray @ 2022-07-15  2:23 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: GuoMinJ, Andrew Fish

Guomin,
Did you try booting the Emulator Win and Linux with this change?

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Friday, July 15, 2022 9:51 AM
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Andrew Fish <afish@apple.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
> 
> From: GuoMinJ <newexplorerj@gmail.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove All UGA Support in EmulatorPkg.
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>  EmulatorPkg/EmuGopDxe/Gop.h                   | 10 +--
>  EmulatorPkg/EmuGopDxe/GopScreen.c             | 14 ++--
>  EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 24 +++---
>  .../Include/Protocol/EmuGraphicsWindow.h      | 18 ++--
>  .../Library/PlatformBmLib/PlatformBm.h        |  4 +-
>  .../Library/PlatformBmLib/PlatformBmData.c    |  6 +-
>  EmulatorPkg/Unix/Host/Gasket.h                | 12 +--
>  EmulatorPkg/Unix/Host/Host.h                  |  3 +-
>  EmulatorPkg/Unix/Host/Ia32/Gasket.S           |  2 +-
>  EmulatorPkg/Unix/Host/X11GraphicsWindow.c     | 82 +++++++++----------
>  EmulatorPkg/Unix/Host/X64/Gasket.S            |  2 +-
>  EmulatorPkg/Win/Host/WinGopScreen.c           | 10 +--
>  12 files changed, 92 insertions(+), 95 deletions(-)
> 
> diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h
> index 7f7dc4e8eb9f..59ebfda912eb 100644
> --- a/EmulatorPkg/EmuGopDxe/Gop.h
> +++ b/EmulatorPkg/EmuGopDxe/Gop.h
> @@ -1,13 +1,13 @@
>  /*++ @file
> 
> -Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2010,Apple Inc. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
> -#ifndef __UGA_H_
> -#define __UGA_H_
> +#ifndef GOP_H_
> +#define GOP_H_
> 
>  #include <PiDxe.h>
> 
> @@ -60,8 +60,6 @@ typedef struct {
>  extern EFI_DRIVER_BINDING_PROTOCOL  gEmuGopDriverBinding;
>  extern EFI_COMPONENT_NAME_PROTOCOL  gEmuGopComponentName;
> 
> -#define EMU_UGA_CLASS_NAME  L"EmuGopWindow"
> -
>  #define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('G', 'o', 'p', 'N')
>  typedef struct {
>    UINT64                               Signature;
> @@ -83,7 +81,7 @@ typedef struct {
>    GOP_MODE_DATA                        *ModeData;
> 
>    //
> -  // UGA Private Data knowing when to start hardware
> +  // Private Data knowing when to start hardware
>    //
>    BOOLEAN                              HardwareNeedsStarting;
> 
> diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c
> index 88d95b88e162..113b496861b4 100644
> --- a/EmulatorPkg/EmuGopDxe/GopScreen.c
> +++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
> @@ -10,7 +10,7 @@ Module Name:
> 
>  Abstract:
> 
> -  This file produces the graphics abstration of UGA. It is called by
> +  This file produces the graphics abstration of GOP. It is called by
>    EmuGopDriver.c file which deals with the EFI 1.1 driver model.
>    This file just does graphics.
> 
> @@ -209,7 +209,7 @@ EmuGopBlt (
>    // the number of bytes in each row can be computed.
>    //
>    if (Delta == 0) {
> -    Delta = Width * sizeof (EFI_UGA_PIXEL);
> +    Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
>    }
> 
>    //
> @@ -220,8 +220,8 @@ EmuGopBlt (
>    OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
> 
>    //
> -  // Pack UGA Draw protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
> -  // GopBlt() API of Unix UGA IO protocol.
> +  // Pack GOP protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
> +  // GopBlt() API of GOP protocol.
>    //
>    GopBltArgs.DestinationX = DestinationX;
>    GopBltArgs.DestinationY = DestinationY;
> @@ -232,8 +232,8 @@ EmuGopBlt (
>    GopBltArgs.Delta        = Delta;
>    Status                  = Private->EmuGraphicsWindow->Blt (
>                                                            Private->EmuGraphicsWindow,
> -                                                          (EFI_UGA_PIXEL *)BltBuffer,
> -                                                          (EFI_UGA_BLT_OPERATION)BltOperation,
> +                                                          BltBuffer,
> +                                                          BltOperation,
>                                                            &GopBltArgs
>                                                            );
> 
> @@ -384,7 +384,7 @@ ShutdownGopEvent (
> 
>  Routine Description:
> 
> -  This is the UGA screen's callback notification function for exit-boot-services.
> +  This is the screen's callback notification function for exit-boot-services.
>    All we do here is call EmuGopDestructor().
> 
>  Arguments:
> diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> index 15de43ac022e..062508fafc9d 100644
> --- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> +++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> @@ -7,19 +7,19 @@
> 
>    UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem.
> 
> -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2011, Apple Inc. All rights reserved.
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
> -#ifndef _EMU_UGA_IO_H_
> -#define _EMU_UGA_IO_H_
> +#ifndef EMU_GRAPHICS_WINDOW_H_
> +#define EMU_GRAPHICS_WINDOW_H_
> 
>  #include <Protocol/SimplePointer.h>
>  #include <Protocol/SimpleTextIn.h>
>  #include <Protocol/SimpleTextInEx.h>
> -#include <Protocol/UgaDraw.h>
> +#include <Protocol/GraphicsOutput.h>
> 
>  #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
>   { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8, 0xCA, 0xC1 } }
> @@ -29,13 +29,13 @@ typedef struct _EMU_GRAPHICS_WINDOW_PROTOCOL EMU_GRAPHICS_WINDOW_PROTOCOL;
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
>    );
> 
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
>    UINT32                        Width,
>    UINT32                        Height
>    );
> @@ -43,13 +43,13 @@ EFI_STATUS
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
>    );
> 
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
>    EFI_KEY_DATA                  *key
>    );
> 
> @@ -88,10 +88,10 @@ typedef struct {
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
> -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
> -  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
> -  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
> -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
> +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
>    );
> 
>  typedef
> diff --git a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> index 7c495b25eb1b..ed7b71611f90 100644
> --- a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> +++ b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> @@ -6,13 +6,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
> -#ifndef _EMU_UGA_IO_H_
> -#define _EMU_UGA_IO_H_
> +#ifndef EMU_GRAPHICS_WINDOW_H_
> +#define EMU_GRAPHICS_WINDOW_H_
> 
>  #include <Protocol/SimplePointer.h>
>  #include <Protocol/SimpleTextIn.h>
>  #include <Protocol/SimpleTextInEx.h>
> -#include <Protocol/UgaDraw.h>
> +#include <Protocol/GraphicsOutput.h>
> 
>  #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
>   { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8, 0xCA, 0xC1 } }
> @@ -22,13 +22,13 @@ typedef struct _EMU_GRAPHICS_WINDOW_PROTOCOL EMU_GRAPHICS_WINDOW_PROTOCOL;
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
>    );
> 
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
>    UINT32                        Width,
>    UINT32                        Height
>    );
> @@ -36,13 +36,13 @@ EFI_STATUS
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
>    );
> 
>  typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
> -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
>    EFI_KEY_DATA                  *key
>    );
> 
> @@ -83,8 +83,8 @@ typedef
>  EFI_STATUS
>  (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
>    IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
> -  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
> -  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer OPTIONAL,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,
>    IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
>    );
> 
> diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> index b89ffd77e4de..462049e2b048 100644
> --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> @@ -1,6 +1,6 @@
>  /*++ @file
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2011, Apple Inc. All rights reserved.
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -60,7 +60,7 @@ typedef struct {
>    EMU_VENDOR_DEVICE_PATH_NODE    EmuBus;
>    EMU_VENDOR_DEVICE_PATH_NODE    EmuGraphicsWindow;
>    EFI_DEVICE_PATH_PROTOCOL       End;
> -} EMU_PLATFORM_UGA_DEVICE_PATH;
> +} EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH;
> 
>  //
>  // Platform BDS Functions
> diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> index efb03def37eb..b69c4728d1a7 100644
> --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> @@ -1,6 +1,6 @@
>  /*++ @file
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2011, Apple Inc. All rights reserved.
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -8,7 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #include "PlatformBm.h"
> 
> -EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath = {
> +EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH  gGopDevicePath = {
>    {
>      {
>        {
> @@ -40,7 +40,7 @@ EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath = {
>    gEndEntire
>  };
> 
> -EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath2 = {
> +EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH  gGopDevicePath2 = {
>    {
>      {
>        {
> diff --git a/EmulatorPkg/Unix/Host/Gasket.h b/EmulatorPkg/Unix/Host/Gasket.h
> index 6dafc903cfce..1ffdfb334524 100644
> --- a/EmulatorPkg/Unix/Host/Gasket.h
> +++ b/EmulatorPkg/Unix/Host/Gasket.h
> @@ -1,7 +1,7 @@
>  /** @file
> 
>    Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
> -  Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -200,7 +200,7 @@ ReverseGasketUint64Uint64 (
>    );
> 
>  //
> -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
>  //
> 
>  EFI_STATUS
> @@ -243,10 +243,10 @@ GasketX11RegisterKeyNotify (
>  EFI_STATUS
>  EFIAPI
>  GasketX11Blt (
> -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsWindows,
> -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
>    );
> 
>  EFI_STATUS
> diff --git a/EmulatorPkg/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h
> index 0c81cdfc01f5..ff30f5dce567 100644
> --- a/EmulatorPkg/Unix/Host/Host.h
> +++ b/EmulatorPkg/Unix/Host/Host.h
> @@ -1,6 +1,6 @@
>  /*++ @file
> 
> -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -106,7 +106,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include <Protocol/SimplePointer.h>
>  #include <Protocol/SimpleTextIn.h>
>  #include <Protocol/SimpleTextInEx.h>
> -#include <Protocol/UgaDraw.h>
>  #include <Protocol/SimpleFileSystem.h>
> 
>  #include <Protocol/EmuThunk.h>
> diff --git a/EmulatorPkg/Unix/Host/Ia32/Gasket.S b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> index 36197ff26028..6fcdd265cf30 100644
> --- a/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> +++ b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> @@ -371,7 +371,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
>    ret
> 
>  //
> -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
>  //
> 
>  ASM_GLOBAL ASM_PFX(GasketX11Size)
> diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> index a30cc19dbe0a..b3880e198855 100644
> --- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> +++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> @@ -1,6 +1,6 @@
>  /*++ @file
> 
> -Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2004 - 2022, Intel Corporation. All rights reserved.<BR>
>  Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -700,8 +700,8 @@ HandleEvents (
> 
>  unsigned long
>  X11PixelToColor (
> -  IN  GRAPHICS_IO_PRIVATE  *Drv,
> -  IN  EFI_UGA_PIXEL        pixel
> +  IN  GRAPHICS_IO_PRIVATE            *Drv,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  pixel
>    )
>  {
>    return ((pixel.Red   >> Drv->r.csize) << Drv->r.shift)
> @@ -709,15 +709,15 @@ X11PixelToColor (
>           | ((pixel.Blue  >> Drv->b.csize) << Drv->b.shift);
>  }
> 
> -EFI_UGA_PIXEL
> +EFI_GRAPHICS_OUTPUT_BLT_PIXEL
>  X11ColorToPixel (
>    IN  GRAPHICS_IO_PRIVATE  *Drv,
>    IN  unsigned long        val
>    )
>  {
> -  EFI_UGA_PIXEL  Pixel;
> +  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Pixel;
> 
> -  memset (&Pixel, 0, sizeof (EFI_UGA_PIXEL));
> +  memset (&Pixel, 0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> 
>    // Truncation not an issue since X11 and EFI are both using 8 bits per color
>    Pixel.Red   =   (val >> Drv->r.shift) << Drv->r.csize;
> @@ -782,7 +782,7 @@ X11KeySetState (
>      if ((Drv->KeyState.KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == 0) {
>        //
>        // We could create an XKeyEvent and send a XK_Caps_Lock to
> -      // the UGA/GOP Window
> +      // the GOP Window
>        //
>      }
>    }
> @@ -812,32 +812,32 @@ X11RegisterKeyNotify (
> 
>  EFI_STATUS
>  X11Blt (
> -  IN EMU_GRAPHICS_WINDOW_PROTOCOL     *GraphicsIo,
> -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
>    )
>  {
> -  GRAPHICS_IO_PRIVATE  *Private;
> -  UINTN                DstY;
> -  UINTN                SrcY;
> -  UINTN                DstX;
> -  UINTN                SrcX;
> -  UINTN                Index;
> -  EFI_UGA_PIXEL        *Blt;
> -  UINT8                *Dst;
> -  UINT8                *Src;
> -  UINTN                Nbr;
> -  unsigned long        Color;
> -  XEvent               ev;
> +  GRAPHICS_IO_PRIVATE            *Private;
> +  UINTN                          DstY;
> +  UINTN                          SrcY;
> +  UINTN                          DstX;
> +  UINTN                          SrcX;
> +  UINTN                          Index;
> +  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  *Blt;
> +  UINT8                          *Dst;
> +  UINT8                          *Src;
> +  UINTN                          Nbr;
> +  unsigned long                  Color;
> +  XEvent                         ev;
> 
>    Private = (GRAPHICS_IO_PRIVATE *)GraphicsIo;
> 
>    //
>    //  Check bounds
>    //
> -  if (  (BltOperation == EfiUgaVideoToBltBuffer)
> -     || (BltOperation == EfiUgaVideoToVideo))
> +  if (  (BltOperation == EfiBltVideoToBltBuffer)
> +     || (BltOperation == EfiBltVideoToVideo))
>    {
>      //
>      // Source is Video.
> @@ -851,9 +851,9 @@ X11Blt (
>      }
>    }
> 
> -  if (  (BltOperation == EfiUgaBltBufferToVideo)
> -     || (BltOperation == EfiUgaVideoToVideo)
> -     || (BltOperation == EfiUgaVideoFill))
> +  if (  (BltOperation == EfiBltBufferToVideo)
> +     || (BltOperation == EfiBltVideoToVideo)
> +     || (BltOperation == EfiBltVideoFill))
>    {
>      //
>      // Destination is Video
> @@ -868,32 +868,32 @@ X11Blt (
>    }
> 
>    switch (BltOperation) {
> -    case EfiUgaVideoToBltBuffer:
> -      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY * Args->Delta) + Args->DestinationX * sizeof
> (EFI_UGA_PIXEL));
> -      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
> +    case EfiBltVideoToBltBuffer:
> +      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY * Args->Delta) + Args-
> >DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> +      Args->Delta -= Args->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
>        for (SrcY = Args->SourceY; SrcY < (Args->Height + Args->SourceY); SrcY++) {
>          for (SrcX = Args->SourceX; SrcX < (Args->Width + Args->SourceX); SrcX++) {
>            *Blt++ = X11ColorToPixel (Private, XGetPixel (Private->image, SrcX, SrcY));
>          }
> 
> -        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
> +        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt + Args->Delta);
>        }
> 
>        break;
> -    case EfiUgaBltBufferToVideo:
> -      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY * Args->Delta) + Args->SourceX * sizeof
> (EFI_UGA_PIXEL));
> -      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
> +    case EfiBltBufferToVideo:
> +      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY * Args->Delta) + Args-
> >SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> +      Args->Delta -= Args->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
>        for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
>          for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
>            XPutPixel (Private->image, DstX, DstY, X11PixelToColor (Private, *Blt));
>            Blt++;
>          }
> 
> -        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
> +        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt + Args->Delta);
>        }
> 
>        break;
> -    case EfiUgaVideoToVideo:
> +    case EfiBltVideoToVideo:
>        Dst = Private->image_data + (Args->DestinationX << Private->pixel_shift)
>              + Args->DestinationY * Private->line_bytes;
>        Src = Private->image_data + (Args->SourceX << Private->pixel_shift)
> @@ -920,7 +920,7 @@ X11Blt (
>        }
> 
>        break;
> -    case EfiUgaVideoFill:
> +    case EfiBltVideoFill:
>        Color = X11PixelToColor (Private, *BltBuffer);
>        for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
>          for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
> @@ -937,7 +937,7 @@ X11Blt (
>    //  Refresh screen.
>    //
>    switch (BltOperation) {
> -    case EfiUgaVideoToVideo:
> +    case EfiBltVideoToVideo:
>        XCopyArea (
>          Private->display,
>          Private->win,
> @@ -960,7 +960,7 @@ X11Blt (
>        }
> 
>        break;
> -    case EfiUgaVideoFill:
> +    case EfiBltVideoFill:
>        Color = X11PixelToColor (Private, *BltBuffer);
>        XSetForeground (Private->display, Private->gc, Color);
>        XFillRectangle (
> @@ -974,7 +974,7 @@ X11Blt (
>          );
>        XFlush (Private->display);
>        break;
> -    case EfiUgaBltBufferToVideo:
> +    case EfiBltBufferToVideo:
>        Redraw (Private, Args->DestinationX, Args->DestinationY, Args->Width, Args->Height);
>        break;
>      default:
> diff --git a/EmulatorPkg/Unix/Host/X64/Gasket.S b/EmulatorPkg/Unix/Host/X64/Gasket.S
> index 030faa8e4c36..1b4614ab618d 100644
> --- a/EmulatorPkg/Unix/Host/X64/Gasket.S
> +++ b/EmulatorPkg/Unix/Host/X64/Gasket.S
> @@ -427,7 +427,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
>    ret
> 
>  //
> -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
>  //
> 
>  ASM_GLOBAL ASM_PFX(GasketX11Size)
> diff --git a/EmulatorPkg/Win/Host/WinGopScreen.c b/EmulatorPkg/Win/Host/WinGopScreen.c
> index 661573d7771c..69abcfc79564 100644
> --- a/EmulatorPkg/Win/Host/WinGopScreen.c
> +++ b/EmulatorPkg/Win/Host/WinGopScreen.c
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  Module Name:
> @@ -396,10 +396,10 @@ WinNtWndSize (
>  // TODO:    Delta - add argument and description to function comment
>  EFI_STATUS
>  WinNtWndBlt (
> -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsIo,
> -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
>    )
>  {
>    RETURN_STATUS          RStatus;
> --
> 2.26.2.windows.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 02/11] ArmVirtPkg: Remove All UGA Support
  2022-07-15  1:50 ` [Patch v2 02/11] ArmVirtPkg: " Guomin Jiang
@ 2022-07-15  9:42   ` Sami Mujawar
  2022-07-18 12:23     ` [edk2-devel] " Guomin Jiang
  0 siblings, 1 reply; 24+ messages in thread
From: Sami Mujawar @ 2022-07-15  9:42 UTC (permalink / raw)
  To: Guomin Jiang, devel
  Cc: GuoMinJ, Ard Biesheuvel, Leif Lindholm, Gerd Hoffmann, nd

Hi Guomin,

Thank you for this patch.

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 15/07/2022 02:50 am, Guomin Jiang wrote:
> From: GuoMinJ <newexplorerj@gmail.com>
>
> REF: https//bugzilla.tianocore.org/show_bug.cgi?id=2368
>
> Remove PcdConOutGopSupport, it is unnecessary any more.
> Remove All UGA Support in ArmVirtPkg
>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   ArmVirtPkg/ArmVirtQemu.dsc       | 7 +------
>   ArmVirtPkg/ArmVirtQemuKernel.dsc | 7 +------
>   2 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 9369a88858fd..dc87050f3f3a 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -1,7 +1,7 @@
>   #
>   #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
>   #  Copyright (c) 2014, Linaro Limited. All rights reserved.
> -#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
>   #
>   #  SPDX-License-Identifier: BSD-2-Clause-Patent
>   #
> @@ -125,11 +125,6 @@
>     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
>     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
>   
> -  ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
> -  #  It could be set FALSE to save size.
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE

[SAMI] I am assuming PcdConOutGopSupport is going to be removed. Can you 
confiirm, please?

I am not sure I am looking at the right pull request. But the patch at 
https://github.com/tianocore/edk2/pull/290/commits/49838844df66826c5d09a2dad075dfe0d37ee709#diff-6bdd1bc5bd7bacf61a4499e556ae002cbc49fc24c19e424fdf544d91e163bbb8 
does not seem to drop it.

Also the subject line for the commit is same as for the patch at 
https://edk2.groups.io/g/devel/message/91390 in this series.

[/SAMI]

> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> -
>     gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
>   
>     gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE)
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 7f7d15d6eee3..0d13d8edb407 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -1,7 +1,7 @@
>   #
>   #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
>   #  Copyright (c) 2014, Linaro Limited. All rights reserved.
> -#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
>   #
>   #  SPDX-License-Identifier: BSD-2-Clause-Patent
>   #
> @@ -107,11 +107,6 @@
>     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
>     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
>   
> -  ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
> -  #  It could be set FALSE to save size.
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> -
>     gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
>   
>   [PcdsFixedAtBuild.common]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 03/11] ArmPkg: Remove All UGA Support
  2022-07-15  1:50 ` [Patch v2 03/11] ArmPkg: " Guomin Jiang
@ 2022-07-15 13:32   ` Sami Mujawar
  0 siblings, 0 replies; 24+ messages in thread
From: Sami Mujawar @ 2022-07-15 13:32 UTC (permalink / raw)
  To: Guomin Jiang, devel; +Cc: GuoMinJ, Leif Lindholm, Ard Biesheuvel, nd

Hi Guomin,

Thank you for this patch.

This change looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 15/07/2022 02:50 am, Guomin Jiang wrote:
> From: GuoMinJ <newexplorerj@gmail.com>
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
>
> Remove All UGA Support in ArmPkg.
>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> ---
>   ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h           | 4 ++--
>   .../PlatformBootManagerLib/PlatformBootManagerLib.inf        | 5 +----
>   2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
> index a40a2ff5cb4f..a2ec4c4ad6c7 100644
> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
> @@ -2,7 +2,7 @@
>     Head file for BDS Platform specific code
>   
>     Copyright (C) 2015-2016, Red Hat, Inc.
> -  Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2004 - 2022, Intel Corporation. All rights reserved.<BR>
>     Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
>   
>     SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -43,7 +43,7 @@ EnableQuietBoot (
>     Simple Text Out screens will now be synced up with all non video output
>     devices
>   
> -  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.
> +  @retval EFI_SUCCESS     Graphic devices are back in text mode and synced up.
>   **/
>   EFI_STATUS
>   DisableQuietBoot (
> diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index 86751b45f82b..63d1d83ab0ef 100644
> --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -3,7 +3,7 @@
>   #
>   #  Copyright (C) 2015-2016, Red Hat, Inc.
>   #  Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
> -#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
>   #  Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
>   #
>   #  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -51,9 +51,6 @@
>     UefiLib
>     UefiRuntimeServicesTableLib
>   
> -[FeaturePcd]
> -  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
> -
>   [FixedPcd]
>     gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable
>     gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 11/11] MdePkg/UefiLib: Remove all UGA support
  2022-07-15  1:51 ` [Patch v2 11/11] MdePkg/UefiLib: " Guomin Jiang
@ 2022-07-15 16:23   ` Michael D Kinney
  0 siblings, 0 replies; 24+ messages in thread
From: Michael D Kinney @ 2022-07-15 16:23 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io, Kinney, Michael D
  Cc: Gao, Liming, Liu, Zhiguang

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>


> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Thursday, July 14, 2022 6:51 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> <zhiguang.liu@intel.com>
> Subject: [Patch v2 11/11] MdePkg/UefiLib: Remove all UGA support
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove all UGA code in MdePkg except the definition
> 
> The reason why keep definition is because downstream need it to pass
> build.
> It will be removed when all downstream remove UGA support
> 
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
>  MdePkg/Library/UefiLib/UefiLib.inf       |  4 +-
>  MdePkg/Library/UefiLib/UefiLibInternal.h |  3 +-
>  MdePkg/Library/UefiLib/UefiLibPrint.c    | 91 +-----------------------
>  MdePkg/MdePkg.dsc                        |  3 -
>  4 files changed, 3 insertions(+), 98 deletions(-)
> 
> diff --git a/MdePkg/Library/UefiLib/UefiLib.inf b/MdePkg/Library/UefiLib/UefiLib.inf
> index 01ed92092da2..ac9d68907261 100644
> --- a/MdePkg/Library/UefiLib/UefiLib.inf
> +++ b/MdePkg/Library/UefiLib/UefiLib.inf
> @@ -7,7 +7,7 @@
>  #  EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
>  #  and print messages on the console output and standard error devices.
>  #
> -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -67,7 +67,6 @@
>    gEfiGraphicsOutputProtocolGuid                  ## SOMETIMES_CONSUMES
>    gEfiHiiFontProtocolGuid                         ## SOMETIMES_CONSUMES
>    gEfiSimpleFileSystemProtocolGuid                ## SOMETIMES_CONSUMES
> -  gEfiUgaDrawProtocolGuid | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport                 ## SOMETIMES_CONSUMES # Consumes
> if gEfiGraphicsOutputProtocolGuid uninstalled
>    gEfiComponentNameProtocolGuid  | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable   ## SOMETIMES_PRODUCES # User
> chooses to produce it
>    gEfiComponentName2ProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable  ## SOMETIMES_PRODUCES # User
> chooses to produce it
>    gEfiDriverConfigurationProtocolGuid                            ## SOMETIMES_PRODUCES # User chooses to produce it
> @@ -84,5 +83,4 @@
>    gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable        ## CONSUMES
>    gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable   ## CONSUMES
>    gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable       ## CONSUMES
> -  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport           ## CONSUMES
> 
> diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/UefiLib/UefiLibInternal.h
> index 4365282cf213..be5c9ddcdde8 100644
> --- a/MdePkg/Library/UefiLib/UefiLibInternal.h
> +++ b/MdePkg/Library/UefiLib/UefiLibInternal.h
> @@ -1,7 +1,7 @@
>  /** @file
>    Internal include file for UefiLib.
> 
> -  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>  **/
> 
> @@ -18,7 +18,6 @@
>  #include <Protocol/DriverDiagnostics2.h>
>  #include <Protocol/LoadedImage.h>
>  #include <Protocol/GraphicsOutput.h>
> -#include <Protocol/UgaDraw.h>
>  #include <Protocol/HiiFont.h>
> 
>  #include <Guid/EventGroup.h>
> diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib/UefiLibPrint.c
> index 39edeb7283dd..2451775aeb90 100644
> --- a/MdePkg/Library/UefiLib/UefiLibPrint.c
> +++ b/MdePkg/Library/UefiLib/UefiLibPrint.c
> @@ -2,7 +2,7 @@
>    Mde UEFI library API implementation.
>    Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
> 
> -  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -344,20 +344,14 @@ InternalPrintGraphic (
>    EFI_STATUS                       Status;
>    UINT32                           HorizontalResolution;
>    UINT32                           VerticalResolution;
> -  UINT32                           ColorDepth;
> -  UINT32                           RefreshRate;
>    EFI_HII_FONT_PROTOCOL            *HiiFont;
>    EFI_IMAGE_OUTPUT                 *Blt;
>    EFI_FONT_DISPLAY_INFO            FontInfo;
>    EFI_HII_ROW_INFO                 *RowInfoArray;
>    UINTN                            RowInfoArraySize;
>    EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput;
> -  EFI_UGA_DRAW_PROTOCOL            *UgaDraw;
>    EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Sto;
>    EFI_HANDLE                       ConsoleHandle;
> -  UINTN                            Width;
> -  UINTN                            Height;
> -  UINTN                            Delta;
> 
>    HorizontalResolution = 0;
>    VerticalResolution   = 0;
> @@ -374,20 +368,6 @@ InternalPrintGraphic (
>                    (VOID **)&GraphicsOutput
>                    );
> 
> -  UgaDraw = NULL;
> -  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
> -    //
> -    // If no GOP available, try to open UGA Draw protocol if supported.
> -    //
> -    GraphicsOutput = NULL;
> -
> -    Status = gBS->HandleProtocol (
> -                    ConsoleHandle,
> -                    &gEfiUgaDrawProtocolGuid,
> -                    (VOID **)&UgaDraw
> -                    );
> -  }
> -
>    if (EFI_ERROR (Status)) {
>      goto Error;
>    }
> @@ -405,8 +385,6 @@ InternalPrintGraphic (
>    if (GraphicsOutput != NULL) {
>      HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
>      VerticalResolution   = GraphicsOutput->Mode->Info->VerticalResolution;
> -  } else if ((UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
> -    UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);
>    } else {
>      goto Error;
>    }
> @@ -466,73 +444,6 @@ InternalPrintGraphic (
>      if (EFI_ERROR (Status)) {
>        goto Error;
>      }
> -  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
> -    ASSERT (UgaDraw != NULL);
> -
> -    //
> -    // Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow.
> -    //
> -    if (Blt->Width > DivU64x32 (MAX_UINTN, Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL))) {
> -      goto Error;
> -    }
> -
> -    Blt->Image.Bitmap = AllocateZeroPool ((UINT32)Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> -    ASSERT (Blt->Image.Bitmap != NULL);
> -
> -    //
> -    //  StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
> -    //  we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
> -    //
> -    Status = HiiFont->StringToImage (
> -                        HiiFont,
> -                        EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_OUT_FLAG_CLIP |
> -                        EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
> -                        EFI_HII_IGNORE_LINE_BREAK,
> -                        Buffer,
> -                        &FontInfo,
> -                        &Blt,
> -                        PointX,
> -                        PointY,
> -                        &RowInfoArray,
> -                        &RowInfoArraySize,
> -                        NULL
> -                        );
> -
> -    if (!EFI_ERROR (Status)) {
> -      ASSERT (RowInfoArray != NULL);
> -      //
> -      // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will
> -      // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
> -      //
> -      ASSERT (RowInfoArraySize <= 1);
> -
> -      if (RowInfoArraySize != 0) {
> -        Width  = RowInfoArray[0].LineWidth;
> -        Height = RowInfoArray[0].LineHeight;
> -        Delta  = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> -      } else {
> -        Width  = 0;
> -        Height = 0;
> -        Delta  = 0;
> -      }
> -
> -      Status = UgaDraw->Blt (
> -                          UgaDraw,
> -                          (EFI_UGA_PIXEL *)Blt->Image.Bitmap,
> -                          EfiUgaBltBufferToVideo,
> -                          PointX,
> -                          PointY,
> -                          PointX,
> -                          PointY,
> -                          Width,
> -                          Height,
> -                          Delta
> -                          );
> -    } else {
> -      goto Error;
> -    }
> -
> -    FreePool (Blt->Image.Bitmap);
>    } else {
>      goto Error;
>    }
> diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
> index 3d8874e64782..e67d4716df21 100644
> --- a/MdePkg/MdePkg.dsc
> +++ b/MdePkg/MdePkg.dsc
> @@ -23,9 +23,6 @@
> 
>  !include MdePkg/MdeLibs.dsc.inc
> 
> -[PcdsFeatureFlag]
> -  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE
> -
>  [PcdsFixedAtBuild]
>    gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
>    gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
> --
> 2.26.2.windows.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [Patch v2 02/11] ArmVirtPkg: Remove All UGA Support
  2022-07-15  9:42   ` Sami Mujawar
@ 2022-07-18 12:23     ` Guomin Jiang
  2022-07-18 16:42       ` Sami Mujawar
  0 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-18 12:23 UTC (permalink / raw)
  To: devel@edk2.groups.io, sami.mujawar@arm.com
  Cc: GuoMinJ, Ard Biesheuvel, Leif Lindholm, Gerd Hoffmann, nd@arm.com

Hi Sami,

I am sure that the PcdConOutGopSupport will being removed.

We will keep it in dec file temporarily because some downstream project still need it
First we will remove all related code except definition and header
Second we will highlight it and downstream should remove all related code in their project
Last we will remove the definition and header and all UGA will be clean totally.

Thanks
Guomin
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sami
> Mujawar
> Sent: Friday, July 15, 2022 5:42 PM
> To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Ard Biesheuvel
> <ardb+tianocore@kernel.org>; Leif Lindholm <leif@nuviainc.com>; Gerd
> Hoffmann <kraxel@redhat.com>; nd@arm.com
> Subject: Re: [edk2-devel] [Patch v2 02/11] ArmVirtPkg: Remove All UGA
> Support
> 
> Hi Guomin,
> 
> Thank you for this patch.
> 
> Please find my response inline marked [SAMI].
> 
> Regards,
> 
> Sami Mujawar
> 
> On 15/07/2022 02:50 am, Guomin Jiang wrote:
> > From: GuoMinJ <newexplorerj@gmail.com>
> >
> > REF: https//bugzilla.tianocore.org/show_bug.cgi?id=2368
> >
> > Remove PcdConOutGopSupport, it is unnecessary any more.
> > Remove All UGA Support in ArmVirtPkg
> >
> > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Sami Mujawar <sami.mujawar@arm.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >   ArmVirtPkg/ArmVirtQemu.dsc       | 7 +------
> >   ArmVirtPkg/ArmVirtQemuKernel.dsc | 7 +------
> >   2 files changed, 2 insertions(+), 12 deletions(-)
> >
> > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> > index 9369a88858fd..dc87050f3f3a 100644
> > --- a/ArmVirtPkg/ArmVirtQemu.dsc
> > +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> > @@ -1,7 +1,7 @@
> >   #
> >   #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
> >   #  Copyright (c) 2014, Linaro Limited. All rights reserved.
> > -#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
> > +#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
> >   #
> >   #  SPDX-License-Identifier: BSD-2-Clause-Patent
> >   #
> > @@ -125,11 +125,6 @@
> >     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
> >
> gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
> >
> > -  ## If TRUE, Graphics Output Protocol will be installed on virtual handle
> created by ConsplitterDxe.
> > -  #  It could be set FALSE to save size.
> > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> 
> [SAMI] I am assuming PcdConOutGopSupport is going to be removed. Can
> you confiirm, please?
> 
> I am not sure I am looking at the right pull request. But the patch at
> https://github.com/tianocore/edk2/pull/290/commits/49838844df66826c5d0
> 9a2dad075dfe0d37ee709#diff-
> 6bdd1bc5bd7bacf61a4499e556ae002cbc49fc24c19e424fdf544d91e163bbb8
> does not seem to drop it.
> 
> Also the subject line for the commit is same as for the patch at
> https://edk2.groups.io/g/devel/message/91390 in this series.
> 
> [/SAMI]
> 
> > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> > -
> >
> gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
> >
> >     gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE)
> > diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > index 7f7d15d6eee3..0d13d8edb407 100644
> > --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> > @@ -1,7 +1,7 @@
> >   #
> >   #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
> >   #  Copyright (c) 2014, Linaro Limited. All rights reserved.
> > -#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
> > +#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
> >   #
> >   #  SPDX-License-Identifier: BSD-2-Clause-Patent
> >   #
> > @@ -107,11 +107,6 @@
> >     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
> >
> gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
> >
> > -  ## If TRUE, Graphics Output Protocol will be installed on virtual handle
> created by ConsplitterDxe.
> > -  #  It could be set FALSE to save size.
> > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> > -
> >
> gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
> >
> >   [PcdsFixedAtBuild.common]
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [Patch v2 02/11] ArmVirtPkg: Remove All UGA Support
  2022-07-18 12:23     ` [edk2-devel] " Guomin Jiang
@ 2022-07-18 16:42       ` Sami Mujawar
  0 siblings, 0 replies; 24+ messages in thread
From: Sami Mujawar @ 2022-07-18 16:42 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io
  Cc: GuoMinJ, Ard Biesheuvel, Leif Lindholm, Gerd Hoffmann, nd

Hi Guomin,

Thank you for confirming.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 18/07/2022, 13:24, "Jiang, Guomin" <guomin.jiang@intel.com> wrote:

    Hi Sami,

    I am sure that the PcdConOutGopSupport will being removed.

    We will keep it in dec file temporarily because some downstream project still need it
    First we will remove all related code except definition and header
    Second we will highlight it and downstream should remove all related code in their project
    Last we will remove the definition and header and all UGA will be clean totally.

    Thanks
    Guomin
    > -----Original Message-----
    > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sami
    > Mujawar
    > Sent: Friday, July 15, 2022 5:42 PM
    > To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
    > Cc: GuoMinJ <newexplorerj@gmail.com>; Ard Biesheuvel
    > <ardb+tianocore@kernel.org>; Leif Lindholm <leif@nuviainc.com>; Gerd
    > Hoffmann <kraxel@redhat.com>; nd@arm.com
    > Subject: Re: [edk2-devel] [Patch v2 02/11] ArmVirtPkg: Remove All UGA
    > Support
    > 
    > Hi Guomin,
    > 
    > Thank you for this patch.
    > 
    > Please find my response inline marked [SAMI].
    > 
    > Regards,
    > 
    > Sami Mujawar
    > 
    > On 15/07/2022 02:50 am, Guomin Jiang wrote:
    > > From: GuoMinJ <newexplorerj@gmail.com>
    > >
    > > REF: https//bugzilla.tianocore.org/show_bug.cgi?id=2368
    > >
    > > Remove PcdConOutGopSupport, it is unnecessary any more.
    > > Remove All UGA Support in ArmVirtPkg
    > >
    > > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
    > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
    > > Cc: Leif Lindholm <leif@nuviainc.com>
    > > Cc: Sami Mujawar <sami.mujawar@arm.com>
    > > Cc: Gerd Hoffmann <kraxel@redhat.com>
    > > ---
    > >   ArmVirtPkg/ArmVirtQemu.dsc       | 7 +------
    > >   ArmVirtPkg/ArmVirtQemuKernel.dsc | 7 +------
    > >   2 files changed, 2 insertions(+), 12 deletions(-)
    > >
    > > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
    > > index 9369a88858fd..dc87050f3f3a 100644
    > > --- a/ArmVirtPkg/ArmVirtQemu.dsc
    > > +++ b/ArmVirtPkg/ArmVirtQemu.dsc
    > > @@ -1,7 +1,7 @@
    > >   #
    > >   #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
    > >   #  Copyright (c) 2014, Linaro Limited. All rights reserved.
    > > -#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
    > > +#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
    > >   #
    > >   #  SPDX-License-Identifier: BSD-2-Clause-Patent
    > >   #
    > > @@ -125,11 +125,6 @@
    > >     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
    > >
    > gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
    > >
    > > -  ## If TRUE, Graphics Output Protocol will be installed on virtual handle
    > created by ConsplitterDxe.
    > > -  #  It could be set FALSE to save size.
    > > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
    > 
    > [SAMI] I am assuming PcdConOutGopSupport is going to be removed. Can
    > you confiirm, please?
    > 
    > I am not sure I am looking at the right pull request. But the patch at
    > https://github.com/tianocore/edk2/pull/290/commits/49838844df66826c5d0
    > 9a2dad075dfe0d37ee709#diff-
    > 6bdd1bc5bd7bacf61a4499e556ae002cbc49fc24c19e424fdf544d91e163bbb8
    > does not seem to drop it.
    > 
    > Also the subject line for the commit is same as for the patch at
    > https://edk2.groups.io/g/devel/message/91390 in this series.
    > 
    > [/SAMI]
    > 
    > > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
    > > -
    > >
    > gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
    > >
    > >     gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE)
    > > diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc
    > > b/ArmVirtPkg/ArmVirtQemuKernel.dsc
    > > index 7f7d15d6eee3..0d13d8edb407 100644
    > > --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
    > > +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
    > > @@ -1,7 +1,7 @@
    > >   #
    > >   #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
    > >   #  Copyright (c) 2014, Linaro Limited. All rights reserved.
    > > -#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
    > > +#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
    > >   #
    > >   #  SPDX-License-Identifier: BSD-2-Clause-Patent
    > >   #
    > > @@ -107,11 +107,6 @@
    > >     gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
    > >
    > gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
    > >
    > > -  ## If TRUE, Graphics Output Protocol will be installed on virtual handle
    > created by ConsplitterDxe.
    > > -  #  It could be set FALSE to save size.
    > > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
    > > -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
    > > -
    > >
    > gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
    > >
    > >   [PcdsFixedAtBuild.common]
    > 
    > 
    > 
    > 



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
  2022-07-15  2:23   ` Ni, Ray
@ 2022-07-19  0:54     ` Guomin Jiang
  2022-07-19  0:56       ` Ni, Ray
  0 siblings, 1 reply; 24+ messages in thread
From: Guomin Jiang @ 2022-07-19  0:54 UTC (permalink / raw)
  To: Ni, Ray, devel@edk2.groups.io; +Cc: GuoMinJ, Andrew Fish

Hi Ray,

I tried it yesterday

It can boot normally in Win Emulator.
But I encounter issues mentioned in https://bugzilla.tianocore.org/show_bug.cgi?id=2639 in Unix. I think it is not related to this change.

Thanks
Guomin
> -----Original Message-----
> From: Ni, Ray <ray.ni@intel.com>
> Sent: Friday, July 15, 2022 10:23 AM
> To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Andrew Fish <afish@apple.com>
> Subject: RE: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
> 
> Guomin,
> Did you try booting the Emulator Win and Linux with this change?
> 
> > -----Original Message-----
> > From: Jiang, Guomin <guomin.jiang@intel.com>
> > Sent: Friday, July 15, 2022 9:51 AM
> > To: devel@edk2.groups.io
> > Cc: GuoMinJ <newexplorerj@gmail.com>; Andrew Fish
> <afish@apple.com>;
> > Ni, Ray <ray.ni@intel.com>
> > Subject: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
> >
> > From: GuoMinJ <newexplorerj@gmail.com>
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> >
> > Remove All UGA Support in EmulatorPkg.
> >
> > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> > Cc: Andrew Fish <afish@apple.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > ---
> >  EmulatorPkg/EmuGopDxe/Gop.h                   | 10 +--
> >  EmulatorPkg/EmuGopDxe/GopScreen.c             | 14 ++--
> >  EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 24 +++---
> >  .../Include/Protocol/EmuGraphicsWindow.h      | 18 ++--
> >  .../Library/PlatformBmLib/PlatformBm.h        |  4 +-
> >  .../Library/PlatformBmLib/PlatformBmData.c    |  6 +-
> >  EmulatorPkg/Unix/Host/Gasket.h                | 12 +--
> >  EmulatorPkg/Unix/Host/Host.h                  |  3 +-
> >  EmulatorPkg/Unix/Host/Ia32/Gasket.S           |  2 +-
> >  EmulatorPkg/Unix/Host/X11GraphicsWindow.c     | 82 +++++++++----------
> >  EmulatorPkg/Unix/Host/X64/Gasket.S            |  2 +-
> >  EmulatorPkg/Win/Host/WinGopScreen.c           | 10 +--
> >  12 files changed, 92 insertions(+), 95 deletions(-)
> >
> > diff --git a/EmulatorPkg/EmuGopDxe/Gop.h
> b/EmulatorPkg/EmuGopDxe/Gop.h
> > index 7f7dc4e8eb9f..59ebfda912eb 100644
> > --- a/EmulatorPkg/EmuGopDxe/Gop.h
> > +++ b/EmulatorPkg/EmuGopDxe/Gop.h
> > @@ -1,13 +1,13 @@
> >  /*++ @file
> >
> > -Copyright (c) 2006 - 2008, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > +reserved.<BR>
> >  Portions copyright (c) 2010,Apple Inc. All rights reserved.<BR>
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> >
> > -#ifndef __UGA_H_
> > -#define __UGA_H_
> > +#ifndef GOP_H_
> > +#define GOP_H_
> >
> >  #include <PiDxe.h>
> >
> > @@ -60,8 +60,6 @@ typedef struct {
> >  extern EFI_DRIVER_BINDING_PROTOCOL  gEmuGopDriverBinding;  extern
> > EFI_COMPONENT_NAME_PROTOCOL  gEmuGopComponentName;
> >
> > -#define EMU_UGA_CLASS_NAME  L"EmuGopWindow"
> > -
> >  #define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('G', 'o', 'p', 'N')
> > typedef struct {
> >    UINT64                               Signature;
> > @@ -83,7 +81,7 @@ typedef struct {
> >    GOP_MODE_DATA                        *ModeData;
> >
> >    //
> > -  // UGA Private Data knowing when to start hardware
> > +  // Private Data knowing when to start hardware
> >    //
> >    BOOLEAN                              HardwareNeedsStarting;
> >
> > diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c
> > b/EmulatorPkg/EmuGopDxe/GopScreen.c
> > index 88d95b88e162..113b496861b4 100644
> > --- a/EmulatorPkg/EmuGopDxe/GopScreen.c
> > +++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
> > @@ -10,7 +10,7 @@ Module Name:
> >
> >  Abstract:
> >
> > -  This file produces the graphics abstration of UGA. It is called by
> > +  This file produces the graphics abstration of GOP. It is called by
> >    EmuGopDriver.c file which deals with the EFI 1.1 driver model.
> >    This file just does graphics.
> >
> > @@ -209,7 +209,7 @@ EmuGopBlt (
> >    // the number of bytes in each row can be computed.
> >    //
> >    if (Delta == 0) {
> > -    Delta = Width * sizeof (EFI_UGA_PIXEL);
> > +    Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> >    }
> >
> >    //
> > @@ -220,8 +220,8 @@ EmuGopBlt (
> >    OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
> >
> >    //
> > -  // Pack UGA Draw protocol parameters to
> > EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
> > -  // GopBlt() API of Unix UGA IO protocol.
> > +  // Pack GOP protocol parameters to
> EMU_GRAPHICS_WINDOWS__BLT_ARGS
> > + structure to adapt to  // GopBlt() API of GOP protocol.
> >    //
> >    GopBltArgs.DestinationX = DestinationX;
> >    GopBltArgs.DestinationY = DestinationY; @@ -232,8 +232,8 @@
> > EmuGopBlt (
> >    GopBltArgs.Delta        = Delta;
> >    Status                  = Private->EmuGraphicsWindow->Blt (
> >                                                            Private->EmuGraphicsWindow,
> > -                                                          (EFI_UGA_PIXEL *)BltBuffer,
> > -                                                          (EFI_UGA_BLT_OPERATION)BltOperation,
> > +                                                          BltBuffer,
> > +
> > + BltOperation,
> >                                                            &GopBltArgs
> >                                                            );
> >
> > @@ -384,7 +384,7 @@ ShutdownGopEvent (
> >
> >  Routine Description:
> >
> > -  This is the UGA screen's callback notification function for exit-boot-
> services.
> > +  This is the screen's callback notification function for exit-boot-services.
> >    All we do here is call EmuGopDestructor().
> >
> >  Arguments:
> > diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > index 15de43ac022e..062508fafc9d 100644
> > --- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > +++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > @@ -7,19 +7,19 @@
> >
> >    UEFI 2.0 can boot from any valid EFI image contained in a
> SimpleFileSystem.
> >
> > -Copyright (c) 2006 - 2010, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > +reserved.<BR>
> >  Portions copyright (c) 2011, Apple Inc. All rights reserved.
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> >
> > -#ifndef _EMU_UGA_IO_H_
> > -#define _EMU_UGA_IO_H_
> > +#ifndef EMU_GRAPHICS_WINDOW_H_
> > +#define EMU_GRAPHICS_WINDOW_H_
> >
> >  #include <Protocol/SimplePointer.h>
> >  #include <Protocol/SimpleTextIn.h>
> >  #include <Protocol/SimpleTextInEx.h>
> > -#include <Protocol/UgaDraw.h>
> > +#include <Protocol/GraphicsOutput.h>
> >
> >  #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
> >   { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8,
> > 0xCA, 0xC1 } } @@ -29,13 +29,13 @@ typedef struct
> > _EMU_GRAPHICS_WINDOW_PROTOCOL
> EMU_GRAPHICS_WINDOW_PROTOCOL;  typedef
> > EFI_STATUS  (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
> >    );
> >
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
> >    UINT32                        Width,
> >    UINT32                        Height
> >    );
> > @@ -43,13 +43,13 @@ EFI_STATUS
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
> >    );
> >
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
> >    EFI_KEY_DATA                  *key
> >    );
> >
> > @@ -88,10 +88,10 @@ typedef struct {
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
> > -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
> > -  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
> > -  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
> > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
> > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> >    );
> >
> >  typedef
> > diff --git a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > index 7c495b25eb1b..ed7b71611f90 100644
> > --- a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > +++ b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > @@ -6,13 +6,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> >
> > -#ifndef _EMU_UGA_IO_H_
> > -#define _EMU_UGA_IO_H_
> > +#ifndef EMU_GRAPHICS_WINDOW_H_
> > +#define EMU_GRAPHICS_WINDOW_H_
> >
> >  #include <Protocol/SimplePointer.h>
> >  #include <Protocol/SimpleTextIn.h>
> >  #include <Protocol/SimpleTextInEx.h>
> > -#include <Protocol/UgaDraw.h>
> > +#include <Protocol/GraphicsOutput.h>
> >
> >  #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
> >   { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8,
> > 0xCA, 0xC1 } } @@ -22,13 +22,13 @@ typedef struct
> > _EMU_GRAPHICS_WINDOW_PROTOCOL
> EMU_GRAPHICS_WINDOW_PROTOCOL;  typedef
> > EFI_STATUS  (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
> >    );
> >
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
> >    UINT32                        Width,
> >    UINT32                        Height
> >    );
> > @@ -36,13 +36,13 @@ EFI_STATUS
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
> >    );
> >
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
> > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
> >    EFI_KEY_DATA                  *key
> >    );
> >
> > @@ -83,8 +83,8 @@ typedef
> >  EFI_STATUS
> >  (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
> >    IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
> > -  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
> > -  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer OPTIONAL,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,
> >    IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
> >    );
> >
> > diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > index b89ffd77e4de..462049e2b048 100644
> > --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > @@ -1,6 +1,6 @@
> >  /*++ @file
> >
> > -Copyright (c) 2006 - 2018, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > +reserved.<BR>
> >  Portions copyright (c) 2011, Apple Inc. All rights reserved.
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -60,7 +60,7 @@ typedef struct {
> >    EMU_VENDOR_DEVICE_PATH_NODE    EmuBus;
> >    EMU_VENDOR_DEVICE_PATH_NODE    EmuGraphicsWindow;
> >    EFI_DEVICE_PATH_PROTOCOL       End;
> > -} EMU_PLATFORM_UGA_DEVICE_PATH;
> > +} EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH;
> >
> >  //
> >  // Platform BDS Functions
> > diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > index efb03def37eb..b69c4728d1a7 100644
> > --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > @@ -1,6 +1,6 @@
> >  /*++ @file
> >
> > -Copyright (c) 2006 - 2018, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > +reserved.<BR>
> >  Portions copyright (c) 2011, Apple Inc. All rights reserved.
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -8,7 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  #include "PlatformBm.h"
> >
> > -EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath = {
> > +EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH  gGopDevicePath
> = {
> >    {
> >      {
> >        {
> > @@ -40,7 +40,7 @@ EMU_PLATFORM_UGA_DEVICE_PATH
> gGopDevicePath = {
> >    gEndEntire
> >  };
> >
> > -EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath2 = {
> > +EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH
> gGopDevicePath2 = {
> >    {
> >      {
> >        {
> > diff --git a/EmulatorPkg/Unix/Host/Gasket.h
> > b/EmulatorPkg/Unix/Host/Gasket.h index 6dafc903cfce..1ffdfb334524
> > 100644
> > --- a/EmulatorPkg/Unix/Host/Gasket.h
> > +++ b/EmulatorPkg/Unix/Host/Gasket.h
> > @@ -1,7 +1,7 @@
> >  /** @file
> >
> >    Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
> > -  Copyright (c) 2011 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> > +  Copyright (c) 2011 - 2022, Intel Corporation. All rights
> > + reserved.<BR>
> >
> >    SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -200,7 +200,7 @@ ReverseGasketUint64Uint64 (
> >    );
> >
> >  //
> > -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> > +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
> >  //
> >
> >  EFI_STATUS
> > @@ -243,10 +243,10 @@ GasketX11RegisterKeyNotify (  EFI_STATUS
> EFIAPI
> > GasketX11Blt (
> > -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsWindows,
> > -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> > -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> >    );
> >
> >  EFI_STATUS
> > diff --git a/EmulatorPkg/Unix/Host/Host.h
> > b/EmulatorPkg/Unix/Host/Host.h index 0c81cdfc01f5..ff30f5dce567 100644
> > --- a/EmulatorPkg/Unix/Host/Host.h
> > +++ b/EmulatorPkg/Unix/Host/Host.h
> > @@ -1,6 +1,6 @@
> >  /*++ @file
> >
> > -Copyright (c) 2006 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > +reserved.<BR>
> >  Portions copyright (c) 2008 - 2011, Apple Inc. All rights
> > reserved.<BR>
> >
> >  SPDX-License-Identifier: BSD-2-Clause-Patent @@ -106,7 +106,6 @@
> > SPDX-License-Identifier: BSD-2-Clause-Patent  #include
> > <Protocol/SimplePointer.h>  #include <Protocol/SimpleTextIn.h>
> > #include <Protocol/SimpleTextInEx.h> -#include <Protocol/UgaDraw.h>
> > #include <Protocol/SimpleFileSystem.h>
> >
> >  #include <Protocol/EmuThunk.h>
> > diff --git a/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > index 36197ff26028..6fcdd265cf30 100644
> > --- a/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > +++ b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > @@ -371,7 +371,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
> >    ret
> >
> >  //
> > -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> > +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
> >  //
> >
> >  ASM_GLOBAL ASM_PFX(GasketX11Size)
> > diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > index a30cc19dbe0a..b3880e198855 100644
> > --- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > +++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > @@ -1,6 +1,6 @@
> >  /*++ @file
> >
> > -Copyright (c) 2004 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (c) 2004 - 2022, Intel Corporation. All rights
> > +reserved.<BR>
> >  Portions copyright (c) 2008 - 2011, Apple Inc. All rights
> > reserved.<BR>
> >
> >  SPDX-License-Identifier: BSD-2-Clause-Patent @@ -700,8 +700,8 @@
> > HandleEvents (
> >
> >  unsigned long
> >  X11PixelToColor (
> > -  IN  GRAPHICS_IO_PRIVATE  *Drv,
> > -  IN  EFI_UGA_PIXEL        pixel
> > +  IN  GRAPHICS_IO_PRIVATE            *Drv,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  pixel
> >    )
> >  {
> >    return ((pixel.Red   >> Drv->r.csize) << Drv->r.shift)
> > @@ -709,15 +709,15 @@ X11PixelToColor (
> >           | ((pixel.Blue  >> Drv->b.csize) << Drv->b.shift);  }
> >
> > -EFI_UGA_PIXEL
> > +EFI_GRAPHICS_OUTPUT_BLT_PIXEL
> >  X11ColorToPixel (
> >    IN  GRAPHICS_IO_PRIVATE  *Drv,
> >    IN  unsigned long        val
> >    )
> >  {
> > -  EFI_UGA_PIXEL  Pixel;
> > +  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Pixel;
> >
> > -  memset (&Pixel, 0, sizeof (EFI_UGA_PIXEL));
> > +  memset (&Pixel, 0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> >
> >    // Truncation not an issue since X11 and EFI are both using 8 bits per color
> >    Pixel.Red   =   (val >> Drv->r.shift) << Drv->r.csize;
> > @@ -782,7 +782,7 @@ X11KeySetState (
> >      if ((Drv->KeyState.KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == 0) {
> >        //
> >        // We could create an XKeyEvent and send a XK_Caps_Lock to
> > -      // the UGA/GOP Window
> > +      // the GOP Window
> >        //
> >      }
> >    }
> > @@ -812,32 +812,32 @@ X11RegisterKeyNotify (
> >
> >  EFI_STATUS
> >  X11Blt (
> > -  IN EMU_GRAPHICS_WINDOW_PROTOCOL     *GraphicsIo,
> > -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> > -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> >    )
> >  {
> > -  GRAPHICS_IO_PRIVATE  *Private;
> > -  UINTN                DstY;
> > -  UINTN                SrcY;
> > -  UINTN                DstX;
> > -  UINTN                SrcX;
> > -  UINTN                Index;
> > -  EFI_UGA_PIXEL        *Blt;
> > -  UINT8                *Dst;
> > -  UINT8                *Src;
> > -  UINTN                Nbr;
> > -  unsigned long        Color;
> > -  XEvent               ev;
> > +  GRAPHICS_IO_PRIVATE            *Private;
> > +  UINTN                          DstY;
> > +  UINTN                          SrcY;
> > +  UINTN                          DstX;
> > +  UINTN                          SrcX;
> > +  UINTN                          Index;
> > +  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  *Blt;
> > +  UINT8                          *Dst;
> > +  UINT8                          *Src;
> > +  UINTN                          Nbr;
> > +  unsigned long                  Color;
> > +  XEvent                         ev;
> >
> >    Private = (GRAPHICS_IO_PRIVATE *)GraphicsIo;
> >
> >    //
> >    //  Check bounds
> >    //
> > -  if (  (BltOperation == EfiUgaVideoToBltBuffer)
> > -     || (BltOperation == EfiUgaVideoToVideo))
> > +  if (  (BltOperation == EfiBltVideoToBltBuffer)
> > +     || (BltOperation == EfiBltVideoToVideo))
> >    {
> >      //
> >      // Source is Video.
> > @@ -851,9 +851,9 @@ X11Blt (
> >      }
> >    }
> >
> > -  if (  (BltOperation == EfiUgaBltBufferToVideo)
> > -     || (BltOperation == EfiUgaVideoToVideo)
> > -     || (BltOperation == EfiUgaVideoFill))
> > +  if (  (BltOperation == EfiBltBufferToVideo)
> > +     || (BltOperation == EfiBltVideoToVideo)
> > +     || (BltOperation == EfiBltVideoFill))
> >    {
> >      //
> >      // Destination is Video
> > @@ -868,32 +868,32 @@ X11Blt (
> >    }
> >
> >    switch (BltOperation) {
> > -    case EfiUgaVideoToBltBuffer:
> > -      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY
> * Args->Delta) + Args->DestinationX * sizeof
> > (EFI_UGA_PIXEL));
> > -      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
> > +    case EfiBltVideoToBltBuffer:
> > +      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer +
> (Args->DestinationY * Args->Delta) + Args-
> > >DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> > +      Args->Delta -= Args->Width * sizeof
> > + (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> >        for (SrcY = Args->SourceY; SrcY < (Args->Height + Args->SourceY);
> SrcY++) {
> >          for (SrcX = Args->SourceX; SrcX < (Args->Width + Args->SourceX);
> SrcX++) {
> >            *Blt++ = X11ColorToPixel (Private, XGetPixel (Private->image, SrcX,
> SrcY));
> >          }
> >
> > -        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
> > +        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt +
> > + Args->Delta);
> >        }
> >
> >        break;
> > -    case EfiUgaBltBufferToVideo:
> > -      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY *
> Args->Delta) + Args->SourceX * sizeof
> > (EFI_UGA_PIXEL));
> > -      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
> > +    case EfiBltBufferToVideo:
> > +      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer +
> (Args->SourceY * Args->Delta) + Args-
> > >SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> > +      Args->Delta -= Args->Width * sizeof
> > + (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> >        for (DstY = Args->DestinationY; DstY < (Args->Height + Args-
> >DestinationY); DstY++) {
> >          for (DstX = Args->DestinationX; DstX < (Args->Width + Args-
> >DestinationX); DstX++) {
> >            XPutPixel (Private->image, DstX, DstY, X11PixelToColor (Private, *Blt));
> >            Blt++;
> >          }
> >
> > -        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
> > +        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt +
> > + Args->Delta);
> >        }
> >
> >        break;
> > -    case EfiUgaVideoToVideo:
> > +    case EfiBltVideoToVideo:
> >        Dst = Private->image_data + (Args->DestinationX << Private-
> >pixel_shift)
> >              + Args->DestinationY * Private->line_bytes;
> >        Src = Private->image_data + (Args->SourceX <<
> > Private->pixel_shift) @@ -920,7 +920,7 @@ X11Blt (
> >        }
> >
> >        break;
> > -    case EfiUgaVideoFill:
> > +    case EfiBltVideoFill:
> >        Color = X11PixelToColor (Private, *BltBuffer);
> >        for (DstY = Args->DestinationY; DstY < (Args->Height + Args-
> >DestinationY); DstY++) {
> >          for (DstX = Args->DestinationX; DstX < (Args->Width +
> > Args->DestinationX); DstX++) { @@ -937,7 +937,7 @@ X11Blt (
> >    //  Refresh screen.
> >    //
> >    switch (BltOperation) {
> > -    case EfiUgaVideoToVideo:
> > +    case EfiBltVideoToVideo:
> >        XCopyArea (
> >          Private->display,
> >          Private->win,
> > @@ -960,7 +960,7 @@ X11Blt (
> >        }
> >
> >        break;
> > -    case EfiUgaVideoFill:
> > +    case EfiBltVideoFill:
> >        Color = X11PixelToColor (Private, *BltBuffer);
> >        XSetForeground (Private->display, Private->gc, Color);
> >        XFillRectangle (
> > @@ -974,7 +974,7 @@ X11Blt (
> >          );
> >        XFlush (Private->display);
> >        break;
> > -    case EfiUgaBltBufferToVideo:
> > +    case EfiBltBufferToVideo:
> >        Redraw (Private, Args->DestinationX, Args->DestinationY, Args->Width,
> Args->Height);
> >        break;
> >      default:
> > diff --git a/EmulatorPkg/Unix/Host/X64/Gasket.S
> > b/EmulatorPkg/Unix/Host/X64/Gasket.S
> > index 030faa8e4c36..1b4614ab618d 100644
> > --- a/EmulatorPkg/Unix/Host/X64/Gasket.S
> > +++ b/EmulatorPkg/Unix/Host/X64/Gasket.S
> > @@ -427,7 +427,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
> >    ret
> >
> >  //
> > -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> > +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
> >  //
> >
> >  ASM_GLOBAL ASM_PFX(GasketX11Size)
> > diff --git a/EmulatorPkg/Win/Host/WinGopScreen.c
> > b/EmulatorPkg/Win/Host/WinGopScreen.c
> > index 661573d7771c..69abcfc79564 100644
> > --- a/EmulatorPkg/Win/Host/WinGopScreen.c
> > +++ b/EmulatorPkg/Win/Host/WinGopScreen.c
> > @@ -1,6 +1,6 @@
> >  /** @file
> >
> > -Copyright (c) 2006 - 2018, Intel Corporation. All rights
> > reserved.<BR>
> > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > +reserved.<BR>
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  Module Name:
> > @@ -396,10 +396,10 @@ WinNtWndSize (
> >  // TODO:    Delta - add argument and description to function comment
> >  EFI_STATUS
> >  WinNtWndBlt (
> > -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsIo,
> > -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> > -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> >    )
> >  {
> >    RETURN_STATUS          RStatus;
> > --
> > 2.26.2.windows.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
  2022-07-19  0:54     ` Guomin Jiang
@ 2022-07-19  0:56       ` Ni, Ray
  0 siblings, 0 replies; 24+ messages in thread
From: Ni, Ray @ 2022-07-19  0:56 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: GuoMinJ, Andrew Fish

Thanks!
Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Tuesday, July 19, 2022 8:54 AM
> To: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Andrew Fish <afish@apple.com>
> Subject: RE: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
> 
> Hi Ray,
> 
> I tried it yesterday
> 
> It can boot normally in Win Emulator.
> But I encounter issues mentioned in https://bugzilla.tianocore.org/show_bug.cgi?id=2639 in Unix. I think it is not related to
> this change.
> 
> Thanks
> Guomin
> > -----Original Message-----
> > From: Ni, Ray <ray.ni@intel.com>
> > Sent: Friday, July 15, 2022 10:23 AM
> > To: Jiang, Guomin <guomin.jiang@intel.com>; devel@edk2.groups.io
> > Cc: GuoMinJ <newexplorerj@gmail.com>; Andrew Fish <afish@apple.com>
> > Subject: RE: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
> >
> > Guomin,
> > Did you try booting the Emulator Win and Linux with this change?
> >
> > > -----Original Message-----
> > > From: Jiang, Guomin <guomin.jiang@intel.com>
> > > Sent: Friday, July 15, 2022 9:51 AM
> > > To: devel@edk2.groups.io
> > > Cc: GuoMinJ <newexplorerj@gmail.com>; Andrew Fish
> > <afish@apple.com>;
> > > Ni, Ray <ray.ni@intel.com>
> > > Subject: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
> > >
> > > From: GuoMinJ <newexplorerj@gmail.com>
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> > >
> > > Remove All UGA Support in EmulatorPkg.
> > >
> > > Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> > > Cc: Andrew Fish <afish@apple.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > ---
> > >  EmulatorPkg/EmuGopDxe/Gop.h                   | 10 +--
> > >  EmulatorPkg/EmuGopDxe/GopScreen.c             | 14 ++--
> > >  EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 24 +++---
> > >  .../Include/Protocol/EmuGraphicsWindow.h      | 18 ++--
> > >  .../Library/PlatformBmLib/PlatformBm.h        |  4 +-
> > >  .../Library/PlatformBmLib/PlatformBmData.c    |  6 +-
> > >  EmulatorPkg/Unix/Host/Gasket.h                | 12 +--
> > >  EmulatorPkg/Unix/Host/Host.h                  |  3 +-
> > >  EmulatorPkg/Unix/Host/Ia32/Gasket.S           |  2 +-
> > >  EmulatorPkg/Unix/Host/X11GraphicsWindow.c     | 82 +++++++++----------
> > >  EmulatorPkg/Unix/Host/X64/Gasket.S            |  2 +-
> > >  EmulatorPkg/Win/Host/WinGopScreen.c           | 10 +--
> > >  12 files changed, 92 insertions(+), 95 deletions(-)
> > >
> > > diff --git a/EmulatorPkg/EmuGopDxe/Gop.h
> > b/EmulatorPkg/EmuGopDxe/Gop.h
> > > index 7f7dc4e8eb9f..59ebfda912eb 100644
> > > --- a/EmulatorPkg/EmuGopDxe/Gop.h
> > > +++ b/EmulatorPkg/EmuGopDxe/Gop.h
> > > @@ -1,13 +1,13 @@
> > >  /*++ @file
> > >
> > > -Copyright (c) 2006 - 2008, Intel Corporation. All rights
> > > reserved.<BR>
> > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  Portions copyright (c) 2010,Apple Inc. All rights reserved.<BR>
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  **/
> > >
> > > -#ifndef __UGA_H_
> > > -#define __UGA_H_
> > > +#ifndef GOP_H_
> > > +#define GOP_H_
> > >
> > >  #include <PiDxe.h>
> > >
> > > @@ -60,8 +60,6 @@ typedef struct {
> > >  extern EFI_DRIVER_BINDING_PROTOCOL  gEmuGopDriverBinding;  extern
> > > EFI_COMPONENT_NAME_PROTOCOL  gEmuGopComponentName;
> > >
> > > -#define EMU_UGA_CLASS_NAME  L"EmuGopWindow"
> > > -
> > >  #define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('G', 'o', 'p', 'N')
> > > typedef struct {
> > >    UINT64                               Signature;
> > > @@ -83,7 +81,7 @@ typedef struct {
> > >    GOP_MODE_DATA                        *ModeData;
> > >
> > >    //
> > > -  // UGA Private Data knowing when to start hardware
> > > +  // Private Data knowing when to start hardware
> > >    //
> > >    BOOLEAN                              HardwareNeedsStarting;
> > >
> > > diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c
> > > b/EmulatorPkg/EmuGopDxe/GopScreen.c
> > > index 88d95b88e162..113b496861b4 100644
> > > --- a/EmulatorPkg/EmuGopDxe/GopScreen.c
> > > +++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
> > > @@ -10,7 +10,7 @@ Module Name:
> > >
> > >  Abstract:
> > >
> > > -  This file produces the graphics abstration of UGA. It is called by
> > > +  This file produces the graphics abstration of GOP. It is called by
> > >    EmuGopDriver.c file which deals with the EFI 1.1 driver model.
> > >    This file just does graphics.
> > >
> > > @@ -209,7 +209,7 @@ EmuGopBlt (
> > >    // the number of bytes in each row can be computed.
> > >    //
> > >    if (Delta == 0) {
> > > -    Delta = Width * sizeof (EFI_UGA_PIXEL);
> > > +    Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> > >    }
> > >
> > >    //
> > > @@ -220,8 +220,8 @@ EmuGopBlt (
> > >    OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
> > >
> > >    //
> > > -  // Pack UGA Draw protocol parameters to
> > > EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
> > > -  // GopBlt() API of Unix UGA IO protocol.
> > > +  // Pack GOP protocol parameters to
> > EMU_GRAPHICS_WINDOWS__BLT_ARGS
> > > + structure to adapt to  // GopBlt() API of GOP protocol.
> > >    //
> > >    GopBltArgs.DestinationX = DestinationX;
> > >    GopBltArgs.DestinationY = DestinationY; @@ -232,8 +232,8 @@
> > > EmuGopBlt (
> > >    GopBltArgs.Delta        = Delta;
> > >    Status                  = Private->EmuGraphicsWindow->Blt (
> > >                                                            Private->EmuGraphicsWindow,
> > > -                                                          (EFI_UGA_PIXEL *)BltBuffer,
> > > -                                                          (EFI_UGA_BLT_OPERATION)BltOperation,
> > > +                                                          BltBuffer,
> > > +
> > > + BltOperation,
> > >                                                            &GopBltArgs
> > >                                                            );
> > >
> > > @@ -384,7 +384,7 @@ ShutdownGopEvent (
> > >
> > >  Routine Description:
> > >
> > > -  This is the UGA screen's callback notification function for exit-boot-
> > services.
> > > +  This is the screen's callback notification function for exit-boot-services.
> > >    All we do here is call EmuGopDestructor().
> > >
> > >  Arguments:
> > > diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > > b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > > index 15de43ac022e..062508fafc9d 100644
> > > --- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > > +++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> > > @@ -7,19 +7,19 @@
> > >
> > >    UEFI 2.0 can boot from any valid EFI image contained in a
> > SimpleFileSystem.
> > >
> > > -Copyright (c) 2006 - 2010, Intel Corporation. All rights
> > > reserved.<BR>
> > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  Portions copyright (c) 2011, Apple Inc. All rights reserved.
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  **/
> > >
> > > -#ifndef _EMU_UGA_IO_H_
> > > -#define _EMU_UGA_IO_H_
> > > +#ifndef EMU_GRAPHICS_WINDOW_H_
> > > +#define EMU_GRAPHICS_WINDOW_H_
> > >
> > >  #include <Protocol/SimplePointer.h>
> > >  #include <Protocol/SimpleTextIn.h>
> > >  #include <Protocol/SimpleTextInEx.h>
> > > -#include <Protocol/UgaDraw.h>
> > > +#include <Protocol/GraphicsOutput.h>
> > >
> > >  #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
> > >   { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8,
> > > 0xCA, 0xC1 } } @@ -29,13 +29,13 @@ typedef struct
> > > _EMU_GRAPHICS_WINDOW_PROTOCOL
> > EMU_GRAPHICS_WINDOW_PROTOCOL;  typedef
> > > EFI_STATUS  (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
> > >    );
> > >
> > >  typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
> > >    UINT32                        Width,
> > >    UINT32                        Height
> > >    );
> > > @@ -43,13 +43,13 @@ EFI_STATUS
> > >  typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
> > >    );
> > >
> > >  typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindows,
> > >    EFI_KEY_DATA                  *key
> > >    );
> > >
> > > @@ -88,10 +88,10 @@ typedef struct {
> > >  typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
> > > -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
> > > -  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
> > > -  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
> > > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
> > > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> > >    );
> > >
> > >  typedef
> > > diff --git a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > > b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > > index 7c495b25eb1b..ed7b71611f90 100644
> > > --- a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > > +++ b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> > > @@ -6,13 +6,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  **/
> > >
> > > -#ifndef _EMU_UGA_IO_H_
> > > -#define _EMU_UGA_IO_H_
> > > +#ifndef EMU_GRAPHICS_WINDOW_H_
> > > +#define EMU_GRAPHICS_WINDOW_H_
> > >
> > >  #include <Protocol/SimplePointer.h>
> > >  #include <Protocol/SimpleTextIn.h>
> > >  #include <Protocol/SimpleTextInEx.h>
> > > -#include <Protocol/UgaDraw.h>
> > > +#include <Protocol/GraphicsOutput.h>
> > >
> > >  #define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
> > >   { 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8,
> > > 0xCA, 0xC1 } } @@ -22,13 +22,13 @@ typedef struct
> > > _EMU_GRAPHICS_WINDOW_PROTOCOL
> > EMU_GRAPHICS_WINDOW_PROTOCOL;  typedef
> > > EFI_STATUS  (EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
> > >    );
> > >
> > >  typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
> > >    UINT32                        Width,
> > >    UINT32                        Height
> > >    );
> > > @@ -36,13 +36,13 @@ EFI_STATUS
> > >  typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
> > >    );
> > >
> > >  typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
> > > -  EMU_GRAPHICS_WINDOW_PROTOCOL  *Uga,
> > > +  EMU_GRAPHICS_WINDOW_PROTOCOL  *GraphicsWindow,
> > >    EFI_KEY_DATA                  *key
> > >    );
> > >
> > > @@ -83,8 +83,8 @@ typedef
> > >  EFI_STATUS
> > >  (EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
> > >    IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsWindows,
> > > -  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
> > > -  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer OPTIONAL,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,
> > >    IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS          *Args
> > >    );
> > >
> > > diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > > b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > > index b89ffd77e4de..462049e2b048 100644
> > > --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > > +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> > > @@ -1,6 +1,6 @@
> > >  /*++ @file
> > >
> > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights
> > > reserved.<BR>
> > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  Portions copyright (c) 2011, Apple Inc. All rights reserved.
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > @@ -60,7 +60,7 @@ typedef struct {
> > >    EMU_VENDOR_DEVICE_PATH_NODE    EmuBus;
> > >    EMU_VENDOR_DEVICE_PATH_NODE    EmuGraphicsWindow;
> > >    EFI_DEVICE_PATH_PROTOCOL       End;
> > > -} EMU_PLATFORM_UGA_DEVICE_PATH;
> > > +} EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH;
> > >
> > >  //
> > >  // Platform BDS Functions
> > > diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > > b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > > index efb03def37eb..b69c4728d1a7 100644
> > > --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > > +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> > > @@ -1,6 +1,6 @@
> > >  /*++ @file
> > >
> > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights
> > > reserved.<BR>
> > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  Portions copyright (c) 2011, Apple Inc. All rights reserved.
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > @@ -8,7 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  #include "PlatformBm.h"
> > >
> > > -EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath = {
> > > +EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH  gGopDevicePath
> > = {
> > >    {
> > >      {
> > >        {
> > > @@ -40,7 +40,7 @@ EMU_PLATFORM_UGA_DEVICE_PATH
> > gGopDevicePath = {
> > >    gEndEntire
> > >  };
> > >
> > > -EMU_PLATFORM_UGA_DEVICE_PATH  gGopDevicePath2 = {
> > > +EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH
> > gGopDevicePath2 = {
> > >    {
> > >      {
> > >        {
> > > diff --git a/EmulatorPkg/Unix/Host/Gasket.h
> > > b/EmulatorPkg/Unix/Host/Gasket.h index 6dafc903cfce..1ffdfb334524
> > > 100644
> > > --- a/EmulatorPkg/Unix/Host/Gasket.h
> > > +++ b/EmulatorPkg/Unix/Host/Gasket.h
> > > @@ -1,7 +1,7 @@
> > >  /** @file
> > >
> > >    Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
> > > -  Copyright (c) 2011 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > > +  Copyright (c) 2011 - 2022, Intel Corporation. All rights
> > > + reserved.<BR>
> > >
> > >    SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > @@ -200,7 +200,7 @@ ReverseGasketUint64Uint64 (
> > >    );
> > >
> > >  //
> > > -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> > > +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
> > >  //
> > >
> > >  EFI_STATUS
> > > @@ -243,10 +243,10 @@ GasketX11RegisterKeyNotify (  EFI_STATUS
> > EFIAPI
> > > GasketX11Blt (
> > > -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsWindows,
> > > -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> > > -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> > > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> > > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsWindows,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> > >    );
> > >
> > >  EFI_STATUS
> > > diff --git a/EmulatorPkg/Unix/Host/Host.h
> > > b/EmulatorPkg/Unix/Host/Host.h index 0c81cdfc01f5..ff30f5dce567 100644
> > > --- a/EmulatorPkg/Unix/Host/Host.h
> > > +++ b/EmulatorPkg/Unix/Host/Host.h
> > > @@ -1,6 +1,6 @@
> > >  /*++ @file
> > >
> > > -Copyright (c) 2006 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  Portions copyright (c) 2008 - 2011, Apple Inc. All rights
> > > reserved.<BR>
> > >
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent @@ -106,7 +106,6 @@
> > > SPDX-License-Identifier: BSD-2-Clause-Patent  #include
> > > <Protocol/SimplePointer.h>  #include <Protocol/SimpleTextIn.h>
> > > #include <Protocol/SimpleTextInEx.h> -#include <Protocol/UgaDraw.h>
> > > #include <Protocol/SimpleFileSystem.h>
> > >
> > >  #include <Protocol/EmuThunk.h>
> > > diff --git a/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > > b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > > index 36197ff26028..6fcdd265cf30 100644
> > > --- a/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > > +++ b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
> > > @@ -371,7 +371,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
> > >    ret
> > >
> > >  //
> > > -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> > > +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
> > >  //
> > >
> > >  ASM_GLOBAL ASM_PFX(GasketX11Size)
> > > diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > > b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > > index a30cc19dbe0a..b3880e198855 100644
> > > --- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > > +++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> > > @@ -1,6 +1,6 @@
> > >  /*++ @file
> > >
> > > -Copyright (c) 2004 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > > +Copyright (c) 2004 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  Portions copyright (c) 2008 - 2011, Apple Inc. All rights
> > > reserved.<BR>
> > >
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent @@ -700,8 +700,8 @@
> > > HandleEvents (
> > >
> > >  unsigned long
> > >  X11PixelToColor (
> > > -  IN  GRAPHICS_IO_PRIVATE  *Drv,
> > > -  IN  EFI_UGA_PIXEL        pixel
> > > +  IN  GRAPHICS_IO_PRIVATE            *Drv,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  pixel
> > >    )
> > >  {
> > >    return ((pixel.Red   >> Drv->r.csize) << Drv->r.shift)
> > > @@ -709,15 +709,15 @@ X11PixelToColor (
> > >           | ((pixel.Blue  >> Drv->b.csize) << Drv->b.shift);  }
> > >
> > > -EFI_UGA_PIXEL
> > > +EFI_GRAPHICS_OUTPUT_BLT_PIXEL
> > >  X11ColorToPixel (
> > >    IN  GRAPHICS_IO_PRIVATE  *Drv,
> > >    IN  unsigned long        val
> > >    )
> > >  {
> > > -  EFI_UGA_PIXEL  Pixel;
> > > +  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Pixel;
> > >
> > > -  memset (&Pixel, 0, sizeof (EFI_UGA_PIXEL));
> > > +  memset (&Pixel, 0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> > >
> > >    // Truncation not an issue since X11 and EFI are both using 8 bits per color
> > >    Pixel.Red   =   (val >> Drv->r.shift) << Drv->r.csize;
> > > @@ -782,7 +782,7 @@ X11KeySetState (
> > >      if ((Drv->KeyState.KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == 0) {
> > >        //
> > >        // We could create an XKeyEvent and send a XK_Caps_Lock to
> > > -      // the UGA/GOP Window
> > > +      // the GOP Window
> > >        //
> > >      }
> > >    }
> > > @@ -812,32 +812,32 @@ X11RegisterKeyNotify (
> > >
> > >  EFI_STATUS
> > >  X11Blt (
> > > -  IN EMU_GRAPHICS_WINDOW_PROTOCOL     *GraphicsIo,
> > > -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> > > -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> > > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> > > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> > >    )
> > >  {
> > > -  GRAPHICS_IO_PRIVATE  *Private;
> > > -  UINTN                DstY;
> > > -  UINTN                SrcY;
> > > -  UINTN                DstX;
> > > -  UINTN                SrcX;
> > > -  UINTN                Index;
> > > -  EFI_UGA_PIXEL        *Blt;
> > > -  UINT8                *Dst;
> > > -  UINT8                *Src;
> > > -  UINTN                Nbr;
> > > -  unsigned long        Color;
> > > -  XEvent               ev;
> > > +  GRAPHICS_IO_PRIVATE            *Private;
> > > +  UINTN                          DstY;
> > > +  UINTN                          SrcY;
> > > +  UINTN                          DstX;
> > > +  UINTN                          SrcX;
> > > +  UINTN                          Index;
> > > +  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  *Blt;
> > > +  UINT8                          *Dst;
> > > +  UINT8                          *Src;
> > > +  UINTN                          Nbr;
> > > +  unsigned long                  Color;
> > > +  XEvent                         ev;
> > >
> > >    Private = (GRAPHICS_IO_PRIVATE *)GraphicsIo;
> > >
> > >    //
> > >    //  Check bounds
> > >    //
> > > -  if (  (BltOperation == EfiUgaVideoToBltBuffer)
> > > -     || (BltOperation == EfiUgaVideoToVideo))
> > > +  if (  (BltOperation == EfiBltVideoToBltBuffer)
> > > +     || (BltOperation == EfiBltVideoToVideo))
> > >    {
> > >      //
> > >      // Source is Video.
> > > @@ -851,9 +851,9 @@ X11Blt (
> > >      }
> > >    }
> > >
> > > -  if (  (BltOperation == EfiUgaBltBufferToVideo)
> > > -     || (BltOperation == EfiUgaVideoToVideo)
> > > -     || (BltOperation == EfiUgaVideoFill))
> > > +  if (  (BltOperation == EfiBltBufferToVideo)
> > > +     || (BltOperation == EfiBltVideoToVideo)
> > > +     || (BltOperation == EfiBltVideoFill))
> > >    {
> > >      //
> > >      // Destination is Video
> > > @@ -868,32 +868,32 @@ X11Blt (
> > >    }
> > >
> > >    switch (BltOperation) {
> > > -    case EfiUgaVideoToBltBuffer:
> > > -      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY
> > * Args->Delta) + Args->DestinationX * sizeof
> > > (EFI_UGA_PIXEL));
> > > -      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
> > > +    case EfiBltVideoToBltBuffer:
> > > +      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer +
> > (Args->DestinationY * Args->Delta) + Args-
> > > >DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> > > +      Args->Delta -= Args->Width * sizeof
> > > + (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> > >        for (SrcY = Args->SourceY; SrcY < (Args->Height + Args->SourceY);
> > SrcY++) {
> > >          for (SrcX = Args->SourceX; SrcX < (Args->Width + Args->SourceX);
> > SrcX++) {
> > >            *Blt++ = X11ColorToPixel (Private, XGetPixel (Private->image, SrcX,
> > SrcY));
> > >          }
> > >
> > > -        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
> > > +        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt +
> > > + Args->Delta);
> > >        }
> > >
> > >        break;
> > > -    case EfiUgaBltBufferToVideo:
> > > -      Blt          = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY *
> > Args->Delta) + Args->SourceX * sizeof
> > > (EFI_UGA_PIXEL));
> > > -      Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
> > > +    case EfiBltBufferToVideo:
> > > +      Blt          = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer +
> > (Args->SourceY * Args->Delta) + Args-
> > > >SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
> > > +      Args->Delta -= Args->Width * sizeof
> > > + (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
> > >        for (DstY = Args->DestinationY; DstY < (Args->Height + Args-
> > >DestinationY); DstY++) {
> > >          for (DstX = Args->DestinationX; DstX < (Args->Width + Args-
> > >DestinationX); DstX++) {
> > >            XPutPixel (Private->image, DstX, DstY, X11PixelToColor (Private, *Blt));
> > >            Blt++;
> > >          }
> > >
> > > -        Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
> > > +        Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt +
> > > + Args->Delta);
> > >        }
> > >
> > >        break;
> > > -    case EfiUgaVideoToVideo:
> > > +    case EfiBltVideoToVideo:
> > >        Dst = Private->image_data + (Args->DestinationX << Private-
> > >pixel_shift)
> > >              + Args->DestinationY * Private->line_bytes;
> > >        Src = Private->image_data + (Args->SourceX <<
> > > Private->pixel_shift) @@ -920,7 +920,7 @@ X11Blt (
> > >        }
> > >
> > >        break;
> > > -    case EfiUgaVideoFill:
> > > +    case EfiBltVideoFill:
> > >        Color = X11PixelToColor (Private, *BltBuffer);
> > >        for (DstY = Args->DestinationY; DstY < (Args->Height + Args-
> > >DestinationY); DstY++) {
> > >          for (DstX = Args->DestinationX; DstX < (Args->Width +
> > > Args->DestinationX); DstX++) { @@ -937,7 +937,7 @@ X11Blt (
> > >    //  Refresh screen.
> > >    //
> > >    switch (BltOperation) {
> > > -    case EfiUgaVideoToVideo:
> > > +    case EfiBltVideoToVideo:
> > >        XCopyArea (
> > >          Private->display,
> > >          Private->win,
> > > @@ -960,7 +960,7 @@ X11Blt (
> > >        }
> > >
> > >        break;
> > > -    case EfiUgaVideoFill:
> > > +    case EfiBltVideoFill:
> > >        Color = X11PixelToColor (Private, *BltBuffer);
> > >        XSetForeground (Private->display, Private->gc, Color);
> > >        XFillRectangle (
> > > @@ -974,7 +974,7 @@ X11Blt (
> > >          );
> > >        XFlush (Private->display);
> > >        break;
> > > -    case EfiUgaBltBufferToVideo:
> > > +    case EfiBltBufferToVideo:
> > >        Redraw (Private, Args->DestinationX, Args->DestinationY, Args->Width,
> > Args->Height);
> > >        break;
> > >      default:
> > > diff --git a/EmulatorPkg/Unix/Host/X64/Gasket.S
> > > b/EmulatorPkg/Unix/Host/X64/Gasket.S
> > > index 030faa8e4c36..1b4614ab618d 100644
> > > --- a/EmulatorPkg/Unix/Host/X64/Gasket.S
> > > +++ b/EmulatorPkg/Unix/Host/X64/Gasket.S
> > > @@ -427,7 +427,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
> > >    ret
> > >
> > >  //
> > > -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> > > +// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
> > >  //
> > >
> > >  ASM_GLOBAL ASM_PFX(GasketX11Size)
> > > diff --git a/EmulatorPkg/Win/Host/WinGopScreen.c
> > > b/EmulatorPkg/Win/Host/WinGopScreen.c
> > > index 661573d7771c..69abcfc79564 100644
> > > --- a/EmulatorPkg/Win/Host/WinGopScreen.c
> > > +++ b/EmulatorPkg/Win/Host/WinGopScreen.c
> > > @@ -1,6 +1,6 @@
> > >  /** @file
> > >
> > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights
> > > reserved.<BR>
> > > +Copyright (c) 2006 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  Module Name:
> > > @@ -396,10 +396,10 @@ WinNtWndSize (
> > >  // TODO:    Delta - add argument and description to function comment
> > >  EFI_STATUS
> > >  WinNtWndBlt (
> > > -  IN  EMU_GRAPHICS_WINDOW_PROTOCOL    *GraphicsIo,
> > > -  IN  EFI_UGA_PIXEL                   *BltBuffer OPTIONAL,
> > > -  IN  EFI_UGA_BLT_OPERATION           BltOperation,
> > > -  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS  *Args
> > > +  IN  EMU_GRAPHICS_WINDOW_PROTOCOL       *GraphicsIo,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer OPTIONAL,
> > > +  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
> > > +  IN  EMU_GRAPHICS_WINDOWS__BLT_ARGS     *Args
> > >    )
> > >  {
> > >    RETURN_STATUS          RStatus;
> > > --
> > > 2.26.2.windows.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Patch v2 10/11] BaseTools: Remove all UGA support
  2022-07-15  1:51 ` [Patch v2 10/11] BaseTools: Remove all UGA support Guomin Jiang
@ 2022-07-24  5:37   ` Bob Feng
  0 siblings, 0 replies; 24+ messages in thread
From: Bob Feng @ 2022-07-24  5:37 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: Gao, Liming, Chen, Christine

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@intel.com> 
Sent: Friday, July 15, 2022 9:51 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [Patch v2 10/11] BaseTools: Remove all UGA support

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove UGA code in BaseTools

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
---
 .../Source/C/Include/Protocol/HiiFramework.h  |  53 +-----  BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 ------------------
 2 files changed, 1 insertion(+), 213 deletions(-)  delete mode 100644 BaseTools/Source/C/Include/Protocol/UgaDraw.h

diff --git a/BaseTools/Source/C/Include/Protocol/HiiFramework.h b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
index 448350967bbf..4c651f89e0eb 100644
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
@@ -6,7 +6,7 @@
   @par Revision Reference:
   This protocol is defined in HII spec 0.92.
 
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights 
+ reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -28,20 +28,6 @@
     0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
   }
 
-// BugBug:
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-// If UGA goes away we need to put this some place. I'm not sure where?
-//
-//typedef struct {
-//  UINT8 Blue;
-//  UINT8 Green;
-//  UINT8 Red;
-//  UINT8 Reserved;
-//} EFI_UGA_PIXEL;
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//
-
 typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;
 
 //
@@ -575,39 +561,6 @@ EFI_STATUS
   IN OUT UINT32            *InternalStatus
   );
 
-/**
-  Translates a glyph into the format required for input to the Universal
-  Graphics Adapter (UGA) Block Transfer (BLT) routines.
-
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.
-  @param  GlyphBuffer           A pointer to the buffer that contains glyph data.
-  @param  Foreground            The foreground setting requested to be used for the
-                                generated BltBuffer data.
-  @param  Background            The background setting requested to be used for the
-                                generated BltBuffer data.
-  @param  Count                 The entry in the BltBuffer upon which to act.
-  @param  Width                 The width in bits of the glyph being converted.
-  @param  Height                The height in bits of the glyph being converted
-  @param  BltBuffer             A pointer to the buffer that contains the data that is
-                                ready to be used by the UGA BLT routines.
-
-  @retval EFI_SUCCESS           It worked.
-  @retval EFI_NOT_FOUND         A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
-  IN     EFI_HII_PROTOCOL             *This,
-  IN     UINT8                        *GlyphBuffer,
-  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
-  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
-  IN     UINTN                         Count,
-  IN     UINTN                         Width,
-  IN     UINTN                         Height,
-  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
-  );
-
 /**
   Allows a new string to be added to an already existing string package.
 
@@ -878,9 +831,6 @@ EFI_STATUS
   @param GetGlyph
   Translates a Unicode character into the corresponding font glyph.
 
-  @param GlyphToBlt
-  Converts a glyph value into a format that is ready for a UGA BLT command.
-
   @param NewString
   Allows a new string to be added to an already existing string package.
 
@@ -924,7 +874,6 @@ struct _EFI_HII_PROTOCOL {
 
   EFI_HII_TEST_STRING         TestString;
   EFI_HII_GET_GLYPH           GetGlyph;
-  EFI_HII_GLYPH_TO_BLT        GlyphToBlt;
 
   EFI_HII_NEW_STRING          NewString;
   EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;
diff --git a/BaseTools/Source/C/Include/Protocol/UgaDraw.h b/BaseTools/Source/C/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 412b000aeb6b..000000000000
--- a/BaseTools/Source/C/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
-  UGA Draw protocol from the EFI 1.1 specification.
-
-  Abstraction of a very simple graphics device.
-
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
-  { \
-    0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
-  }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
-  Return the current video mode information.
-
-  @param  This                  Protocol instance pointer.
-  @param  HorizontalResolution  Current video horizontal resolution in pixels
-  @param  VerticalResolution    Current video vertical resolution in pixels
-  @param  ColorDepth            Current video color depth in bits per pixel
-  @param  RefreshRate           Current video refresh rate in Hz.
-
-  @retval EFI_SUCCESS           Mode information returned.
-  @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()
-  @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
-  IN  EFI_UGA_DRAW_PROTOCOL *This,
-  OUT UINT32                *HorizontalResolution,
-  OUT UINT32                *VerticalResolution,
-  OUT UINT32                *ColorDepth,
-  OUT UINT32                *RefreshRate
-  )
-;
-
-/**
-  Return the current video mode information.
-
-  @param  This                 Protocol instance pointer.
-  @param  HorizontalResolution Current video horizontal resolution in pixels
-  @param  VerticalResolution   Current video vertical resolution in pixels
-  @param  ColorDepth           Current video color depth in bits per pixel
-  @param  RefreshRate          Current video refresh rate in Hz.
-
-  @retval EFI_SUCCESS          Mode information returned.
-  @retval EFI_NOT_STARTED      Video display is not initialized. Call SetMode ()
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
-  IN  EFI_UGA_DRAW_PROTOCOL *This,
-  IN  UINT32                HorizontalResolution,
-  IN  UINT32                VerticalResolution,
-  IN  UINT32                ColorDepth,
-  IN  UINT32                RefreshRate
-  )
-;
-
-typedef struct {
-  UINT8 Blue;
-  UINT8 Green;
-  UINT8 Red;
-  UINT8 Reserved;
-} EFI_UGA_PIXEL;
-
-typedef union {
-  EFI_UGA_PIXEL Pixel;
-  UINT32        Raw;
-} EFI_UGA_PIXEL_UNION;
-
-typedef enum {
-  EfiUgaVideoFill,
-  EfiUgaVideoToBltBuffer,
-  EfiUgaBltBufferToVideo,
-  EfiUgaVideoToVideo,
-  EfiUgaBltMax
-} EFI_UGA_BLT_OPERATION;
-
-/**
-  Type specifying a pointer to a function to perform an UGA Blt operation.
-
-    The following table defines actions for BltOperations:
-
-    <B>EfiUgaVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY)
-      directly to every pixel of the video display rectangle
-      (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
-      Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
-    <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
-      the BltBuffer rectangle (DestinationX, DestinationY )
-      (DestinationX + Width, DestinationY + Height). If DestinationX or
-      DestinationY is not zero then Delta must be set to the length in bytes
-      of a row in the BltBuffer.
-
-    <B>EfiUgaBltBufferToVideo</B> - Write data from the  BltBuffer rectangle
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
-      video display rectangle (DestinationX, DestinationY)
-      (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
-      not zero then Delta must be set to the length in bytes of a row in the
-      BltBuffer.
-
-    <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
-     (SourceX + Width, SourceY + Height) .to the video display rectangle
-     (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
-     The BltBuffer and Delta  are not used in this mode.
-
-
-    @param[in] This          - Protocol instance pointer.
-    @param[in] BltBuffer     - Buffer containing data to blit into video buffer. This
-                               buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
-    @param[in] BltOperation  - Operation to perform on BlitBuffer and video memory
-    @param[in] SourceX       - X coordinate of source for the BltBuffer.
-    @param[in] SourceY       - Y coordinate of source for the BltBuffer.
-    @param[in] DestinationX  - X coordinate of destination for the BltBuffer.
-    @param[in] DestinationY  - Y coordinate of destination for the BltBuffer.
-    @param[in] Width         - Width of rectangle in BltBuffer in pixels.
-    @param[in] Height        - Height of rectangle in BltBuffer in pixels.
-    @param[in] Delta         - OPTIONAL
-
-    @retval EFI_SUCCESS           - The Blt operation completed.
-    @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
-    @retval EFI_DEVICE_ERROR      - A hardware error occurred writing to the video buffer.
-
---*/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
-  IN  EFI_UGA_DRAW_PROTOCOL                   * This,
-  IN  EFI_UGA_PIXEL                           * BltBuffer, OPTIONAL
-  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
-  IN  UINTN                                   SourceX,
-  IN  UINTN                                   SourceY,
-  IN  UINTN                                   DestinationX,
-  IN  UINTN                                   DestinationY,
-  IN  UINTN                                   Width,
-  IN  UINTN                                   Height,
-  IN  UINTN                                   Delta         OPTIONAL
-  );
-
-struct _EFI_UGA_DRAW_PROTOCOL {
-  EFI_UGA_DRAW_PROTOCOL_GET_MODE  GetMode;
-  EFI_UGA_DRAW_PROTOCOL_SET_MODE  SetMode;
-  EFI_UGA_DRAW_PROTOCOL_BLT       Blt;
-};
-
-extern EFI_GUID gEfiUgaDrawProtocolGuid;
-
-#endif
--
2.26.2.windows.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [edk2-devel] [Patch v2 00/11] Remove all UGA support
  2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
                   ` (10 preceding siblings ...)
  2022-07-15  1:51 ` [Patch v2 11/11] MdePkg/UefiLib: " Guomin Jiang
@ 2022-10-24 18:06 ` Michael D Kinney
  11 siblings, 0 replies; 24+ messages in thread
From: Michael D Kinney @ 2022-10-24 18:06 UTC (permalink / raw)
  To: devel@edk2.groups.io, Jiang, Guomin, Kinney, Michael D

Hi,

What is the status of this patch series and BZ? I think it would be really good to remove
UGA usage from edk2 for the next stable tag release.

Thanks,

Mike



> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Guomin Jiang
> Sent: Thursday, July 14, 2022 6:51 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [Patch v2 00/11] Remove all UGA support
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> The Plan:
> 1. Remove the upstream UGA code first but keep definition in Edk2 at
> first
> 2. Then downstream owner to remove UGA related code
> 3. Remove Edk2 definition last.
> 
> GuoMinJ (9):
>   UefiPayloadPkg: Remove All UGA Support
>   ArmVirtPkg: Remove All UGA Support
>   ArmPkg: Remove All UGA Support
>   EmulatorPkg: Remove All UGA Support
>   ShellPkg: Remove All UGA Support
>   OvmfPkg: Remove All UGA Support
>   MdeModulePkg/ConSplitterDxe: Remove All UGA Support
>   MdeModulePkg/GraphicsConsoleDxe: Remove All UGA Support
>   MdeModulePkg: Remove All UGA Support
> 
> Guomin Jiang (2):
>   BaseTools: Remove all UGA support
>   MdePkg/UefiLib: Remove all UGA support
> 
>  .../PlatformBootManagerLib/PlatformBm.h       |   4 +-
>  .../PlatformBootManagerLib.inf                |   5 +-
>  ArmVirtPkg/ArmVirtQemu.dsc                    |   7 +-
>  ArmVirtPkg/ArmVirtQemuKernel.dsc              |   7 +-
>  .../Source/C/Include/Protocol/HiiFramework.h  |  53 +--
>  BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 -------
>  EmulatorPkg/EmuGopDxe/Gop.h                   |  10 +-
>  EmulatorPkg/EmuGopDxe/GopScreen.c             |  14 +-
>  EmulatorPkg/Include/Protocol/EmuFileSystem.h  |  24 +-
>  .../Include/Protocol/EmuGraphicsWindow.h      |  18 +-
>  .../Library/PlatformBmLib/PlatformBm.h        |   4 +-
>  .../Library/PlatformBmLib/PlatformBmData.c    |   6 +-
>  EmulatorPkg/Unix/Host/Gasket.h                |  12 +-
>  EmulatorPkg/Unix/Host/Host.h                  |   3 +-
>  EmulatorPkg/Unix/Host/Ia32/Gasket.S           |   2 +-
>  EmulatorPkg/Unix/Host/X11GraphicsWindow.c     |  82 ++--
>  EmulatorPkg/Unix/Host/X64/Gasket.S            |   2 +-
>  EmulatorPkg/Win/Host/WinGopScreen.c           |  10 +-
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c       |   4 +-
>  MdeModulePkg/Include/Library/BootLogoLib.h    |   4 +-
>  .../Library/BootLogoLib/BootLogoLib.c         | 228 +++-------
>  .../Library/BootLogoLib/BootLogoLib.inf       |   6 +-
>  .../Console/ConSplitterDxe/ConSplitter.c      | 405 +++---------------
>  .../Console/ConSplitterDxe/ConSplitter.h      | 138 +-----
>  .../Console/ConSplitterDxe/ConSplitterDxe.inf |  17 +-
>  .../Console/ConSplitterDxe/ConSplitterDxe.uni |  12 +-
>  .../ConSplitterDxe/ConSplitterGraphics.c      | 310 +-------------
>  .../GraphicsConsoleDxe/GraphicsConsole.c      | 300 +------------
>  .../GraphicsConsoleDxe/GraphicsConsole.h      |  21 +-
>  .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf |   8 +-
>  .../GraphicsConsoleDxe/GraphicsConsoleDxe.uni |   6 +-
>  MdeModulePkg/Universal/HiiDatabaseDxe/Image.c |   4 +-
>  MdePkg/Library/UefiLib/UefiLib.inf            |   4 +-
>  MdePkg/Library/UefiLib/UefiLibInternal.h      |   3 +-
>  MdePkg/Library/UefiLib/UefiLibPrint.c         |  91 +---
>  MdePkg/MdePkg.dsc                             |   3 -
>  OvmfPkg/AmdSev/AmdSevX64.dsc                  |   4 +-
>  OvmfPkg/Bhyve/BhyveX64.dsc                    |   4 +-
>  OvmfPkg/Microvm/MicrovmX64.dsc                |   4 +-
>  OvmfPkg/OvmfPkgIa32.dsc                       |   2 -
>  OvmfPkg/OvmfPkgIa32X64.dsc                    |   2 -
>  OvmfPkg/OvmfPkgX64.dsc                        |   2 -
>  OvmfPkg/OvmfXen.dsc                           |   4 +-
>  .../UefiHandleParsingLib.c                    |   4 +-
>  .../UefiHandleParsingLib.h                    |   4 +-
>  .../UefiHandleParsingLib.inf                  |   4 +-
>  .../UefiHandleParsingLib.uni                  |   4 +-
>  .../PlatformBootManager.h                     |   4 +-
>  .../PlatformBootManagerLib.inf                |   4 +-
>  UefiPayloadPkg/UefiPayloadPkg.dsc             |   2 -
>  50 files changed, 276 insertions(+), 1760 deletions(-)
>  delete mode 100644 BaseTools/Source/C/Include/Protocol/UgaDraw.h
> 
> --
> 2.26.2.windows.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-10-24 18:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-15  1:50 [Patch v2 00/11] Remove all UGA support Guomin Jiang
2022-07-15  1:50 ` [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support Guomin Jiang
2022-07-15  2:21   ` Ni, Ray
2022-07-15  1:50 ` [Patch v2 02/11] ArmVirtPkg: " Guomin Jiang
2022-07-15  9:42   ` Sami Mujawar
2022-07-18 12:23     ` [edk2-devel] " Guomin Jiang
2022-07-18 16:42       ` Sami Mujawar
2022-07-15  1:50 ` [Patch v2 03/11] ArmPkg: " Guomin Jiang
2022-07-15 13:32   ` Sami Mujawar
2022-07-15  1:50 ` [Patch v2 04/11] EmulatorPkg: " Guomin Jiang
2022-07-15  2:23   ` Ni, Ray
2022-07-19  0:54     ` Guomin Jiang
2022-07-19  0:56       ` Ni, Ray
2022-07-15  1:51 ` [Patch v2 05/11] ShellPkg: " Guomin Jiang
2022-07-15  2:20   ` Ni, Ray
2022-07-15  1:51 ` [Patch v2 06/11] OvmfPkg: " Guomin Jiang
2022-07-15  1:51 ` [Patch v2 07/11] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
2022-07-15  1:51 ` [Patch v2 08/11] MdeModulePkg/GraphicsConsoleDxe: " Guomin Jiang
2022-07-15  1:51 ` [Patch v2 09/11] MdeModulePkg: " Guomin Jiang
2022-07-15  1:51 ` [Patch v2 10/11] BaseTools: Remove all UGA support Guomin Jiang
2022-07-24  5:37   ` Bob Feng
2022-07-15  1:51 ` [Patch v2 11/11] MdePkg/UefiLib: " Guomin Jiang
2022-07-15 16:23   ` Michael D Kinney
2022-10-24 18:06 ` [edk2-devel] [Patch v2 00/11] " Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox