From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=jla9+LMY; spf=pass (domain: intel.com, ip: 134.134.136.100, 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=1657849904; x=1689385904; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RIi+tmh7qyQ48UkJxtOITtJyM1gXHB+iTpu4MRWqXZc=; b=jla9+LMYXSASvgJiLIU8GAZuq5uXwLldggHmeG50dd+R04cJBrkmMwR9 R2NBvFUvTuNFzjqwNUY2WtJF/KCoBCftxFvYoY/XTdKOSvR6BPqXyuz3p 4SueqH30IjuYG/sF+QMumSq8Aty0/IFeN0W53mF1O1TUl0+R/xCeSKQDy Nnl5zW99cuFkltEweLxEOTQkpdd7DKfbSOoLlhm1P6H8AfgKDBnEhB3T8 t+t8EBYTO7BjpSv0yqlXjEcNtDkHanLK0EVHS8ZFkTB1f+77tA/6XxFiN alalFkiWRxk8AJvNOOMxi2CtV8f1kh3f5+nHHqr/LnH4/p+sVtxWYHpaG A==; 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" 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" 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: [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> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20220715015106.1553-1-guomin.jiang@intel.com> References: <20220715015106.1553-1-guomin.jiang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368 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 --- 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/UefiLib.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 UEFI 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 gEfiGraphicsOutputProtocolGuid uninstalled gEfiComponentNameProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable ## SOMETIMES_PRODUCES # User chooses to produce it gEfiComponentName2ProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable ## SOMETIMES_PRODUCES # User chooses to produce it gEfiDriverConfigurationProtocolGuid ## SOMETIMES_PRODUCES # User chooses to produce it @@ -84,5 +83,4 @@ gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable ## CONSUMES - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/UefiLib/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. - 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 **/ @@ -18,7 +18,6 @@ #include #include #include -#include #include #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 - 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 **/ @@ -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; HorizontalResolution = 0; VerticalResolution = 0; @@ -374,20 +368,6 @@ InternalPrintGraphic ( (VOID **)&GraphicsOutput ); - UgaDraw = NULL; - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { - // - // If no GOP available, try to open UGA Draw protocol if supported. - // - GraphicsOutput = NULL; - - Status = gBS->HandleProtocol ( - ConsoleHandle, - &gEfiUgaDrawProtocolGuid, - (VOID **)&UgaDraw - ); - } - if (EFI_ERROR (Status)) { goto Error; } @@ -405,8 +385,6 @@ InternalPrintGraphic ( if (GraphicsOutput != NULL) { HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution; VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution; - } else if ((UgaDraw != 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 != NULL); - - // - // Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow. - // - if (Blt->Width > DivU64x32 (MAX_UINTN, Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL))) { - goto Error; - } - - Blt->Image.Bitmap = AllocateZeroPool ((UINT32)Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); - ASSERT (Blt->Image.Bitmap != NULL); - - // - // StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform, - // we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw. - // - Status = 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_CLIP_CLEAN_Y | - EFI_HII_IGNORE_LINE_BREAK, - Buffer, - &FontInfo, - &Blt, - PointX, - PointY, - &RowInfoArray, - &RowInfoArraySize, - NULL - ); - - if (!EFI_ERROR (Status)) { - ASSERT (RowInfoArray != NULL); - // - // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will - // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure. - // - ASSERT (RowInfoArraySize <= 1); - - if (RowInfoArraySize != 0) { - Width = RowInfoArray[0].LineWidth; - Height = RowInfoArray[0].LineHeight; - Delta = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL); - } else { - Width = 0; - Height = 0; - Delta = 0; - } - - Status = 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 @@ !include MdePkg/MdeLibs.dsc.inc -[PcdsFeatureFlag] - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE - [PcdsFixedAtBuild] gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000 -- 2.26.2.windows.1