public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 00/18] Remove All UGA Support
@ 2020-05-08  8:38 Guomin Jiang
  2020-05-08  8:38 ` [PATCH 01/18] BaseTools: " Guomin Jiang
                   ` (18 more replies)
  0 siblings, 19 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel

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

UGA is replaced by GOP and remove all related code.

GuoMinJ (18):
  BaseTools: Remove All UGA Support
  UefiPayloadPkg: Remove All UGA Support
  ShellPkg: Remove All UGA Support
  MdeModulePkg: Remove All UGA Support
  MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  MdeModulePkg/GraphicsConsoleDxe: Remove All UGA Support
  EmulatorPkg: Remove All UGA Support
  OvmfPkg: Remove All UGA Support
  ArmPkg: Remove All UGA Support
  ArmVirtPkg: Remove All UGA Support
  MdePkg: Remove All UGA Support
  MdeModulePkg: Remove All UGA Support
  MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  MdeModulePkg/ConSplitterDxe: Remove All UGA Support.
  OvmfPkg: Remove All UGA Support
  UefiPayloadPkg: Remove All UGA Support
  ArmVirtPkg: Remove All UGA Support
  MdeModulePkg: Remove All UGA Support

 .../PlatformBootManagerLib/PlatformBm.h       |   2 +-
 .../PlatformBootManagerLib.inf                |   3 -
 ArmVirtPkg/ArmVirtQemu.dsc                    |   5 -
 ArmVirtPkg/ArmVirtQemuKernel.dsc              |   5 -
 .../Source/C/Include/Protocol/HiiFramework.h  |  51 ---
 BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 --------
 EmulatorPkg/EmuGopDxe/Gop.h                   |   8 +-
 EmulatorPkg/EmuGopDxe/GopScreen.c             |  14 +-
 EmulatorPkg/Include/Protocol/EmuFileSystem.h  |  18 +-
 .../Include/Protocol/EmuGraphicsWindow.h      |  18 +-
 .../Library/PlatformBmLib/PlatformBm.h        |   2 +-
 .../Library/PlatformBmLib/PlatformBmData.c    |   4 +-
 EmulatorPkg/Unix/Host/Gasket.h                |   9 +-
 EmulatorPkg/Unix/Host/Host.h                  |   1 -
 EmulatorPkg/Unix/Host/Ia32/Gasket.S           |   2 +-
 EmulatorPkg/Unix/Host/X11GraphicsWindow.c     |  54 +--
 EmulatorPkg/Unix/Host/X64/Gasket.S            |   2 +-
 EmulatorPkg/Win/Host/WinGopScreen.c           |   4 +-
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c       |   2 +-
 MdeModulePkg/Include/Library/BootLogoLib.h    |   2 +-
 .../Library/BootLogoLib/BootLogoLib.c         | 224 +++--------
 .../Library/BootLogoLib/BootLogoLib.inf       |   4 -
 MdeModulePkg/MdeModulePkg.dec                 |  14 -
 MdeModulePkg/MdeModulePkg.uni                 |  12 -
 .../Console/ConSplitterDxe/ConSplitter.c      | 368 ++++--------------
 .../Console/ConSplitterDxe/ConSplitter.h      | 135 +------
 .../Console/ConSplitterDxe/ConSplitterDxe.inf |  17 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.uni |  12 +-
 .../ConSplitterDxe/ConSplitterGraphics.c      | 307 ---------------
 .../GraphicsConsoleDxe/GraphicsConsole.c      | 299 +-------------
 .../GraphicsConsoleDxe/GraphicsConsole.h      |  19 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf |   6 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.uni |   4 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/Image.c |   2 +-
 MdePkg/Include/Protocol/UgaDraw.h             | 160 --------
 MdePkg/Include/Protocol/UgaIo.h               | 191 ---------
 MdePkg/Library/UefiLib/UefiLib.inf            |   2 -
 MdePkg/Library/UefiLib/UefiLibInternal.h      |   1 -
 MdePkg/Library/UefiLib/UefiLibPrint.c         |  88 -----
 MdePkg/MdePkg.dec                             |  12 -
 MdePkg/MdePkg.dsc                             |   3 -
 MdePkg/MdePkg.uni                             |   6 -
 OvmfPkg/OvmfPkgIa32.dsc                       |   2 -
 OvmfPkg/OvmfPkgIa32X64.dsc                    |   2 -
 OvmfPkg/OvmfPkgX64.dsc                        |   2 -
 OvmfPkg/OvmfXen.dsc                           |   2 -
 .../UefiHandleParsingLib.c                    |   2 -
 .../UefiHandleParsingLib.h                    |   2 -
 .../UefiHandleParsingLib.inf                  |   2 -
 .../UefiHandleParsingLib.uni                  |   2 -
 .../PlatformBootManager.h                     |   2 +-
 .../PlatformBootManagerLib.inf                |   2 -
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc         |   2 -
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc      |   2 -
 54 files changed, 214 insertions(+), 2063 deletions(-)
 delete mode 100644 BaseTools/Source/C/Include/Protocol/UgaDraw.h
 delete mode 100644 MdePkg/Include/Protocol/UgaDraw.h
 delete mode 100644 MdePkg/Include/Protocol/UgaIo.h

-- 
2.25.1.windows.1


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

* [PATCH 01/18] BaseTools: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-09  1:47   ` [edk2-devel] " Ni, Ray
  2020-05-08  8:38 ` [PATCH 02/18] UefiPayloadPkg: " Guomin Jiang
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Bob Feng, Liming Gao

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove all UGA support in BaseTools package.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 .../Source/C/Include/Protocol/HiiFramework.h  |  51 ------
 BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 ------------------
 2 files changed, 212 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..09cbf23640c1 100644
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
@@ -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.25.1.windows.1


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

