From nobody Mon Feb 9 15:10:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91392+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91392+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1657849905; cv=none; d=zohomail.com; s=zohoarc; b=HCN4cQhrPjBPevLUoLf07fU+xMHfPl8oV8ptbeRR9SNREuzXLIArg+26+ZzeTqo3jooe5q7tX1dtxtyP0B6vxK7YZ+qb941hv9Da4rE+XDlMrhheRovvJZ/aoV3tuGfU06lzxJVVVOGFN8soX3xYvzM6cvVbMfWKYhgjqMcD1e4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657849905; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=/aR92VL6g9sgumKkeTeZKkl7bI8eVjV12XhvQsqXgYc=; b=QdTc+7JAYbdOURuAv7L7rnE9a9KyWfHH0on8UmAXNkZSK895LDTnyg9mAA6HS2962DBZj9x9BWhH2qRWhvTVLijthot0Gr9myQNLBunTtvm5rS/SGBl5xWFOAq18S3kgB/fJj9yddvghHkZcFC91ZHyDPLj8lR4pNAvvNMF0ZKw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+91392+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1657849905249656.9392629129054; Thu, 14 Jul 2022 18:51:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id R7zhYY1788612xlcmt8DEDTa; Thu, 14 Jul 2022 18:51:44 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.1859.1657849899870939809 for ; Thu, 14 Jul 2022 18:51:44 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10408"; a="349642202" X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="349642202" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 18:51:43 -0700 X-IronPort-AV: E=Sophos;i="5.92,272,1650956400"; d="scan'208";a="923318695" X-Received: from guominji-mobl1.ccr.corp.intel.com ([10.238.11.184]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2022 18:51:42 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [Patch v2 11/11] MdePkg/UefiLib: Remove all UGA support Date: Fri, 15 Jul 2022 09:51:06 +0800 Message-Id: <20220715015106.1553-12-guomin.jiang@intel.com> In-Reply-To: <20220715015106.1553-1-guomin.jiang@intel.com> References: <20220715015106.1553-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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: WZjantSn17Uhxb8Bb8JudD0Bx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657849904; bh=dFf0K3JengiS2sXcVVamelVMWTnjJ7cuDUl3zD/Y9PY=; h=Cc:Date:From:Reply-To:Subject:To; b=D1LYFVIbiLfsu2FeyYJ0AKMf/BcCUIcIWUgklG7JJWJrnaWhZ/XnsGO+vE87+4Soa8o zpe+c5uh7OvakBGKuwIynGmHX3CoAZ+5RBVoWJwbl5el0cCNQaqSAn8vU3bb8OfZdT56P 4a60usJ6H8bTG0/Dl9FVuLV47G8r5I6TjEk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657849905873100014 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2368 Remove all UGA code in MdePkg except the definition The reason why keep definition is because downstream need it to pass build. It will be removed when all downstream remove UGA support Signed-off-by: Guomin Jiang Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Reviewed-by: Michael D Kinney --- MdePkg/Library/UefiLib/UefiLib.inf | 4 +- MdePkg/Library/UefiLib/UefiLibInternal.h | 3 +- MdePkg/Library/UefiLib/UefiLibPrint.c | 91 +----------------------- MdePkg/MdePkg.dsc | 3 - 4 files changed, 3 insertions(+), 98 deletions(-) diff --git a/MdePkg/Library/UefiLib/UefiLib.inf b/MdePkg/Library/UefiLib/Ue= fiLib.inf index 01ed92092da2..ac9d68907261 100644 --- a/MdePkg/Library/UefiLib/UefiLib.inf +++ b/MdePkg/Library/UefiLib/UefiLib.inf @@ -7,7 +7,7 @@ # EFI Driver Model related protocols, manage Unicode string tables for UE= FI Drivers, # and print messages on the console output and standard error devices. # -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -67,7 +67,6 @@ gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES gEfiHiiFontProtocolGuid ## SOMETIMES_CONSUMES gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES - gEfiUgaDrawProtocolGuid | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport = ## SOMETIMES_CONSUMES # Consumes if gEfiGraphicsOutputProto= colGuid uninstalled gEfiComponentNameProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdCompone= ntNameDisable ## SOMETIMES_PRODUCES # User chooses to produce it gEfiComponentName2ProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdCompone= ntName2Disable ## SOMETIMES_PRODUCES # User chooses to produce it gEfiDriverConfigurationProtocolGuid ## SOMETI= MES_PRODUCES # User chooses to produce it @@ -84,5 +83,4 @@ gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable ## CONSUMES - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES =20 diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/Uefi= Lib/UefiLibInternal.h index 4365282cf213..be5c9ddcdde8 100644 --- a/MdePkg/Library/UefiLib/UefiLibInternal.h +++ b/MdePkg/Library/UefiLib/UefiLibInternal.h @@ -1,7 +1,7 @@ /** @file Internal include file for UefiLib. =20 - Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -18,7 +18,6 @@ #include #include #include -#include #include =20 #include diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib= /UefiLibPrint.c index 39edeb7283dd..2451775aeb90 100644 --- a/MdePkg/Library/UefiLib/UefiLibPrint.c +++ b/MdePkg/Library/UefiLib/UefiLibPrint.c @@ -2,7 +2,7 @@ Mde UEFI library API implementation. Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE =20 - Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -344,20 +344,14 @@ InternalPrintGraphic ( EFI_STATUS Status; UINT32 HorizontalResolution; UINT32 VerticalResolution; - UINT32 ColorDepth; - UINT32 RefreshRate; EFI_HII_FONT_PROTOCOL *HiiFont; EFI_IMAGE_OUTPUT *Blt; EFI_FONT_DISPLAY_INFO FontInfo; EFI_HII_ROW_INFO *RowInfoArray; UINTN RowInfoArraySize; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - EFI_UGA_DRAW_PROTOCOL *UgaDraw; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto; EFI_HANDLE ConsoleHandle; - UINTN Width; - UINTN Height; - UINTN Delta; =20 HorizontalResolution =3D 0; VerticalResolution =3D 0; @@ -374,20 +368,6 @@ InternalPrintGraphic ( (VOID **)&GraphicsOutput ); =20 - UgaDraw =3D NULL; - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { - // - // If no GOP available, try to open UGA Draw protocol if supported. - // - GraphicsOutput =3D NULL; - - Status =3D gBS->HandleProtocol ( - ConsoleHandle, - &gEfiUgaDrawProtocolGuid, - (VOID **)&UgaDraw - ); - } - if (EFI_ERROR (Status)) { goto Error; } @@ -405,8 +385,6 @@ InternalPrintGraphic ( if (GraphicsOutput !=3D NULL) { HorizontalResolution =3D GraphicsOutput->Mode->Info->HorizontalResolut= ion; VerticalResolution =3D GraphicsOutput->Mode->Info->VerticalResolutio= n; - } else if ((UgaDraw !=3D NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) { - UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution,= &ColorDepth, &RefreshRate); } else { goto Error; } @@ -466,73 +444,6 @@ InternalPrintGraphic ( if (EFI_ERROR (Status)) { goto Error; } - } else if (FeaturePcdGet (PcdUgaConsumeSupport)) { - ASSERT (UgaDraw !=3D NULL); - - // - // Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) does= n't overflow. - // - if (Blt->Width > DivU64x32 (MAX_UINTN, Blt->Height * sizeof (EFI_GRAPH= ICS_OUTPUT_BLT_PIXEL))) { - goto Error; - } - - Blt->Image.Bitmap =3D AllocateZeroPool ((UINT32)Blt->Width * Blt->Heig= ht * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); - ASSERT (Blt->Image.Bitmap !=3D NULL); - - // - // StringToImage only support blt'ing image to device using GOP proto= col. If GOP is not supported in this platform, - // we ask StringToImage to print the string to blt buffer, then blt t= o device using UgaDraw. - // - Status =3D HiiFont->StringToImage ( - HiiFont, - EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_OUT_FLAG_CLIP= | - EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_C= LIP_CLEAN_Y | - EFI_HII_IGNORE_LINE_BREAK, - Buffer, - &FontInfo, - &Blt, - PointX, - PointY, - &RowInfoArray, - &RowInfoArraySize, - NULL - ); - - if (!EFI_ERROR (Status)) { - ASSERT (RowInfoArray !=3D NULL); - // - // Explicit Line break characters are ignored, so the updated parame= ter RowInfoArraySize by StringToImage will - // always be 1 or 0 (if there is no valid Unicode Char can be printe= d). ASSERT here to make sure. - // - ASSERT (RowInfoArraySize <=3D 1); - - if (RowInfoArraySize !=3D 0) { - Width =3D RowInfoArray[0].LineWidth; - Height =3D RowInfoArray[0].LineHeight; - Delta =3D Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL); - } else { - Width =3D 0; - Height =3D 0; - Delta =3D 0; - } - - Status =3D UgaDraw->Blt ( - UgaDraw, - (EFI_UGA_PIXEL *)Blt->Image.Bitmap, - EfiUgaBltBufferToVideo, - PointX, - PointY, - PointX, - PointY, - Width, - Height, - Delta - ); - } else { - goto Error; - } - - FreePool (Blt->Image.Bitmap); } else { goto Error; } diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 3d8874e64782..e67d4716df21 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -23,9 +23,6 @@ =20 !include MdePkg/MdeLibs.dsc.inc =20 -[PcdsFeatureFlag] - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE - [PcdsFixedAtBuild] gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000 --=20 2.26.2.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 (#91392): https://edk2.groups.io/g/devel/message/91392 Mute This Topic: https://groups.io/mt/92393226/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-