From nobody Mon Feb 9 12:27:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+58850+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58850+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1588927130; cv=none; d=zohomail.com; s=zohoarc; b=ZNelcw673oyjMORVLmWq2M3P/MB6MWkjFRrQpkCqBwZdUORt1gymgdpqlDlL1h6LO3gyJ9D78qZ+7uodiNGBDSpMlaOJ8AvhcGBERsJE35HDzB75uxW2sotEC/8Q3582Ie1DsebbXjXESs10jOgVvW00c9aDJvRBgXHG/GmTAfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588927130; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=oR/bJONs+88fyS8GuoPsscEx93ugOuRmjGF3P0/ahoY=; b=Sx9Ej5G16Qd/R/nE1WsPaeEpH0Rq+VX+DiUA7dNU3wHG3nTxKabEFK3FIfnqsbKt13Eafx4m9oDXdFJM0BYmzo8VuJDzvyvjXCvmPj4ZnQqnCg4XM6nea81Aju9SDYK2FhzXmXf+3hyL2WlSAcugGINrqC7yZSnVjtrI7tUlfc0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58850+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1588927130443109.58354305644616; Fri, 8 May 2020 01:38:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VpZXYY1788612xJCfeIhXp0T; Fri, 08 May 2020 01:38:50 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.6879.1588927128006250571 for ; Fri, 08 May 2020 01:38:48 -0700 IronPort-SDR: P5gWE+YOq42AgoNsmFUL969JOGiAPa4qENpvU6jYGZ/uR2eVZ20L+WUjZYR90F8dJoNTt1aZun FHmLMns4C1Ig== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 01:38:32 -0700 IronPort-SDR: FGaMiQOSK3AgIscy6arVenxPcsnOxreqNMuVXxnWeb0wXTTMAdZJOx2cm3mQHIp5MBf8iiCY/T 6aR+kkujyw1g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,367,1583222400"; d="scan'208";a="305366573" X-Received: from guominji-mobl.ccr.corp.intel.com ([10.238.4.95]) by FMSMGA003.fm.intel.com with ESMTP; 08 May 2020 01:38:31 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: GuoMinJ , Jian J Wang , Hao A Wu Subject: [edk2-devel] [PATCH 04/18] MdeModulePkg: Remove All UGA Support Date: Fri, 8 May 2020 16:38:10 +0800 Message-Id: <20200508083824.1785-5-guomin.jiang@intel.com> In-Reply-To: <20200508083824.1785-1-guomin.jiang@intel.com> References: <20200508083824.1785-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guomin.jiang@intel.com X-Gm-Message-State: ScwH9ZigFoUxN6cS6tKkFKgix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1588927130; bh=f6SIWnl8vkZt/PTjxr6b0jrkcNkqsh0KU7126EObUrg=; h=Cc:Date:From:Reply-To:Subject:To; b=RstiCPG8Afy7KsHteAK6mpujg4YHbno+ecYysBreM81yqDtfSp6kFSy9vCwjGy+8zbV dEUMJe/XFRJZJZVG/nJtiBpOpnt6CQr/lhYO1ZRl9cS03ASDVbxSiuw/RjIes5NMDHB5M DswJ6cm2nJNPWEJoXTjZaWErjmpiLU+s37Q= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: GuoMinJ REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2368 Remove All UGA Support in MdeModulePkg, first remove from library. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Guomin Jiang --- MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 2 +- MdeModulePkg/Include/Library/BootLogoLib.h | 2 +- .../Library/BootLogoLib/BootLogoLib.c | 224 +++++------------- .../Library/BootLogoLib/BootLogoLib.inf | 4 - 4 files changed, 55 insertions(+), 177 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci= /PciBusDxe/PciBus.c index 64284ac8251c..2b03ecb258c6 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c @@ -49,7 +49,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PCI_HOTPLUG_REQUEST_PRO= TOCOL mPciHotPlugReques Installs driver module protocols and. Creates virtual device handles for= ConIn, ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex = protocol, Simple Pointer protocol, Absolute Pointer protocol on those virtual hand= lers. - Installs Graphics Output protocol and/or UGA Draw protocol if needed. + Installs Graphics Output protocol if needed. =20 @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. @param[in] SystemTable A pointer to the EFI System Table. diff --git a/MdeModulePkg/Include/Library/BootLogoLib.h b/MdeModulePkg/Incl= ude/Library/BootLogoLib.h index afd895b257c3..8af87790d1d3 100644 --- a/MdeModulePkg/Include/Library/BootLogoLib.h +++ b/MdeModulePkg/Include/Library/BootLogoLib.h @@ -27,7 +27,7 @@ BootLogoEnableLogo ( Use SystemTable ConOut to turn on video based Simple Text Out consoles. = The Simple Text Out screens will now be synced up with all non-video output = devices. =20 - @retval EFI_SUCCESS UGA devices are back in text mode and synced up. + @retval EFI_SUCCESS Devices are back in text mode and synced up. =20 **/ EFI_STATUS diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/= Library/BootLogoLib/BootLogoLib.c index 134660f28d34..ce8e725fedab 100644 --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c @@ -12,7 +12,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #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; } =20 - UgaDraw =3D NULL; // // Try to open GOP first // Status =3D gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutp= utProtocolGuid, (VOID **) &GraphicsOutput); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { - GraphicsOutput =3D NULL; - // - // Open GOP failed, try to open UGA - // - Status =3D gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawPro= tocolGuid, (VOID **) &UgaDraw); - if (EFI_ERROR (Status)) { - UgaDraw =3D NULL; - } - } if (EFI_ERROR (Status)) { return EFI_UNSUPPORTED; } @@ -108,17 +93,8 @@ BootLogoEnableLogo ( // gST->ConOut->EnableCursor (gST->ConOut, FALSE); =20 - if (GraphicsOutput !=3D NULL) { - SizeOfX =3D GraphicsOutput->Mode->Info->HorizontalResolution; - SizeOfY =3D GraphicsOutput->Mode->Info->VerticalResolution; - - } else { - ASSERT (UgaDraw !=3D NULL); - Status =3D UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth,= &RefreshRate); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - } + SizeOfX =3D GraphicsOutput->Mode->Info->HorizontalResolution; + SizeOfY =3D GraphicsOutput->Mode->Info->VerticalResolution; =20 Blt =3D NULL; NumberOfLogos =3D 0; @@ -205,34 +181,18 @@ BootLogoEnableLogo ( DestY +=3D OffsetY; =20 if ((DestX >=3D 0) && (DestY >=3D 0)) { - if (GraphicsOutput !=3D NULL) { - Status =3D GraphicsOutput->Blt ( - GraphicsOutput, - Blt, - EfiBltBufferToVideo, - 0, - 0, - (UINTN) DestX, - (UINTN) DestY, - Image.Width, - Image.Height, - Image.Width * sizeof (EFI_GRAPHICS_OUTP= UT_BLT_PIXEL) - ); - } else { - ASSERT (UgaDraw !=3D NULL); - Status =3D 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 =3D GraphicsOutput->Blt ( + GraphicsOutput, + Blt, + EfiBltBufferToVideo, + 0, + 0, + (UINTN) DestX, + (UINTN) DestY, + Image.Width, + Image.Height, + Image.Width * sizeof (EFI_GRAPHICS_OUTPUT= _BLT_PIXEL) + ); =20 // // Report displayed Logo information. @@ -305,33 +265,18 @@ BootLogoEnableLogo ( return EFI_OUT_OF_RESOURCES; } =20 - if (GraphicsOutput !=3D NULL) { - Status =3D GraphicsOutput->Blt ( - GraphicsOutput, - LogoBlt, - EfiBltVideoToBltBuffer, - LogoDestX, - LogoDestY, - 0, - 0, - LogoWidth, - LogoHeight, - LogoWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXE= L) - ); - } else { - Status =3D UgaDraw->Blt ( - UgaDraw, - (EFI_UGA_PIXEL *) LogoBlt, - EfiUgaVideoToBltBuffer, - LogoDestX, - LogoDestY, - 0, - 0, - LogoWidth, - LogoHeight, - LogoWidth * sizeof (EFI_UGA_PIXEL) - ); - } + Status =3D GraphicsOutput->Blt ( + GraphicsOutput, + LogoBlt, + EfiBltVideoToBltBuffer, + LogoDestX, + LogoDestY, + 0, + 0, + LogoWidth, + LogoHeight, + LogoWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + ); } =20 if (!EFI_ERROR (Status)) { @@ -363,7 +308,7 @@ BootLogoEnableLogo ( Use SystemTable Conout to turn on video based Simple Text Out consoles. = The Simple Text Out screens will now be synced up with all non video output = devices =20 - @retval EFI_SUCCESS UGA devices are back in text mode and synced up. + @retval EFI_SUCCESS GOP devices are back in text mode and synced up. =20 **/ EFI_STATUS @@ -408,11 +353,8 @@ BootLogoUpdateProgress ( { EFI_STATUS Status; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - EFI_UGA_DRAW_PROTOCOL *UgaDraw; UINT32 SizeOfX; UINT32 SizeOfY; - UINT32 ColorDepth; - UINT32 RefreshRate; EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color; UINTN BlockHeight; UINTN BlockWidth; @@ -425,39 +367,13 @@ BootLogoUpdateProgress ( return EFI_INVALID_PARAMETER; } =20 - UgaDraw =3D NULL; Status =3D gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutp= utProtocolGuid, (VOID **) &GraphicsOutput); - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { - GraphicsOutput =3D NULL; - - Status =3D gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawPro= tocolGuid, (VOID **) &UgaDraw); - if (EFI_ERROR (Status)) { - UgaDraw =3D NULL; - } - } if (EFI_ERROR (Status)) { return EFI_UNSUPPORTED; } =20 - SizeOfX =3D 0; - SizeOfY =3D 0; - if (GraphicsOutput !=3D NULL) { - SizeOfX =3D GraphicsOutput->Mode->Info->HorizontalResolution; - SizeOfY =3D GraphicsOutput->Mode->Info->VerticalResolution; - } else if (UgaDraw !=3D NULL) { - Status =3D UgaDraw->GetMode ( - UgaDraw, - &SizeOfX, - &SizeOfY, - &ColorDepth, - &RefreshRate - ); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - } else { - return EFI_UNSUPPORTED; - } + SizeOfX =3D GraphicsOutput->Mode->Info->HorizontalResolution; + SizeOfY =3D GraphicsOutput->Mode->Info->VerticalResolution; =20 BlockWidth =3D SizeOfX / 100; BlockHeight =3D SizeOfY / 50; @@ -473,70 +389,36 @@ BootLogoUpdateProgress ( // SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0); =20 - if (GraphicsOutput !=3D NULL) { - Status =3D 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 =3D 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 =3D GraphicsOutput->Blt ( + GraphicsOutput, + &Color, + EfiBltVideoFill, + 0, + 0, + 0, + PosY - EFI_GLYPH_HEIGHT - 1, + SizeOfX, + SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1), + SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + ); } // // Show progress by drawing blocks // for (Index =3D PreviousValue; Index < BlockNum; Index++) { PosX =3D Index * BlockWidth; - if (GraphicsOutput !=3D NULL) { - Status =3D GraphicsOutput->Blt ( - GraphicsOutput, - &ProgressColor, - EfiBltVideoFill, - 0, - 0, - PosX, - PosY, - BlockWidth - 1, - BlockHeight, - (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_P= IXEL) - ); - } else if (FeaturePcdGet (PcdUgaConsumeSupport)) { - Status =3D 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 =3D GraphicsOutput->Blt ( + GraphicsOutput, + &ProgressColor, + EfiBltVideoFill, + 0, + 0, + PosX, + PosY, + BlockWidth - 1, + BlockHeight, + (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIX= EL) + ); } =20 PrintXY ( diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf b/MdeModulePk= g/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] =20 [Protocols] gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES - gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES gEfiBootLogoProtocolGuid ## SOMETIMES_CONSUMES gEdkiiBootLogo2ProtocolGuid ## SOMETIMES_CONSUMES gEfiUserManagerProtocolGuid ## CONSUMES gEdkiiPlatformLogoProtocolGuid ## CONSUMES - -[FeaturePcd] - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES --=20 2.25.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#58850): https://edk2.groups.io/g/devel/message/58850 Mute This Topic: https://groups.io/mt/74068782/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-