* [PATCH 02/18] UefiPayloadPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
  2020-05-08  8:38 ` [PATCH 01/18] BaseTools: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08 14:57   ` Ma, Maurice
  2020-05-08  8:38 ` [PATCH 03/18] ShellPkg: " Guomin Jiang
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Maurice Ma, Guo Dong, Benjamin You

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove All UGA Support in UefiPayloadPkg.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf   | 2 --
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc                           | 1 -
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc                        | 1 -
 3 files changed, 4 deletions(-)

diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 1f5a0bcad038..1072a3b21011 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -53,14 +53,12 @@ [Guids]
 [Protocols]
   gEfiGenericMemTestProtocolGuid  ## CONSUMES
   gEfiGraphicsOutputProtocolGuid  ## CONSUMES
-  gEfiUgaDrawProtocolGuid         ## CONSUMES
   gEfiBootLogoProtocolGuid        ## CONSUMES
   gEfiDxeSmmReadyToLockProtocolGuid
   gEfiSmmAccess2ProtocolGuid
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
   gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
index d52945442e0e..e8832925eed8 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
@@ -272,7 +272,6 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
 
 [PcdsFixedAtBuild]
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
index 0736cd995476..20462f68817d 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
@@ -273,7 +273,6 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
 
 [PcdsFixedAtBuild]
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
-- 
2.25.1.windows.1


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

* [PATCH 03/18] ShellPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
  2020-05-08  8:38 ` [PATCH 01/18] BaseTools: " Guomin Jiang
  2020-05-08  8:38 ` [PATCH 02/18] UefiPayloadPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 04/18] MdeModulePkg: " Guomin Jiang
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 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.

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

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 500a95a89a8f..53f83e419976 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -2148,8 +2148,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 d91857b8b035..72e2774a935f 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
@@ -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 93b69cd8e983..7a94e5638b4c 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
@@ -129,8 +129,6 @@ [Protocols]
   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 9c8028d0d5c0..4536da4e7a1f 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -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.25.1.windows.1


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

* [PATCH 04/18] MdeModulePkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (2 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 03/18] ShellPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 05/18] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jian J Wang, 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.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c       |   2 +-
 MdeModulePkg/Include/Library/BootLogoLib.h    |   2 +-
 .../Library/BootLogoLib/BootLogoLib.c         | 224 +++++-------------
 .../Library/BootLogoLib/BootLogoLib.inf       |   4 -
 4 files changed, 55 insertions(+), 177 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
index 64284ac8251c..2b03ecb258c6 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
@@ -49,7 +49,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PCI_HOTPLUG_REQUEST_PROTOCOL mPciHotPlugReques
   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 afd895b257c3..8af87790d1d3 100644
--- a/MdeModulePkg/Include/Library/BootLogoLib.h
+++ b/MdeModulePkg/Include/Library/BootLogoLib.h
@@ -27,7 +27,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     Devices 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 134660f28d34..ce8e725fedab 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -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;
   }
@@ -108,17 +93,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;
@@ -205,34 +181,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.
@@ -305,33 +265,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)) {
@@ -363,7 +308,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     GOP devices are back in text mode and synced up.
 
 **/
 EFI_STATUS
@@ -408,11 +353,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;
@@ -425,39 +367,13 @@ 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;
-    }
-  }
   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;
@@ -473,70 +389,36 @@ 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)
+                        );
   }
   //
   // Show progress by drawing blocks
   //
   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..03fd70451bc6 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
@@ -42,11 +42,7 @@ [LibraryClasses]
 
 [Protocols]
   gEfiGraphicsOutputProtocolGuid                ## SOMETIMES_CONSUMES
-  gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES
   gEfiBootLogoProtocolGuid                      ## SOMETIMES_CONSUMES
   gEdkiiBootLogo2ProtocolGuid                   ## SOMETIMES_CONSUMES
   gEfiUserManagerProtocolGuid                   ## CONSUMES
   gEdkiiPlatformLogoProtocolGuid                ## CONSUMES
-
-[FeaturePcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
-- 
2.25.1.windows.1


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

* [PATCH 05/18] MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (3 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 04/18] MdeModulePkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 06/18] MdeModulePkg/GraphicsConsoleDxe: " Guomin Jiang
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Zhichao Gao, Ray Ni

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove All UGA Support in ConSplitterDxe component.

Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 .../Console/ConSplitterDxe/ConSplitter.c      | 290 ++---------------
 .../Console/ConSplitterDxe/ConSplitter.h      | 135 +-------
 .../Console/ConSplitterDxe/ConSplitterDxe.inf |  14 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.uni |  11 +-
 .../ConSplitterDxe/ConSplitterGraphics.c      | 307 ------------------
 5 files changed, 41 insertions(+), 716 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 9c38271b65f9..3fdeee4b409b 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -107,16 +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
 //
@@ -155,16 +145,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {
     FALSE,
   },
 
-  {
-    NULL,
-    NULL,
-    NULL
-  },
-  0,
-  0,
-  0,
-  0,
-
   {
     NULL,
     NULL,
@@ -173,7 +153,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,
@@ -211,16 +190,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {
     FALSE,
   },
 
-  {
-    NULL,
-    NULL,
-    NULL
-  },
-  0,
-  0,
-  0,
-  0,
-
   {
     NULL,
     NULL,
@@ -229,7 +198,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 +390,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.
 
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.
   @param[in] SystemTable    A pointer to the EFI System Table.
@@ -494,10 +462,9 @@ ConSplitterDriverEntry(
   ASSERT_EFI_ERROR (Status);
 
   //
-  // Either Graphics Output protocol or UGA Draw protocol must be supported.
+  // Graphics Output protocol must be supported.
   //
-  ASSERT (FeaturePcdGet (PcdConOutGopSupport) ||
-          FeaturePcdGet (PcdConOutUgaSupport));
+  ASSERT (FeaturePcdGet (PcdConOutGopSupport));
 
   //
   // The driver creates virtual handles for ConIn, ConOut, StdErr.
@@ -753,9 +720,6 @@ 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));
   }
@@ -801,12 +765,6 @@ ConSplitterTextOutConstructor (
   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);
-  }
   if (FeaturePcdGet (PcdConOutGopSupport)) {
     //
     // Setup resource for mode information in Graphics Output Protocol interface
@@ -1332,7 +1290,6 @@ ConSplitterConOutDriverBindingStart (
   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;
 
@@ -1353,7 +1310,6 @@ ConSplitterConOutDriverBindingStart (
   }
 
   GraphicsOutput = NULL;
-  UgaDraw        = NULL;
   //
   // Try to Open Graphics Output protocol
   //
@@ -1366,20 +1322,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.
@@ -1390,36 +1332,17 @@ 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
-                 );
+  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));
+
+    FreePool (Info);
   }
 
   return Status;
@@ -1475,7 +1398,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_MAGENTA, EFI_BLACK));
 
   return Status;
@@ -2729,7 +2652,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.
@@ -2738,8 +2660,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;
@@ -2754,12 +2675,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;
 
@@ -2767,14 +2684,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) {
@@ -2921,49 +2830,11 @@ 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,
@@ -3108,7 +2979,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.
@@ -3118,17 +2988,12 @@ 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;
@@ -3163,7 +3028,6 @@ ConSplitterTextOutAddDevice (
 
   TextAndGop->TextOut        = TextOut;
   TextAndGop->GraphicsOutput = GraphicsOutput;
-  TextAndGop->UgaDraw        = UgaDraw;
 
   if (CurrentNumOfConsoles == 0) {
     //
@@ -3192,77 +3056,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 UGA is produced by Consplitter
-    //
-    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
-                    );
-      }
-    }
+  Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
+  if (EFI_ERROR (Status)) {
+    return Status;
   }
+  ASSERT ( SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
+  FreePool (Info);
 
   if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) &&
-      ((Private->CurrentNumberOfGraphicsOutput + Private->CurrentNumberOfUgaDraw) == 1)) {
-    if (!FeaturePcdGet (PcdConOutGopSupport)) {
+      ((Private->CurrentNumberOfGraphicsOutput) == 1)) {
       //
-      // 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
+      // Graphics Output Protocol is installed
       // on virtual handle.
       //
       Status = gBS->InstallMultipleProtocolInterfaces (
@@ -3271,20 +3079,6 @@ ConSplitterTextOutAddDevice (
                       &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
-                      );
-    }
   }
 
   //
@@ -3329,9 +3123,6 @@ ConSplitterTextOutDeleteDevice (
   TextOutList           = Private->TextOutList;
   while (Index >= 0) {
     if (TextOutList->TextOut == TextOut) {
-      if (TextOutList->UgaDraw != NULL) {
-        Private->CurrentNumberOfUgaDraw--;
-      }
       if (TextOutList->GraphicsOutput != NULL) {
         Private->CurrentNumberOfGraphicsOutput--;
       }
@@ -3350,33 +3141,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 419635c3f51f..32ad0888544b 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
@@ -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>
@@ -187,7 +186,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;
 
@@ -200,16 +198,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;
@@ -236,13 +227,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,                       \
@@ -260,7 +244,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.
@@ -1216,7 +1200,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.
@@ -1226,8 +1209,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
   );
 
 /**
@@ -1871,119 +1853,6 @@ ConSplitterGraphicsOutputBlt (
   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 occured 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
-  );
-
 /**
   Sets the output device(s) to a specified mode.
 
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
index 9aa1dade752a..156757aee653 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
@@ -3,12 +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.
+# Consplitter could install Graphics Output protocol in system
+# table according PCD settings(PcdConOutGopSupport). It always
+# consumes Graphics Output protocol which is produced by display device
 #
 # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 #
@@ -92,14 +89,9 @@ [Protocols]
   ## 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..903c505e303c 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
@@ -3,12 +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.
+// Consplitter could install Graphics Output protocol in system
+// table according PCD settings(PcdConOutGopSupport). It always
+// consumes Graphics Output protocol which is produced by display device
 //
 // Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
 //
@@ -19,5 +16,5 @@
 
 #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. Consplitter could install Graphics Output protocol in system table according PCD settings(PcdConOutGopSupport). 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 ab1d2ddc4dc4..e8926db3e355 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
@@ -118,7 +118,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;
@@ -156,20 +155,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;
-        }
-      }
     }
   }
 
@@ -262,7 +247,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;
@@ -299,297 +283,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 occured 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.25.1.windows.1


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

* [PATCH 06/18] MdeModulePkg/GraphicsConsoleDxe: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (4 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 05/18] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 07/18] EmulatorPkg: " Guomin Jiang
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Dandan Bi, Eric Dong, Zhichao Gao, Ray Ni

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.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 .../GraphicsConsoleDxe/GraphicsConsole.c      | 299 +-----------------
 .../GraphicsConsoleDxe/GraphicsConsole.h      |  19 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf |   6 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.uni |   4 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/Image.c |   2 +-
 5 files changed, 19 insertions(+), 311 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index c042451a9b52..55c9e8f5ebf4 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,
@@ -99,9 +98,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.
@@ -122,11 +120,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
   //
@@ -138,20 +134,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;
   }
@@ -196,13 +178,6 @@ GraphicsConsoleControllerDriverSupported (
           This->DriverBindingHandle,
           Controller
           );
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-    gBS->CloseProtocol (
-          Controller,
-          &gEfiUgaDrawProtocolGuid,
-          This->DriverBindingHandle,
-          Controller
-          );
   }
   return Status;
 }
@@ -351,9 +326,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
@@ -376,8 +350,6 @@ GraphicsConsoleControllerDriverStart (
   GRAPHICS_CONSOLE_DEV                 *Private;
   UINT32                               HorizontalResolution;
   UINT32                               VerticalResolution;
-  UINT32                               ColorDepth;
-  UINT32                               RefreshRate;
   UINT32                               ModeIndex;
   UINTN                                MaxMode;
   UINT32                               ModeNumber;
@@ -414,18 +386,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;
   }
@@ -512,43 +472,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 ((EFI_D_INFO, "GraphicsConsole video resolution %d x %d\n", HorizontalResolution, VerticalResolution));
@@ -613,7 +536,7 @@ GraphicsConsoleControllerDriverStart (
 Error:
   if (EFI_ERROR (Status)) {
     //
-    // Close the GOP and UGA Draw Protocol
+    // Close the GOP
     //
     if (Private->GraphicsOutput != NULL) {
       gBS->CloseProtocol (
@@ -622,13 +545,6 @@ GraphicsConsoleControllerDriverStart (
              This->DriverBindingHandle,
              Controller
              );
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      gBS->CloseProtocol (
-             Controller,
-             &gEfiUgaDrawProtocolGuid,
-             This->DriverBindingHandle,
-             Controller
-             );
     }
 
     if (Private->LineBuffer != NULL) {
@@ -650,9 +566,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
@@ -701,7 +615,7 @@ GraphicsConsoleControllerDriverStop (
 
   if (!EFI_ERROR (Status)) {
     //
-    // Close the GOP or UGA IO Protocol
+    // Close the GOP Protocol
     //
     if (Private->GraphicsOutput != NULL) {
       gBS->CloseProtocol (
@@ -710,13 +624,6 @@ GraphicsConsoleControllerDriverStop (
             This->DriverBindingHandle,
             Controller
             );
-    } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-      gBS->CloseProtocol (
-            Controller,
-            &gEfiUgaDrawProtocolGuid,
-            This->DriverBindingHandle,
-            Controller
-            );
     }
 
     if (Private->LineBuffer != NULL) {
@@ -905,7 +812,6 @@ GraphicsConsoleConOutOutputString (
 {
   GRAPHICS_CONSOLE_DEV  *Private;
   EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL *UgaDraw;
   INTN                  Mode;
   UINTN                 MaxColumn;
   UINTN                 MaxRow;
@@ -939,7 +845,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;
@@ -1029,38 +934,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++;
@@ -1300,19 +1173,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
@@ -1345,7 +1212,7 @@ GraphicsConsoleConOutSetMode (
       goto Done;
     }
     //
-    // 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);
@@ -1401,51 +1268,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
-                          );
-    }
   }
 
   //
@@ -1539,7 +1361,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;
@@ -1555,7 +1376,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);
@@ -1572,19 +1392,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;
   }
@@ -1747,7 +1554,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.
 
@@ -1764,9 +1571,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));
@@ -1817,63 +1621,6 @@ DrawUnicodeWeightAtCursorN (
                          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;
   }
@@ -1913,7 +1660,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];
@@ -1928,7 +1674,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.
@@ -1951,19 +1696,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);
@@ -1992,19 +1724,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 28d47ac7cb1e..de10e133809a 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
@@ -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>
@@ -60,7 +59,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;
@@ -422,9 +420,8 @@ GraphicsConsoleConOutEnableCursor (
 /**
   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.
@@ -445,9 +442,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
@@ -468,9 +464,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
@@ -534,8 +528,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..975871b76d05 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
@@ -2,7 +2,7 @@
 #  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>
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -53,15 +53,11 @@ [Protocols]
   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..45dbb24c8bca 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
@@ -2,7 +2,7 @@
 // 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>
 //
@@ -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 a108fc6157a2..57f6fad15ea3 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
@@ -1381,7 +1381,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.25.1.windows.1


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

* [PATCH 07/18] EmulatorPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (5 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 06/18] MdeModulePkg/GraphicsConsoleDxe: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-09  3:02   ` Ni, Ray
  2020-05-08  8:38 ` [PATCH 08/18] OvmfPkg: " Guomin Jiang
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jordan Justen, 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.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 EmulatorPkg/EmuGopDxe/Gop.h                   |  8 ++-
 EmulatorPkg/EmuGopDxe/GopScreen.c             | 14 ++---
 EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 18 +++----
 .../Include/Protocol/EmuGraphicsWindow.h      | 18 +++----
 .../Library/PlatformBmLib/PlatformBm.h        |  2 +-
 .../Library/PlatformBmLib/PlatformBmData.c    |  4 +-
 EmulatorPkg/Unix/Host/Gasket.h                |  9 +---
 EmulatorPkg/Unix/Host/Host.h                  |  1 -
 EmulatorPkg/Unix/Host/Ia32/Gasket.S           |  2 +-
 EmulatorPkg/Unix/Host/X11GraphicsWindow.c     | 54 +++++++++----------
 EmulatorPkg/Unix/Host/X64/Gasket.S            |  2 +-
 EmulatorPkg/Win/Host/WinGopScreen.c           |  4 +-
 12 files changed, 64 insertions(+), 72 deletions(-)

diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h
index 389666327651..5376e8077ea2 100644
--- a/EmulatorPkg/EmuGopDxe/Gop.h
+++ b/EmulatorPkg/EmuGopDxe/Gop.h
@@ -6,8 +6,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#ifndef __UGA_H_
-#define __UGA_H_
+#ifndef __GOP_H_
+#define __GOP_H_
 
 #include <PiDxe.h>
 
@@ -63,8 +63,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;
@@ -87,7 +85,7 @@ typedef struct {
 
 
   //
-  // UGA Private Data knowing when to start hardware
+  // @todo GOP?? Private Data knowing when to start hardware
   //
   BOOLEAN                           HardwareNeedsStarting;
 
diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c
index fbac649f8b3e..6ae5a07ba0c5 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.
 
@@ -215,7 +215,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);
   }
 
   //
@@ -226,8 +226,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;
@@ -238,8 +238,8 @@ EmuGopBlt (
   GopBltArgs.Delta        = Delta;
   Status = Private->EmuGraphicsWindow->Blt (
                             Private->EmuGraphicsWindow,
-                            (EFI_UGA_PIXEL *)BltBuffer,
-                            (EFI_UGA_BLT_OPERATION)BltOperation,
+                            BltBuffer,
+                            BltOperation,
                             &GopBltArgs
                             );
 
@@ -391,7 +391,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 8ac9d9ba5dd3..eba747062c44 100644
--- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
+++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
@@ -13,13 +13,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 } }
@@ -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
   );
 
@@ -91,8 +91,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/Include/Protocol/EmuGraphicsWindow.h b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
index 07d4070b3584..e9b85c8eb373 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
   );
 
@@ -85,8 +85,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 ce508b6b58f5..7bf9909511f0 100644
--- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
+++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
@@ -61,7 +61,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;
 
 
 //
diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
index 115102160605..5c2f9a6a4df4 100644
--- a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
+++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 
 
-EMU_PLATFORM_UGA_DEVICE_PATH gGopDevicePath = {
+EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH gGopDevicePath = {
   {
     {
       {
@@ -42,7 +42,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 e082397d23fb..1b67264f3e0e 100644
--- a/EmulatorPkg/Unix/Host/Gasket.h
+++ b/EmulatorPkg/Unix/Host/Gasket.h
@@ -206,11 +206,6 @@ ReverseGasketUint64Uint64 (
   VOID      *Key
   );
 
-//
-// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
-//
-
-
 EFI_STATUS
 EFIAPI
 GasketX11Size (
@@ -253,8 +248,8 @@ EFI_STATUS
 EFIAPI
 GasketX11Blt (
   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/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h
index 9791cf8c370e..ccae162ed4a6 100644
--- a/EmulatorPkg/Unix/Host/Host.h
+++ b/EmulatorPkg/Unix/Host/Host.h
@@ -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 5325a0e35bf9..d4ef053db1bc 100644
--- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
+++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
@@ -591,8 +591,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)
@@ -600,15 +600,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;
@@ -675,7 +675,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
       //
     }
   }
@@ -708,8 +708,8 @@ X11RegisterKeyNotify (
 EFI_STATUS
 X11Blt (
   IN EMU_GRAPHICS_WINDOW_PROTOCOL             *GraphicsIo,
-  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
   )
 {
@@ -719,7 +719,7 @@ X11Blt (
   UINTN             DstX;
   UINTN             SrcX;
   UINTN             Index;
-  EFI_UGA_PIXEL     *Blt;
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
   UINT8             *Dst;
   UINT8             *Src;
   UINTN             Nbr;
@@ -732,8 +732,8 @@ X11Blt (
   //
   //  Check bounds
   //
-  if (BltOperation == EfiUgaVideoToBltBuffer
-      || BltOperation == EfiUgaVideoToVideo) {
+  if (BltOperation == EfiBltVideoToBltBuffer
+      || BltOperation == EfiBltVideoToVideo) {
     //
     // Source is Video.
     //
@@ -746,9 +746,9 @@ X11Blt (
     }
   }
 
-  if (BltOperation == EfiUgaBltBufferToVideo
-      || BltOperation == EfiUgaVideoToVideo
-      || BltOperation == EfiUgaVideoFill) {
+  if (BltOperation == EfiBltBufferToVideo
+      || BltOperation == EfiBltVideoToVideo
+      || BltOperation == EfiBltVideoFill) {
     //
     // Destination is Video
     //
@@ -762,28 +762,28 @@ 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)
@@ -809,7 +809,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++) {
@@ -825,7 +825,7 @@ X11Blt (
   //  Refresh screen.
   //
   switch (BltOperation) {
-  case EfiUgaVideoToVideo:
+  case EfiBltVideoToVideo:
     XCopyArea(
       Private->display, Private->win, Private->win, Private->gc,
       Args->SourceX, Args->SourceY, Args->Width, Args->Height,
@@ -840,7 +840,7 @@ X11Blt (
       }
     }
     break;
-  case EfiUgaVideoFill:
+  case EfiBltVideoFill:
     Color = X11PixelToColor (Private, *BltBuffer);
     XSetForeground (Private->display, Private->gc, Color);
     XFillRectangle (
@@ -849,7 +849,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 74011e225e30..9c51cc326ba5 100644
--- a/EmulatorPkg/Win/Host/WinGopScreen.c
+++ b/EmulatorPkg/Win/Host/WinGopScreen.c
@@ -322,8 +322,8 @@ WinNtWndSize (
 EFI_STATUS
 WinNtWndBlt (
   IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsIo,
-  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
 )
 {
-- 
2.25.1.windows.1


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

* [PATCH 08/18] OvmfPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (6 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 07/18] EmulatorPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 09/18] ArmPkg: " Guomin Jiang
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jordan Justen, Laszlo Ersek, Ard Biesheuvel

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove All UGA Support in OvmfPkg.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 OvmfPkg/OvmfPkgIa32.dsc    | 1 -
 OvmfPkg/OvmfPkgIa32X64.dsc | 1 -
 OvmfPkg/OvmfPkgX64.dsc     | 1 -
 OvmfPkg/OvmfXen.dsc        | 1 -
 4 files changed, 4 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 7c8b51f43b66..404450e91491 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -450,7 +450,6 @@ [PcdsFeatureFlag]
   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 a0596c44168c..aaa408ac456a 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -454,7 +454,6 @@ [PcdsFeatureFlag]
   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 2e764b6b7233..554515d6a9b8 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -454,7 +454,6 @@ [PcdsFeatureFlag]
   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 8b3615e0b07e..70fbe8f0ddf3 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -335,7 +335,6 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
-- 
2.25.1.windows.1


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

* [PATCH 09/18] ArmPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (7 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 08/18] OvmfPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 10/18] ArmVirtPkg: " Guomin Jiang
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Leif Lindholm, Ard Biesheuvel

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove All UGA Support in ArmPkg.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h             | 2 +-
 .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf  | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
index 0bb3645ddc47..fa2f05cacb48 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
@@ -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     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 87c9b1150c54..4cdeed132d9a 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -51,9 +51,6 @@ [LibraryClasses]
   UefiLib
   UefiRuntimeServicesTableLib
 
-[FeaturePcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
-
 [FixedPcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
-- 
2.25.1.windows.1


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

* [PATCH 10/18] ArmVirtPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (8 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 09/18] ArmPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 11/18] MdePkg: " Guomin Jiang
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Laszlo Ersek, Ard Biesheuvel, Leif Lindholm

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove All UGA Support in ArmVirtPkg

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 ArmVirtPkg/ArmVirtQemu.dsc       | 1 -
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 -
 2 files changed, 2 deletions(-)

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 3f649c91d8d6..4c40bf9e08cf 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -118,7 +118,6 @@ [PcdsFeatureFlag.common]
   ## 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
 
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 2a6fd6bc06be..46f01a934b69 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -105,7 +105,6 @@ [PcdsFeatureFlag.common]
   ## 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
 
-- 
2.25.1.windows.1


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

* [PATCH 11/18] MdePkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (9 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 10/18] ArmVirtPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 12/18] MdeModulePkg: " Guomin Jiang
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Michael D Kinney, Liming Gao

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove All UGA Support in MdePkg.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 MdePkg/Include/Protocol/UgaDraw.h        | 160 -------------------
 MdePkg/Include/Protocol/UgaIo.h          | 191 -----------------------
 MdePkg/Library/UefiLib/UefiLib.inf       |   2 -
 MdePkg/Library/UefiLib/UefiLibInternal.h |   1 -
 MdePkg/Library/UefiLib/UefiLibPrint.c    |  88 -----------
 MdePkg/MdePkg.dec                        |  12 --
 MdePkg/MdePkg.dsc                        |   3 -
 MdePkg/MdePkg.uni                        |   6 -
 8 files changed, 463 deletions(-)
 delete mode 100644 MdePkg/Include/Protocol/UgaDraw.h
 delete mode 100644 MdePkg/Include/Protocol/UgaIo.h

diff --git a/MdePkg/Include/Protocol/UgaDraw.h b/MdePkg/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 3d423be052c5..000000000000
--- a/MdePkg/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/** @file
-  UGA Draw protocol from the EFI 1.10 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                  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.
-
-**/
-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
-  );
-
-/**
-  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 ()
-
-**/
-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;
-
-///
-/// Enumration value for actions of Blt operations.
-///
-typedef enum {
-  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.
-
-  EfiUgaBltMax              ///< Maxmimum value for enumration value of Blt operation. If a Blt operation
-                            ///< larger or equal to this enumration value, it is invalid.
-} EFI_UGA_BLT_OPERATION;
-
-/**
-    Blt a rectangle of pixels on the graphics screen.
-
-    @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        - Hight 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 occured writting 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
-  );
-
-///
-/// This protocol provides a basic abstraction to set video modes and
-/// copy pixels to and from the graphics controller's frame buffer.
-///
-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
diff --git a/MdePkg/Include/Protocol/UgaIo.h b/MdePkg/Include/Protocol/UgaIo.h
deleted file mode 100644
index 67a6abd226c9..000000000000
--- a/MdePkg/Include/Protocol/UgaIo.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/** @file
-  UGA IO protocol from the EFI 1.10 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_IO_H__
-#define __UGA_IO_H__
-
-#define EFI_UGA_IO_PROTOCOL_GUID \
-  { 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } }
-
-typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;
-
-typedef UINT32                      UGA_STATUS;
-
-typedef enum {
-  UgaDtParentBus          = 1,
-  UgaDtGraphicsController,
-  UgaDtOutputController,
-  UgaDtOutputPort,
-  UgaDtOther
-} UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;
-
-typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;
-
-typedef struct {
-  UGA_DEVICE_TYPE deviceType;
-  UGA_DEVICE_ID   deviceId;
-  UINT32          ui32DeviceContextSize;
-  UINT32          ui32SharedContextSize;
-} UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;
-
-typedef struct _UGA_DEVICE {
-  VOID                *pvDeviceContext;
-  VOID                *pvSharedContext;
-  VOID                *pvRunTimeContext;
-  struct _UGA_DEVICE  *pParentDevice;
-  VOID                *pvBusIoServices;
-  VOID                *pvStdIoServices;
-  UGA_DEVICE_DATA     deviceData;
-} UGA_DEVICE, *PUGA_DEVICE;
-
-typedef enum {
-  UgaIoGetVersion             = 1,
-  UgaIoGetChildDevice,
-  UgaIoStartDevice,
-  UgaIoStopDevice,
-  UgaIoFlushDevice,
-  UgaIoResetDevice,
-  UgaIoGetDeviceState,
-  UgaIoSetDeviceState,
-  UgaIoSetPowerState,
-  UgaIoGetMemoryConfiguration,
-  UgaIoSetVideoMode,
-  UgaIoCopyRectangle,
-  UgaIoGetEdidSegment,
-  UgaIoDeviceChannelOpen,
-  UgaIoDeviceChannelClose,
-  UgaIoDeviceChannelRead,
-  UgaIoDeviceChannelWrite,
-  UgaIoGetPersistentDataSize,
-  UgaIoGetPersistentData,
-  UgaIoSetPersistentData,
-  UgaIoGetDevicePropertySize,
-  UgaIoGetDeviceProperty,
-  UgaIoBtPrivateInterface
-} UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;
-
-typedef struct {
-  IN UGA_IO_REQUEST_CODE  ioRequestCode;
-  IN VOID                 *pvInBuffer;
-  IN UINT64               ui64InBufferSize;
-  OUT VOID                *pvOutBuffer;
-  IN UINT64               ui64OutBufferSize;
-  OUT UINT64              ui64BytesReturned;
-} UGA_IO_REQUEST, *PUGA_IO_REQUEST;
-
-
-/**
-  Dynamically allocate storage for a child UGA_DEVICE.
-
-  @param[in]     This            The EFI_UGA_IO_PROTOCOL instance.
-  @param[in]     ParentDevice    ParentDevice specifies a pointer to the parent device of Device.
-  @param[in]     DeviceData      A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()
-                                 with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
-  @param[in]     RunTimeContext  Context to associate with Device.
-  @param[out]    Device          The Device returns a dynamically allocated child UGA_DEVICE object
-                                 for ParentDevice. The caller is responsible for deleting Device.
-
-
-  @retval  EFI_SUCCESS           Device was returned.
-  @retval  EFI_INVALID_PARAMETER One of the arguments was not valid.
-  @retval  EFI_DEVICE_ERROR      The device had an error and could not complete the request.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE)(
-  IN  EFI_UGA_IO_PROTOCOL  *This,
-  IN  UGA_DEVICE           *ParentDevice,
-  IN  UGA_DEVICE_DATA      *DeviceData,
-  IN  VOID                 *RunTimeContext,
-  OUT UGA_DEVICE           **Device
-  );
-
-
-/**
-  Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice().
-
-  @param[in]     This            The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is
-                                 defined in Section 10.7.
-  @param[in]     Device          The Device points to a UGA_DEVICE object that was dynamically
-                                 allocated via a CreateDevice() call.
-
-
-  @retval  EFI_SUCCESS           Device was returned.
-  @retval  EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE)(
-  IN EFI_UGA_IO_PROTOCOL  * This,
-  IN UGA_DEVICE           * Device
-  );
-
-/**
-  This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.
-
-  @param pDevice pDevice specifies a pointer to a device object associated with a
-                 device enumerated by a pIoRequest->ioRequestCode of type
-                 UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL
-                 is represented by pDevice being set to NULL.
-
-  @param pIoRequest
-                 pIoRequest points to a caller allocated buffer that contains data
-                 defined by pIoRequest->ioRequestCode. See Related Definitions for
-                 a definition of UGA_IO_REQUEST_CODE s and their associated data
-                 structures.
-
-  @return UGA_STATUS
-
-**/
-typedef UGA_STATUS
-(EFIAPI *PUGA_FW_SERVICE_DISPATCH)(
-  IN PUGA_DEVICE pDevice,
-  IN OUT PUGA_IO_REQUEST pIoRequest
-  );
-
-///
-/// Provides a basic abstraction to send I/O requests to the graphics device and any of its children.
-///
-struct _EFI_UGA_IO_PROTOCOL {
-  EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;
-  EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;
-  PUGA_FW_SERVICE_DISPATCH          DispatchService;
-};
-
-extern EFI_GUID gEfiUgaIoProtocolGuid;
-
-//
-// Data structure that is stored in the EFI Configuration Table with the
-// EFI_UGA_IO_PROTOCOL_GUID.  The option ROMs listed in this table may have
-// EBC UGA drivers.
-//
-typedef struct {
-  UINT32  Version;
-  UINT32  HeaderSize;
-  UINT32  SizeOfEntries;
-  UINT32  NumberOfEntries;
-} EFI_DRIVER_OS_HANDOFF_HEADER;
-
-typedef enum {
-  EfiUgaDriverFromPciRom,
-  EfiUgaDriverFromSystem,
-  EfiDriverHandoffMax
-} EFI_DRIVER_HANOFF_ENUM;
-
-typedef struct {
-  EFI_DRIVER_HANOFF_ENUM    Type;
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
-  VOID                      *PciRomImage;
-  UINT64                    PciRomSize;
-} EFI_DRIVER_OS_HANDOFF;
-
-#endif
diff --git a/MdePkg/Library/UefiLib/UefiLib.inf b/MdePkg/Library/UefiLib/UefiLib.inf
index 01ed92092da2..9f3863787833 100644
--- a/MdePkg/Library/UefiLib/UefiLib.inf
+++ b/MdePkg/Library/UefiLib/UefiLib.inf
@@ -67,7 +67,6 @@ [Protocols]
   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 @@ [FeaturePcd]
   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 60b5297c7516..ed6b69030361 100644
--- a/MdePkg/Library/UefiLib/UefiLibInternal.h
+++ b/MdePkg/Library/UefiLib/UefiLibInternal.h
@@ -19,7 +19,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 ae3a94eb0ca0..90dde0778e81 100644
--- a/MdePkg/Library/UefiLib/UefiLibPrint.c
+++ b/MdePkg/Library/UefiLib/UefiLibPrint.c
@@ -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;
@@ -373,20 +367,6 @@ InternalPrintGraphic (
                   &gEfiGraphicsOutputProtocolGuid,
                   (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;
   }
@@ -404,8 +384,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;
   }
@@ -464,72 +442,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.dec b/MdePkg/MdePkg.dec
index 0b9c4bc40ace..5d19b1182c85 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -1374,12 +1374,6 @@ [Protocols]
   ## Include/Protocol/EdidOverride.h
   gEfiEdidOverrideProtocolGuid   = { 0x48ECB431, 0xFB72, 0x45C0, { 0xA9, 0x22, 0xF4, 0x58, 0xFE, 0x04, 0x0B, 0xD5 }}
 
-  ## Include/Protocol/UgaIo.h
-  gEfiUgaIoProtocolGuid          = { 0x61A4D49E, 0x6F68, 0x4F1B, { 0xB9, 0x22, 0xA8, 0x6E, 0xED, 0x0B, 0x07, 0xA2 }}
-
-  ## Include/Protocol/UgaDraw.h
-  gEfiUgaDrawProtocolGuid        = { 0x982C298B, 0xF4FA, 0x41CB, { 0xB8, 0x38, 0x77, 0xAA, 0x68, 0x8F, 0xB8, 0x39 }}
-
   ## Include/Protocol/LoadedImage.h
   gEfiLoadedImageProtocolGuid    = { 0x5B1B31A1, 0x9562, 0x11D2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }}
 
@@ -1857,12 +1851,6 @@ [PcdsFeatureFlag]
   # @Prompt Deprecate Global Variable LangCodes.
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate|FALSE|BOOLEAN|0x00000012
 
-  ## Indicates if UGA Draw Protocol is still consumed.<BR><BR>
-  #   TRUE  - Consume UGA Draw protocol.<BR>
-  #   FALSE - Does not consume UGA Draw protocol.<BR>
-  # @Prompt Consume UGA Draw Protocol.
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE|BOOLEAN|0x00000027
-
   ## Indicates if a check will be made to see if a specified node is a member of linked list
   #  in the following BaseLib functions: GetNextNode(), IsNull(), IsNodeAtEnd(), SwapListEntries().<BR><BR>
   #   TRUE  - Verify a specified node is a member of linked list.<BR>
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 6cd38e7ec3c9..3c2420cba29c 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -21,9 +21,6 @@ [Defines]
 
 !include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
 
-[PcdsFeatureFlag]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE
-
 [PcdsFixedAtBuild]
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni
index 5c1fa24065c7..7b00a396848c 100644
--- a/MdePkg/MdePkg.uni
+++ b/MdePkg/MdePkg.uni
@@ -373,12 +373,6 @@
                                                                                                "TRUE  - Deprecate global variable LangCodes.<BR>\n"
                                                                                                "FALSE - Does not deprecate global variable LangCodes.<BR>"
 
-#string STR_gEfiMdePkgTokenSpaceGuid_PcdUgaConsumeSupport_PROMPT  #language en-US "Consume UGA Draw Protocol"
-
-#string STR_gEfiMdePkgTokenSpaceGuid_PcdUgaConsumeSupport_HELP  #language en-US "Indicates if UGA Draw Protocol is still consumed.<BR><BR>\n"
-                                                                                "TRUE  - Consume UGA Draw protocol.<BR>\n"
-                                                                                "FALSE - Does not consume UGA Draw protocol.<BR>"
-
 #string STR_gEfiMdePkgTokenSpaceGuid_PcdVerifyNodeInList_PROMPT  #language en-US "Verify Node In List"
 
 #string STR_gEfiMdePkgTokenSpaceGuid_PcdVerifyNodeInList_HELP  #language en-US "Indicates if a check will be made to see if a specified node is a member of linked list in the following BaseLib functions: GetNextNode(), IsNull(), IsNodeAtEnd(), SwapListEntries().<BR><BR>\n"
-- 
2.25.1.windows.1


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

* [PATCH 12/18] MdeModulePkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (10 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 11/18] MdePkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 13/18] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jian J Wang, Hao A Wu

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove Pcds related to UGA.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 MdeModulePkg/MdeModulePkg.dec | 7 -------
 MdeModulePkg/MdeModulePkg.uni | 6 ------
 2 files changed, 13 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 4f44af694862..a31f0a85883d 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -691,13 +691,6 @@ [PcdsFeatureFlag]
   # @Prompt Enable ConOut GOP support.
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE|BOOLEAN|0x00010042
 
-  ## Indicates if UGA Draw Protocol will be installed on virtual handle created by ConsplitterDxe.
-  #  It could be set FALSE to save size.<BR><BR>
-  #   TRUE  - Installs UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>
-  #   FALSE - Does not install UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>
-  # @Prompt Enable ConOut UGA support.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|TRUE|BOOLEAN|0x00010043
-
   ## Indicates PeiCore will first search TE section from the PEIM to load the image, or PE32 section, when PeiCore dispatches a PEI module.
   #  This PCD is used to tune PEI phase performance to reduce the search image time.
   #  It can be set according to the generated image section type.<BR><BR>
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index 2007e0596c4f..0cfcb0039d7f 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -696,12 +696,6 @@
                                                                                      "TRUE  - Installs Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>\n"
                                                                                      "FALSE - Does not install Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>"
 
-#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdConOutUgaSupport_PROMPT  #language en-US "Enable ConOut UGA support"
-
-#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdConOutUgaSupport_HELP  #language en-US "Indicates if UGA Draw Protocol will be installed on virtual handle created by ConsplitterDxe. It could be set FALSE to save size.<BR><BR>\n"
-                                                                                     "TRUE  - Installs UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>\n"
-                                                                                     "FALSE - Does not install UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>"
-
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPeiCoreImageLoaderSearchTeSectionFirst_PROMPT  #language en-US "PeiCore search TE section first"
 
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPeiCoreImageLoaderSearchTeSectionFirst_HELP  #language en-US "Indicates PeiCore will first search TE section from the PEIM to load the image, or PE32 section, when PeiCore dispatches a PEI module. This PCD is used to tune PEI phase performance to reduce the search image time. It can be set according to the generated image section type.<BR><BR>\n"
-- 
2.25.1.windows.1


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

* [PATCH 13/18] MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (11 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 12/18] MdeModulePkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-09  3:03   ` Ni, Ray
  2020-05-08  8:38 ` [PATCH 14/18] " Guomin Jiang
                   ` (5 subsequent siblings)
  18 siblings, 1 reply; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Zhichao Gao, Ray Ni

