From: GuoMinJ <newexplor...@gmail.com>

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

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

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

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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91393): https://edk2.groups.io/g/devel/message/91393
Mute This Topic: https://groups.io/mt/92393227/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to