[edk2-devel] [PATCH 07/18] EmulatorPkg: Remove All UGA Support

Guomin Jiang posted 18 patches 5 years, 9 months ago
[edk2-devel] [PATCH 07/18] EmulatorPkg: Remove All UGA Support
Posted by Guomin Jiang 5 years, 9 months ago
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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58853): https://edk2.groups.io/g/devel/message/58853
Mute This Topic: https://groups.io/mt/74068786/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH 07/18] EmulatorPkg: Remove All UGA Support
Posted by Ni, Ray 5 years, 9 months ago
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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58938): https://edk2.groups.io/g/devel/message/58938
Mute This Topic: https://groups.io/mt/74068786/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-