From: GuoMinJ <newexplorerj@gmail.com>

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

Avoid OVMF hang when remove UGA support.

Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 .../Universal/Console/ConSplitterDxe/ConSplitter.c   | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 3fdeee4b409b..18c25956d0d9 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -3060,12 +3060,14 @@ ConSplitterTextOutAddDevice (
     DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput);
   }
 
-  Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
-  if (EFI_ERROR (Status)) {
-    return Status;
+  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));
+    FreePool (Info);
   }
-  ASSERT ( SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-  FreePool (Info);
 
   if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) &&
       ((Private->CurrentNumberOfGraphicsOutput) == 1)) {
-- 
2.25.1.windows.1


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

* [PATCH 14/18] MdeModulePkg/ConSplitterDxe: Remove All UGA Support.
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (12 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 13/18] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 15/18] OvmfPkg: " Guomin Jiang
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, 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.

Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 .../Console/ConSplitterDxe/ConSplitter.c      | 84 ++++++++-----------
 .../Console/ConSplitterDxe/ConSplitterDxe.inf |  9 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.uni |  9 +-
 3 files changed, 42 insertions(+), 60 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 18c25956d0d9..350b85d73028 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -461,11 +461,6 @@ ConSplitterDriverEntry(
              );
   ASSERT_EFI_ERROR (Status);
 
