From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.1082.1642121466955476862 for ; Thu, 13 Jan 2022 16:51:28 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=cedIEhkm; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: guomin.jiang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642121488; x=1673657488; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z8RDpdnSGmy3wjFbd3fr1lpbF73lu3fHvme6nInmRJk=; b=cedIEhkm79dcLmW9A2s1KVvGmhcpXMpvZq3EDLU36/nBo56On5TgG5LF VCnFUXWbakulIyDi8UufFot3Z5o/4p1coDs/y1JPY0S8x7LZr9smTQC5a qWkbgbifIXXeVBLNnsVZsR0KxfGJylab9ikkw+blvvAEcPtmxtG1GYcbb vJVDYCoSFdXc9Dza1kgVJOR7KBTAKKg4OT3lUjFc7FvGXyQ+553y3u8Dd bzkoFr9CqWPkIEbclKPZlmeOBcCnBW/NI5a7+8uiqvHJlzgj2SIiIiPH2 3cshGpsZGl+2uTlR7X3Wpehq7vhcerK356K3eTvOyuKZLQIlQtX53mumZ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10226"; a="241713906" X-IronPort-AV: E=Sophos;i="5.88,287,1635231600"; d="scan'208";a="241713906" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 16:51:28 -0800 X-IronPort-AV: E=Sophos;i="5.88,287,1635231600"; d="scan'208";a="475564790" Received: from guominji-mobl.ccr.corp.intel.com ([10.238.9.87]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 16:51:26 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: GuoMinJ , Jian J Wang , Liming Gao , Zhichao Gao , Ray Ni , Hao A Wu Subject: [PATCH 09/11] MdeModulePkg: Remove All UGA Support Date: Fri, 14 Jan 2022 08:50:42 +0800 Message-Id: <20220114005044.1975-10-guomin.jiang@intel.com> X-Mailer: git-send-email 2.30.0.windows.2 In-Reply-To: <20220114005044.1975-1-guomin.jiang@intel.com> References: <20220114005044.1975-1-guomin.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: GuoMinJ REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368 Remove All UGA Support in MdeModulePkg, first remove from library. Remove the PcdConOutGopSupport definition. Signed-off-by: Guomin Jiang Cc: Jian J Wang Cc: Liming Gao Cc: Zhichao Gao Cc: Ray Ni Cc: Hao A Wu --- MdeModulePkg/MdeModulePkg.dec | 14 -- .../Library/BootLogoLib/BootLogoLib.inf | 4 - MdeModulePkg/Include/Library/BootLogoLib.h | 4 +- MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 4 +- .../Library/BootLogoLib/BootLogoLib.c | 228 +++++------------- MdeModulePkg/MdeModulePkg.uni | 12 - 6 files changed, 60 insertions(+), 206 deletions(-) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 463e889e9a68..21e037269cce 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -726,20 +726,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.

- # TRUE - Installs Graphics Output Protocol on virtual handle created by ConsplitterDxe.
- # FALSE - Does not install Graphics Output Protocol on virtual handle created by ConsplitterDxe.
- # @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.

- # TRUE - Installs UGA Draw Protocol on virtual handle created by ConsplitterDxe.
- # FALSE - Does not install UGA Draw Protocol on virtual handle created by ConsplitterDxe.
- # @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.

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

\n" - "TRUE - Installs Graphics Output Protocol on virtual handle created by ConsplitterDxe.
\n" - "FALSE - Does not install Graphics Output Protocol on virtual handle created by ConsplitterDxe.
" - -#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.

\n" - "TRUE - Installs UGA Draw Protocol on virtual handle created by ConsplitterDxe.
\n" - "FALSE - Does not install UGA Draw Protocol on virtual handle created by ConsplitterDxe.
" - #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.

\n" -- 2.30.0.windows.2