-  //
-  // Graphics Output protocol must be supported.
-  //
-  ASSERT (FeaturePcdGet (PcdConOutGopSupport));
-
   //
   // The driver creates virtual handles for ConIn, ConOut, StdErr.
   // The virtual handles will always exist even if no console exist in the
@@ -720,9 +715,7 @@ ConSplitterTextOutConstructor (
   //
   // Copy protocols template
   //
-  if (FeaturePcdGet (PcdConOutGopSupport)) {
-    CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));
-  }
+  CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));
 
   //
   // Initilize console output splitter's private data.
@@ -764,47 +757,44 @@ ConSplitterTextOutConstructor (
   ConOutPrivate->TextOutQueryData[0].Rows     = 25;
   TextOutSetMode (ConOutPrivate, 0);
 
+  //
+  // 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;
+  }
+  //
+  // 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);
 
-  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;
-    }
-    //
-    // 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);
-
-    //
-    // 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;
 }
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
index 156757aee653..baa4051fd104 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
@@ -3,11 +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 in system
-# table according PCD settings(PcdConOutGopSupport). It always
-# consumes Graphics Output protocol which is produced by display device
+# 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 - 2020, Intel Corporation. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -90,9 +88,6 @@ [Protocols]
   ## SOMETIMES_CONSUMES
   gEfiGraphicsOutputProtocolGuid
 
-[FeaturePcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport   ## CONSUMES
-
 [Pcd]
   ## SOMETIMES_PRODUCES
   ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
index 903c505e303c..73b0010a57dd 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
@@ -3,11 +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 in system
-// table according PCD settings(PcdConOutGopSupport). It always
-// consumes Graphics Output protocol which is produced by display device
+// 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 - 2020, Intel Corporation. All rights reserved.<BR>
 //
 // SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -16,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 in system table according PCD settings(PcdConOutGopSupport). It always consumes Graphics Output protocol, which is produced by display device."
-
+#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."
-- 
2.25.1.windows.1


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

* [PATCH 15/18] OvmfPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (13 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 14/18] " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 16/18] UefiPayloadPkg: " Guomin Jiang
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jordan Justen, Laszlo Ersek, Ard Biesheuvel

From: GuoMinJ <newexplorerj@gmail.com>

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

Delete PcdConOutGopSupport, it is unnecessary any more.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 OvmfPkg/OvmfPkgIa32.dsc    | 1 -
 OvmfPkg/OvmfPkgIa32X64.dsc | 1 -
 OvmfPkg/OvmfPkgX64.dsc     | 1 -
 OvmfPkg/OvmfXen.dsc        | 1 -
 4 files changed, 4 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 404450e91491..b3249dad2423 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -449,7 +449,6 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index aaa408ac456a..a81585ad706a 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -453,7 +453,6 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 554515d6a9b8..754676c05f7b 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -453,7 +453,6 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 70fbe8f0ddf3..065016af2220 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -334,7 +334,6 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
-- 
2.25.1.windows.1


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

* [PATCH 16/18] UefiPayloadPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (14 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 15/18] OvmfPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08 14:58   ` Ma, Maurice
  2020-05-08  8:38 ` [PATCH 17/18] ArmVirtPkg: " Guomin Jiang
                   ` (2 subsequent siblings)
  18 siblings, 1 reply; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Maurice Ma, Guo Dong, Benjamin You

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove PcdConOutGopSupport, it is unnecessary any more.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 .../Library/PlatformBootManagerLib/PlatformBootManager.h        | 2 +-
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc                           | 1 -
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc                        | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
index 2f600c796ff2..3ab0a24d384a 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
@@ -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     Devices are back in text mode and synced up.
 
 **/
 EFI_STATUS
diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
index e8832925eed8..d31f6ca4fb7d 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
@@ -271,7 +271,6 @@ [PcdsFeatureFlag]
 !endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
 
 [PcdsFixedAtBuild]
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
index 20462f68817d..8d67e25731e3 100644
--- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
@@ -272,7 +272,6 @@ [PcdsFeatureFlag]
 !endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
 
 [PcdsFixedAtBuild]
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
-- 
2.25.1.windows.1


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

* [PATCH 17/18] ArmVirtPkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (15 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 16/18] UefiPayloadPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08  8:38 ` [PATCH 18/18] MdeModulePkg: " Guomin Jiang
  2020-05-08 10:09 ` [edk2-devel] [PATCH 00/18] " Laszlo Ersek
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Laszlo Ersek, Ard Biesheuvel, Leif Lindholm

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove PcdConOutGopSupport, it is unnecessary any more.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 ArmVirtPkg/ArmVirtQemu.dsc       | 4 ----
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 4c40bf9e08cf..232bfd4b75a4 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -115,10 +115,6 @@ [PcdsFeatureFlag.common]
   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.PcdTurnOffUsbLegacySupport|TRUE
 
   gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE)
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 46f01a934b69..d82635509cbb 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -102,10 +102,6 @@ [PcdsFeatureFlag.common]
   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.PcdTurnOffUsbLegacySupport|TRUE
 
 [PcdsFixedAtBuild.common]
-- 
2.25.1.windows.1


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

* [PATCH 18/18] MdeModulePkg: Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (16 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 17/18] ArmVirtPkg: " Guomin Jiang
@ 2020-05-08  8:38 ` Guomin Jiang
  2020-05-08 10:09 ` [edk2-devel] [PATCH 00/18] " Laszlo Ersek
  18 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08  8:38 UTC (permalink / raw)
  To: devel; +Cc: GuoMinJ, Jian J Wang, Hao A Wu

From: GuoMinJ <newexplorerj@gmail.com>

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

Remove the PcdConOutGopSupport definition.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
---
 MdeModulePkg/MdeModulePkg.dec | 7 -------
 MdeModulePkg/MdeModulePkg.uni | 6 ------
 2 files changed, 13 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index a31f0a85883d..637ff688f247 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -684,13 +684,6 @@ [PcdsFeatureFlag]
   # @Prompt Enable Unicode Collation 2 support.
   gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support|TRUE|BOOLEAN|0x00010041
 
-  ## Indicates if Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
-  #  It could be set FALSE to save size.<BR><BR>
-  #   TRUE  - Installs Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>
-  #   FALSE - Does not install Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>
-  # @Prompt Enable ConOut GOP support.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE|BOOLEAN|0x00010042
-
   ## Indicates PeiCore will first search TE section from the PEIM to load the image, or PE32 section, when PeiCore dispatches a PEI module.
   #  This PCD is used to tune PEI phase performance to reduce the search image time.
   #  It can be set according to the generated image section type.<BR><BR>
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index 0cfcb0039d7f..410c276f21e6 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -690,12 +690,6 @@
                                                                                              "TRUE  - Installs Unicode Collation 2 Protocol.<BR>\n"
                                                                                              "FALSE - Does not install Unicode Collation 2 Protocol.<BR>"
 
-#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdConOutGopSupport_PROMPT  #language en-US "Enable ConOut GOP support"
-
-#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdConOutGopSupport_HELP  #language en-US "Indicates if Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe. It could be set FALSE to save size.<BR><BR>\n"
-                                                                                     "TRUE  - Installs Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>\n"
-                                                                                     "FALSE - Does not install Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>"
-
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPeiCoreImageLoaderSearchTeSectionFirst_PROMPT  #language en-US "PeiCore search TE section first"
 
 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPeiCoreImageLoaderSearchTeSectionFirst_HELP  #language en-US "Indicates PeiCore will first search TE section from the PEIM to load the image, or PE32 section, when PeiCore dispatches a PEI module. This PCD is used to tune PEI phase performance to reduce the search image time. It can be set according to the generated image section type.<BR><BR>\n"
-- 
2.25.1.windows.1


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

* Re: [edk2-devel] [PATCH 00/18] Remove All UGA Support
  2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
                   ` (17 preceding siblings ...)
  2020-05-08  8:38 ` [PATCH 18/18] MdeModulePkg: " Guomin Jiang
@ 2020-05-08 10:09 ` Laszlo Ersek
  2020-05-08 11:00   ` Ard Biesheuvel
  18 siblings, 1 reply; 27+ messages in thread
From: Laszlo Ersek @ 2020-05-08 10:09 UTC (permalink / raw)
  To: devel, guomin.jiang; +Cc: Ard Biesheuvel (ARM address)

Hello Guomin,

On 05/08/20 10:38, Guomin Jiang wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> UGA is replaced by GOP and remove all related code.

I'm responding under the cover letter.


(1) You should have CC'd the cover letter to each person that is CC'd on
at least one patch in the series. Please do that in the future.

I'm CC'ing Ard now, at least.


(2) The series currently has identical subjects for some of the patches.
For example:

[PATCH 08/18] OvmfPkg: Remove All UGA Support
[PATCH 15/18] OvmfPkg: Remove All UGA Support

[PATCH 10/18] ArmVirtPkg: Remove All UGA Support
[PATCH 17/18] ArmVirtPkg: Remove All UGA Support

This is extremely bad practice. Please don't do this.


(3) The commit messages do a bad job explaining why the PCDs are being
removed.

If I understand correctly, the core modules are updated in this series
as follows:

- PcdConOutUgaSupport is assumed constant FALSE
- PcdConOutGopSupport is assumed constant TRUE
- conditions are simplified and dead code is eliminated


The proper approach is therefore the following:

- In patch#1, change the DEC default value of PcdConOutUgaSupport from
TRUE to FALSE.

- In patches #2 .. #n, remove the PCD settins from all the DSC files.
Just one patch per package is sufficient. (No need for a separate patch
per PCD per Package.)

The commit messages on these patches should explain that the PCDs are
going away, and by deleting the DSC settings, the platforms in question
inherit the DEC defaults. And, at this point the DEC defaults are:

PcdConOutUgaSupport = FALSE
PcdConOutGopSupport = TRUE

which is going to be the only configuration supported by edk2 in the future.

For example, patch#2 could be for ArmVirtPkg, patch#3 could be for OvmfPkg.

- In the rest of the patches, simplify code / eliminate dead code by
substituting FALSE for PcdConOutUgaSupport, and TRUE for
PcdConOutGopSupport. If you want, you can keep the code changes for each
PCD separate, in every module. (This kind of separation may be a good idea.)

- In the last patch in the series, remove both PCDs from the DEC file.


Before posting v2, please verify that the series (including the
platforms in edk2) build fine at every stage (at every patch in the series).

Thanks
Laszlo


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

* Re: [edk2-devel] [PATCH 00/18] Remove All UGA Support
  2020-05-08 10:09 ` [edk2-devel] [PATCH 00/18] " Laszlo Ersek
@ 2020-05-08 11:00   ` Ard Biesheuvel
  2020-05-08 13:04     ` Guomin Jiang
  0 siblings, 1 reply; 27+ messages in thread
From: Ard Biesheuvel @ 2020-05-08 11:00 UTC (permalink / raw)
  To: Laszlo Ersek, devel, guomin.jiang

On 5/8/20 12:09 PM, Laszlo Ersek wrote:
> Hello Guomin,
> 
> On 05/08/20 10:38, Guomin Jiang wrote:
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
>>
>> UGA is replaced by GOP and remove all related code.
> 
> I'm responding under the cover letter.
> 
> 
> (1) You should have CC'd the cover letter to each person that is CC'd on
> at least one patch in the series. Please do that in the future.
> 
> I'm CC'ing Ard now, at least.
> 

Thanks Laszlo

> 
> (2) The series currently has identical subjects for some of the patches.
> For example:
> 
> [PATCH 08/18] OvmfPkg: Remove All UGA Support
> [PATCH 15/18] OvmfPkg: Remove All UGA Support
> 
> [PATCH 10/18] ArmVirtPkg: Remove All UGA Support
> [PATCH 17/18] ArmVirtPkg: Remove All UGA Support
> 
> This is extremely bad practice. Please don't do this.
> 
> 
> (3) The commit messages do a bad job explaining why the PCDs are being
> removed.
> 
> If I understand correctly, the core modules are updated in this series
> as follows:
> 
> - PcdConOutUgaSupport is assumed constant FALSE
> - PcdConOutGopSupport is assumed constant TRUE
> - conditions are simplified and dead code is eliminated
> 
> 
> The proper approach is therefore the following:
> 
> - In patch#1, change the DEC default value of PcdConOutUgaSupport from
> TRUE to FALSE.
> 
> - In patches #2 .. #n, remove the PCD settins from all the DSC files.
> Just one patch per package is sufficient. (No need for a separate patch
> per PCD per Package.)
> 
> The commit messages on these patches should explain that the PCDs are
> going away, and by deleting the DSC settings, the platforms in question
> inherit the DEC defaults. And, at this point the DEC defaults are:
> 
> PcdConOutUgaSupport = FALSE
> PcdConOutGopSupport = TRUE
> 
> which is going to be the only configuration supported by edk2 in the future.
> 
> For example, patch#2 could be for ArmVirtPkg, patch#3 could be for OvmfPkg.
> 
> - In the rest of the patches, simplify code / eliminate dead code by
> substituting FALSE for PcdConOutUgaSupport, and TRUE for
> PcdConOutGopSupport. If you want, you can keep the code changes for each
> PCD separate, in every module. (This kind of separation may be a good idea.)
> 
> - In the last patch in the series, remove both PCDs from the DEC file.
> 
> 
> Before posting v2, please verify that the series (including the
> platforms in edk2) build fine at every stage (at every patch in the series).
> 

Also, looking at edk2-platforms

$ git grep -l PcdUga
Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
Platform/Comcast/RDKQemu/RDKQemu.dsc
Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
Platform/Intel/SimicsOpenBoardPkg/Library/DxeLogoLib/DxeLogoLib.inf
Platform/Intel/SimicsOpenBoardPkg/Library/DxeLogoLib/Logo.c
Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
Platform/RaspberryPi/RPi3/RPi3.dsc
Platform/RaspberryPi/RPi4/RPi4.dsc
Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc
Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
Silicon/NXP/NxpQoriqLs.dsc.inc

Those platforms will all be broken as soon as you drop the PCD definitions.


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

* Re: [edk2-devel] [PATCH 00/18] Remove All UGA Support
  2020-05-08 11:00   ` Ard Biesheuvel
@ 2020-05-08 13:04     ` Guomin Jiang
  0 siblings, 0 replies; 27+ messages in thread
From: Guomin Jiang @ 2020-05-08 13:04 UTC (permalink / raw)
  To: Ard Biesheuvel, Laszlo Ersek, devel@edk2.groups.io

Ard and Laszlo,

It's my problem.

I will improve the patch and make it  more professional.

I am busy recently and will do it after July.

Thanks

> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Sent: Friday, May 8, 2020 7:00 PM
> To: Laszlo Ersek <lersek@redhat.com>; devel@edk2.groups.io; Jiang, Guomin
> <guomin.jiang@intel.com>
> Subject: Re: [edk2-devel] [PATCH 00/18] Remove All UGA Support
> 
> On 5/8/20 12:09 PM, Laszlo Ersek wrote:
> > Hello Guomin,
> >
> > On 05/08/20 10:38, Guomin Jiang wrote:
> >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> >>
> >> UGA is replaced by GOP and remove all related code.
> >
> > I'm responding under the cover letter.
> >
> >
> > (1) You should have CC'd the cover letter to each person that is CC'd
> > on at least one patch in the series. Please do that in the future.
> >
> > I'm CC'ing Ard now, at least.
> >
> 
> Thanks Laszlo
> 
> >
> > (2) The series currently has identical subjects for some of the patches.
> > For example:
> >
> > [PATCH 08/18] OvmfPkg: Remove All UGA Support [PATCH 15/18] OvmfPkg:
> > Remove All UGA Support
> >
> > [PATCH 10/18] ArmVirtPkg: Remove All UGA Support [PATCH 17/18]
> > ArmVirtPkg: Remove All UGA Support
> >
> > This is extremely bad practice. Please don't do this.
> >
> >
> > (3) The commit messages do a bad job explaining why the PCDs are being
> > removed.
> >
> > If I understand correctly, the core modules are updated in this series
> > as follows:
> >
> > - PcdConOutUgaSupport is assumed constant FALSE
> > - PcdConOutGopSupport is assumed constant TRUE
> > - conditions are simplified and dead code is eliminated
> >
> >
> > The proper approach is therefore the following:
> >
> > - In patch#1, change the DEC default value of PcdConOutUgaSupport from
> > TRUE to FALSE.
> >
> > - In patches #2 .. #n, remove the PCD settins from all the DSC files.
> > Just one patch per package is sufficient. (No need for a separate
> > patch per PCD per Package.)
> >
> > The commit messages on these patches should explain that the PCDs are
> > going away, and by deleting the DSC settings, the platforms in
> > question inherit the DEC defaults. And, at this point the DEC defaults are:
> >
> > PcdConOutUgaSupport = FALSE
> > PcdConOutGopSupport = TRUE
> >
> > which is going to be the only configuration supported by edk2 in the future.
> >
> > For example, patch#2 could be for ArmVirtPkg, patch#3 could be for
> OvmfPkg.
> >
> > - In the rest of the patches, simplify code / eliminate dead code by
> > substituting FALSE for PcdConOutUgaSupport, and TRUE for
> > PcdConOutGopSupport. If you want, you can keep the code changes for
> > each PCD separate, in every module. (This kind of separation may be a
> > good idea.)
> >
> > - In the last patch in the series, remove both PCDs from the DEC file.
> >
> >
> > Before posting v2, please verify that the series (including the
> > platforms in edk2) build fine at every stage (at every patch in the series).
> >
> 
> Also, looking at edk2-platforms
> 
> $ git grep -l PcdUga
> Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> Platform/Comcast/RDKQemu/RDKQemu.dsc
> Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> Platform/Intel/SimicsOpenBoardPkg/Library/DxeLogoLib/DxeLogoLib.inf
> Platform/Intel/SimicsOpenBoardPkg/Library/DxeLogoLib/Logo.c
> Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManage
> rLib.inf
> Platform/RaspberryPi/RPi3/RPi3.dsc
> Platform/RaspberryPi/RPi4/RPi4.dsc
> Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
> Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc
> Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> Silicon/NXP/NxpQoriqLs.dsc.inc
> 
> Those platforms will all be broken as soon as you drop the PCD definitions.


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

* Re: [PATCH 02/18] UefiPayloadPkg: Remove All UGA Support
  2020-05-08  8:38 ` [PATCH 02/18] UefiPayloadPkg: " Guomin Jiang
@ 2020-05-08 14:57   ` Ma, Maurice
  0 siblings, 0 replies; 27+ messages in thread
From: Ma, Maurice @ 2020-05-08 14:57 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: GuoMinJ, Dong, Guo, You, Benjamin

Reviewed-by: Maurice Ma <maurice.ma@intel.com>

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Friday, May 8, 2020 1:38
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Ma, Maurice
> <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>; You, Benjamin
> <benjamin.you@intel.com>
> Subject: [PATCH 02/18] UefiPayloadPkg: Remove All UGA Support
> 
> From: GuoMinJ <newexplorerj@gmail.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove All UGA Support in UefiPayloadPkg.
> 
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
>  .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf   | 2 --
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc                           | 1 -
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc                        | 1 -
>  3 files changed, 4 deletions(-)
> 
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> index 1f5a0bcad038..1072a3b21011 100644
> ---
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> +++
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> @@ -53,14 +53,12 @@ [Guids]
>  [Protocols]
>    gEfiGenericMemTestProtocolGuid  ## CONSUMES
>    gEfiGraphicsOutputProtocolGuid  ## CONSUMES
> -  gEfiUgaDrawProtocolGuid         ## CONSUMES
>    gEfiBootLogoProtocolGuid        ## CONSUMES
>    gEfiDxeSmmReadyToLockProtocolGuid
>    gEfiSmmAccess2ProtocolGuid
> 
>  [Pcd]
>    gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
> -  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index d52945442e0e..e8832925eed8 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -272,7 +272,6 @@ [PcdsFeatureFlag]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> 
>  [PcdsFixedAtBuild]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 0736cd995476..20462f68817d 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -273,7 +273,6 @@ [PcdsFeatureFlag]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> 
>  [PcdsFixedAtBuild]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
> --
> 2.25.1.windows.1


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

* Re: [PATCH 16/18] UefiPayloadPkg: Remove All UGA Support
  2020-05-08  8:38 ` [PATCH 16/18] UefiPayloadPkg: " Guomin Jiang
@ 2020-05-08 14:58   ` Ma, Maurice
  0 siblings, 0 replies; 27+ messages in thread
From: Ma, Maurice @ 2020-05-08 14:58 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: GuoMinJ, Dong, Guo, You, Benjamin

Reviewed-by: Maurice Ma <maurice.ma@intel.com>

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Friday, May 8, 2020 1:38
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Ma, Maurice
> <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>; You, Benjamin
> <benjamin.you@intel.com>
> Subject: [PATCH 16/18] 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.
> 
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
>  .../Library/PlatformBootManagerLib/PlatformBootManager.h        | 2 +-
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc                           | 1 -
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc                        | 1 -
>  3 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> index 2f600c796ff2..3ab0a24d384a 100644
> ---
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> +++
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> @@ -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     Devices are back in text mode and synced up.
> 
>  **/
>  EFI_STATUS
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index e8832925eed8..d31f6ca4fb7d 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -271,7 +271,6 @@ [PcdsFeatureFlag]
>  !endif
>    gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> 
>  [PcdsFixedAtBuild]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 20462f68817d..8d67e25731e3 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -272,7 +272,6 @@ [PcdsFeatureFlag]
>  !endif
>    gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> 
>  [PcdsFixedAtBuild]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
> --
> 2.25.1.windows.1


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

* Re: [edk2-devel] [PATCH 01/18] BaseTools: Remove All UGA Support
  2020-05-08  8:38 ` [PATCH 01/18] BaseTools: " Guomin Jiang
@ 2020-05-09  1:47   ` Ni, Ray
  0 siblings, 0 replies; 27+ messages in thread
From: Ni, Ray @ 2020-05-09  1:47 UTC (permalink / raw)
  To: devel@edk2.groups.io, Jiang, Guomin; +Cc: GuoMinJ, Feng, Bob C, Gao, Liming

Guomin,
Can you complete remove HiiFramework.h?

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Guomin Jiang
> Sent: Friday, May 8, 2020 4:38 PM
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH 01/18] BaseTools: Remove All UGA Support
> 
> From: GuoMinJ <newexplorerj@gmail.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove all UGA support in BaseTools package.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
>  .../Source/C/Include/Protocol/HiiFramework.h  |  51 ------
>  BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 ------------------
>  2 files changed, 212 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..09cbf23640c1 100644
> --- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
> +++ b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
> @@ -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.25.1.windows.1
> 
> 
> 


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

* Re: [PATCH 07/18] EmulatorPkg: Remove All UGA Support
  2020-05-08  8:38 ` [PATCH 07/18] EmulatorPkg: " Guomin Jiang
@ 2020-05-09  3:02   ` Ni, Ray
  0 siblings, 0 replies; 27+ messages in thread
From: Ni, Ray @ 2020-05-09  3:02 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io
  Cc: GuoMinJ, Justen, Jordan L, Andrew Fish

Guomin,
Have you tested the EmulatorPkg in Linux environment with this change?

What's the result?

Thanks,
Ray

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Friday, May 8, 2020 4:38 PM
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish <afish@apple.com>;
> Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH 07/18] 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.
> 
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
>  EmulatorPkg/EmuGopDxe/Gop.h                   |  8 ++-
>  EmulatorPkg/EmuGopDxe/GopScreen.c             | 14 ++---
>  EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 18 +++----
>  .../Include/Protocol/EmuGraphicsWindow.h      | 18 +++----
>  .../Library/PlatformBmLib/PlatformBm.h        |  2 +-
>  .../Library/PlatformBmLib/PlatformBmData.c    |  4 +-
>  EmulatorPkg/Unix/Host/Gasket.h                |  9 +---
>  EmulatorPkg/Unix/Host/Host.h                  |  1 -
>  EmulatorPkg/Unix/Host/Ia32/Gasket.S           |  2 +-
>  EmulatorPkg/Unix/Host/X11GraphicsWindow.c     | 54 +++++++++----------
>  EmulatorPkg/Unix/Host/X64/Gasket.S            |  2 +-
>  EmulatorPkg/Win/Host/WinGopScreen.c           |  4 +-
>  12 files changed, 64 insertions(+), 72 deletions(-)
> 
> diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h
> index 389666327651..5376e8077ea2 100644
> --- a/EmulatorPkg/EmuGopDxe/Gop.h
> +++ b/EmulatorPkg/EmuGopDxe/Gop.h
> @@ -6,8 +6,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
> -#ifndef __UGA_H_
> -#define __UGA_H_
> +#ifndef __GOP_H_
> +#define __GOP_H_
> 
>  #include <PiDxe.h>
> 
> @@ -63,8 +63,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;
> @@ -87,7 +85,7 @@ typedef struct {
> 
> 
>    //
> -  // UGA Private Data knowing when to start hardware
> +  // @todo GOP?? Private Data knowing when to start hardware
>    //
>    BOOLEAN                           HardwareNeedsStarting;
> 
> diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c
> index fbac649f8b3e..6ae5a07ba0c5 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.
> 
> @@ -215,7 +215,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);
>    }
> 
>    //
> @@ -226,8 +226,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;
> @@ -238,8 +238,8 @@ EmuGopBlt (
>    GopBltArgs.Delta        = Delta;
>    Status = Private->EmuGraphicsWindow->Blt (
>                              Private->EmuGraphicsWindow,
> -                            (EFI_UGA_PIXEL *)BltBuffer,
> -                            (EFI_UGA_BLT_OPERATION)BltOperation,
> +                            BltBuffer,
> +                            BltOperation,
>                              &GopBltArgs
>                              );
> 
> @@ -391,7 +391,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 8ac9d9ba5dd3..eba747062c44 100644
> --- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> +++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> @@ -13,13 +13,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 } }
> @@ -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
>    );
> 
> @@ -91,8 +91,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/Include/Protocol/EmuGraphicsWindow.h b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
> index 07d4070b3584..e9b85c8eb373 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
>    );
> 
> @@ -85,8 +85,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 ce508b6b58f5..7bf9909511f0 100644
> --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
> @@ -61,7 +61,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;
> 
> 
>  //
> diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> index 115102160605..5c2f9a6a4df4 100644
> --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
> @@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> 
> -EMU_PLATFORM_UGA_DEVICE_PATH gGopDevicePath = {
> +EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH gGopDevicePath = {
>    {
>      {
>        {
> @@ -42,7 +42,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 e082397d23fb..1b67264f3e0e 100644
> --- a/EmulatorPkg/Unix/Host/Gasket.h
> +++ b/EmulatorPkg/Unix/Host/Gasket.h
> @@ -206,11 +206,6 @@ ReverseGasketUint64Uint64 (
>    VOID      *Key
>    );
> 
> -//
> -// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
> -//
> -
> -
>  EFI_STATUS
>  EFIAPI
>  GasketX11Size (
> @@ -253,8 +248,8 @@ EFI_STATUS
>  EFIAPI
>  GasketX11Blt (
>    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/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h
> index 9791cf8c370e..ccae162ed4a6 100644
> --- a/EmulatorPkg/Unix/Host/Host.h
> +++ b/EmulatorPkg/Unix/Host/Host.h
> @@ -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 5325a0e35bf9..d4ef053db1bc 100644
> --- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> +++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
> @@ -591,8 +591,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)
> @@ -600,15 +600,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;
> @@ -675,7 +675,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
>        //
>      }
>    }
> @@ -708,8 +708,8 @@ X11RegisterKeyNotify (
>  EFI_STATUS
>  X11Blt (
>    IN EMU_GRAPHICS_WINDOW_PROTOCOL             *GraphicsIo,
> -  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
>    )
>  {
> @@ -719,7 +719,7 @@ X11Blt (
>    UINTN             DstX;
>    UINTN             SrcX;
>    UINTN             Index;
> -  EFI_UGA_PIXEL     *Blt;
> +  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
>    UINT8             *Dst;
>    UINT8             *Src;
>    UINTN             Nbr;
> @@ -732,8 +732,8 @@ X11Blt (
>    //
>    //  Check bounds
>    //
> -  if (BltOperation == EfiUgaVideoToBltBuffer
> -      || BltOperation == EfiUgaVideoToVideo) {
> +  if (BltOperation == EfiBltVideoToBltBuffer
> +      || BltOperation == EfiBltVideoToVideo) {
>      //
>      // Source is Video.
>      //
> @@ -746,9 +746,9 @@ X11Blt (
>      }
>    }
> 
> -  if (BltOperation == EfiUgaBltBufferToVideo
> -      || BltOperation == EfiUgaVideoToVideo
> -      || BltOperation == EfiUgaVideoFill) {
> +  if (BltOperation == EfiBltBufferToVideo
> +      || BltOperation == EfiBltVideoToVideo
> +      || BltOperation == EfiBltVideoFill) {
>      //
>      // Destination is Video
>      //
> @@ -762,28 +762,28 @@ 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)
> @@ -809,7 +809,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++) {
> @@ -825,7 +825,7 @@ X11Blt (
>    //  Refresh screen.
>    //
>    switch (BltOperation) {
> -  case EfiUgaVideoToVideo:
> +  case EfiBltVideoToVideo:
>      XCopyArea(
>        Private->display, Private->win, Private->win, Private->gc,
>        Args->SourceX, Args->SourceY, Args->Width, Args->Height,
> @@ -840,7 +840,7 @@ X11Blt (
>        }
>      }
>      break;
> -  case EfiUgaVideoFill:
> +  case EfiBltVideoFill:
>      Color = X11PixelToColor (Private, *BltBuffer);
>      XSetForeground (Private->display, Private->gc, Color);
>      XFillRectangle (
> @@ -849,7 +849,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 74011e225e30..9c51cc326ba5 100644
> --- a/EmulatorPkg/Win/Host/WinGopScreen.c
> +++ b/EmulatorPkg/Win/Host/WinGopScreen.c
> @@ -322,8 +322,8 @@ WinNtWndSize (
>  EFI_STATUS
>  WinNtWndBlt (
>    IN  EMU_GRAPHICS_WINDOW_PROTOCOL            *GraphicsIo,
> -  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
>  )
>  {
> --
> 2.25.1.windows.1


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

* Re: [PATCH 13/18] MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  2020-05-08  8:38 ` [PATCH 13/18] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
@ 2020-05-09  3:03   ` Ni, Ray
  0 siblings, 0 replies; 27+ messages in thread
From: Ni, Ray @ 2020-05-09  3:03 UTC (permalink / raw)
  To: Jiang, Guomin, devel@edk2.groups.io; +Cc: GuoMinJ, Gao, Zhichao

The information in commit message is not helpful for me
to understand why this change can avoid OVMF hang.

> -----Original Message-----
> From: Jiang, Guomin <guomin.jiang@intel.com>
> Sent: Friday, May 8, 2020 4:38 PM
> To: devel@edk2.groups.io
> Cc: GuoMinJ <newexplorerj@gmail.com>; Gao, Zhichao <zhichao.gao@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH 13/18] MdeModulePkg/ConSplitterDxe: Remove All UGA Support
> 
> From: GuoMinJ <newexplorerj@gmail.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Avoid OVMF hang when remove UGA support.
> 
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
> ---
>  .../Universal/Console/ConSplitterDxe/ConSplitter.c   | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> index 3fdeee4b409b..18c25956d0d9 100644
> --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
> @@ -3060,12 +3060,14 @@ ConSplitterTextOutAddDevice (
>      DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput);
>    }
> 
> -  Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
> -  if (EFI_ERROR (Status)) {
> -    return Status;
> +  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));
> +    FreePool (Info);
>    }
> -  ASSERT ( SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
> -  FreePool (Info);
> 
>    if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) &&
>        ((Private->CurrentNumberOfGraphicsOutput) == 1)) {
> --
> 2.25.1.windows.1


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

end of thread, other threads:[~2020-05-09  3:03 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-08  8:38 [PATCH 00/18] Remove All UGA Support Guomin Jiang
2020-05-08  8:38 ` [PATCH 01/18] BaseTools: " Guomin Jiang
2020-05-09  1:47   ` [edk2-devel] " Ni, Ray
2020-05-08  8:38 ` [PATCH 02/18] UefiPayloadPkg: " Guomin Jiang
2020-05-08 14:57   ` Ma, Maurice
2020-05-08  8:38 ` [PATCH 03/18] ShellPkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 04/18] MdeModulePkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 05/18] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 06/18] MdeModulePkg/GraphicsConsoleDxe: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 07/18] EmulatorPkg: " Guomin Jiang
2020-05-09  3:02   ` Ni, Ray
2020-05-08  8:38 ` [PATCH 08/18] OvmfPkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 09/18] ArmPkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 10/18] ArmVirtPkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 11/18] MdePkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 12/18] MdeModulePkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 13/18] MdeModulePkg/ConSplitterDxe: " Guomin Jiang
2020-05-09  3:03   ` Ni, Ray
2020-05-08  8:38 ` [PATCH 14/18] " Guomin Jiang
2020-05-08  8:38 ` [PATCH 15/18] OvmfPkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 16/18] UefiPayloadPkg: " Guomin Jiang
2020-05-08 14:58   ` Ma, Maurice
2020-05-08  8:38 ` [PATCH 17/18] ArmVirtPkg: " Guomin Jiang
2020-05-08  8:38 ` [PATCH 18/18] MdeModulePkg: " Guomin Jiang
2020-05-08 10:09 ` [edk2-devel] [PATCH 00/18] " Laszlo Ersek
2020-05-08 11:00   ` Ard Biesheuvel
2020-05-08 13:04     ` Guomin Jiang

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