From nobody Thu May 2 13:28:17 2024 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+97494+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+97494+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1671180998; cv=none; d=zohomail.com; s=zohoarc; b=eNVzLcZVuvY0/e9XGXVoRQGDbJrL/XCcCMT5wEq8V119iR8Fay1iD4xmV76Y+idHudm+sNfRe6RL7q4LA8LvRfNR0z80qGQL/QtSXgJJXoTm8nHYYBDO+w2W7YqgNy4weD2s+MdlyETIkVBxAJ0/MAvRTh3zHG8KrPSEkZ3AMmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671180998; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=NGGXwZROIMdfUuh7kZovMbAU8bFITj5+trilUoEBsts=; b=SisfNLUt3C5GsIQvgD5WskYH7SdxcNAYsDjx9aOrE4BuX0zJJ5kD5GU8LS+5SsViWbOY4ebP4BWa7ONHktTTVI92JMxGzlEciTsphzpCkQsSkhKsJDW5MNkqUWGXc6CAK2wPn6qkMVvqT30+cvQthqF4PFWn1FLje6KtBuZusp4= 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+97494+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1671180997949424.10838248473317; Fri, 16 Dec 2022 00:56:37 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id paimYY1788612x3ehc4IMZ8j; Fri, 16 Dec 2022 00:56:37 -0800 X-Received: from smarthost01a.ixn.mail.zen.net.uk (smarthost01a.ixn.mail.zen.net.uk [212.23.1.20]) by mx.groups.io with SMTP id smtpd.web10.8689.1671180995443287744 for ; Fri, 16 Dec 2022 00:56:36 -0800 X-Received: from [51.148.147.4] (helo=starbook..) by smarthost01a.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p66W5-0004gn-Qc; Fri, 16 Dec 2022 08:56:29 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Sean Rhodes , Zhichao Gao , Ray Ni , Jian J Wang , Liming Gao Subject: [edk2-devel] [PATCH] MdeModulePkg/Logo: Add a PCD to control the position of the Logo Date: Fri, 16 Dec 2022 08:56:28 +0000 Message-Id: <7c6fbeb2fda06a9af82d61965c4294194b4f12b3.1671180987.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01a-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 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,sean@starlabs.systems X-Gm-Message-State: x183xuq3WZzEfE0z7o6f7afpx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1671180997; bh=BJmNl1Bri+pLCsgSASmf1PM3J/y56l1woNSIijEZnEk=; h=Cc:Date:From:Reply-To:Subject:To; b=whtnI9Y6Fn5GRUvAnlu30IAoKLJDfAqoLDUe56BxNDpKZNQ+iA9u9kxf0qTWHhipMcw GKmJ+kTKUYditPCI4jKD4p+262v9zvrsjrOHd1IFiP7ybddtMrZKuSVZWV8+yzraaI99R gN5IkLf9Yu1rdUDbsqDXxD/jkBgxioU2gNw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1671180999574100002 Content-Type: text/plain; charset="utf-8" When set to true, the Logo is positioned according to the BGRT specification, 38.2% from the top of the screen. When set to false, no behaviour is changed and the logo is positioned centrally. Cc: Zhichao Gao Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Signed-off-by: Sean Rhodes --- MdeModulePkg/Logo/Logo.c | 28 +++++++++++++++++++++++++++- MdeModulePkg/Logo/LogoDxe.inf | 4 ++++ MdeModulePkg/MdeModulePkg.dec | 6 ++++++ MdeModulePkg/MdeModulePkg.uni | 6 ++++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c index 8ab874d2da..96e34b2011 100644 --- a/MdeModulePkg/Logo/Logo.c +++ b/MdeModulePkg/Logo/Logo.c @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include =20 typedef struct { EFI_IMAGE_ID ImageId; @@ -51,12 +52,14 @@ GetImage ( IN EDKII_PLATFORM_LOGO_PROTOCOL *This, IN OUT UINT32 *Instance, OUT EFI_IMAGE_INPUT *Image, + EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput, OUT EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE *Attribute, OUT INTN *OffsetX, OUT INTN *OffsetY ) { - UINT32 Current; + UINT32 Current; + EFI_STATUS Status; =20 if ((Instance =3D=3D NULL) || (Image =3D=3D NULL) || (Attribute =3D=3D NULL) || (OffsetX =3D=3D NULL) || (OffsetY =3D=3D = NULL)) @@ -69,6 +72,29 @@ GetImage ( return EFI_NOT_FOUND; } =20 + if (PcdGetBool (PcdFollowMicrosoftRecommended)) { + // + // Get current video resolution and text mode + // + Status =3D gBS->HandleProtocol ( + gST->ConsoleOutHandle, + &gEfiGraphicsOutputProtocolGuid, + (VOID **)&GraphicsOutput + ); + if (!EFI_ERROR (Status)) { + // + // Center of LOGO is in the vertical position 38.2% when PcdBootLogo= OnlyEnable is TRUE + // Y =3D (VerticalResolution - LogoHeight) / 2 + // Y' =3D VerticalResolution * 0.382 - LogoHeight * 0.5 + // OffsetY + Y =3D Y' + // OffsetY =3D Y' - Y =3D -0.118 * VerticalResolution + // + *Attribute =3D EdkiiPlatformLogoDisplayAttributeCenter; + *OffsetX =3D 0; + *OffsetY =3D -118 * (INTN)GraphicsOutput->Mode->Info->VerticalReso= lution / 1000; + } + } + (*Instance)++; *Attribute =3D mLogos[Current].Attribute; *OffsetX =3D mLogos[Current].OffsetX; diff --git a/MdeModulePkg/Logo/LogoDxe.inf b/MdeModulePkg/Logo/LogoDxe.inf index 41215d25d8..ce29950089 100644 --- a/MdeModulePkg/Logo/LogoDxe.inf +++ b/MdeModulePkg/Logo/LogoDxe.inf @@ -41,6 +41,7 @@ UefiBootServicesTableLib UefiDriverEntryPoint DebugLib + PcdLib =20 [Protocols] gEfiHiiDatabaseProtocolGuid ## CONSUMES @@ -48,6 +49,9 @@ gEfiHiiPackageListProtocolGuid ## PRODUCES CONSUMES gEdkiiPlatformLogoProtocolGuid ## PRODUCES =20 +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended ## CONSUMES + [Depex] gEfiHiiDatabaseProtocolGuid AND gEfiHiiImageExProtocolGuid diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index be5e829ca9..c8bb51df3b 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -2102,6 +2102,12 @@ # @Prompt The shared bit mask when Intel Tdx is enabled. gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10000025 =20 + ## This PCD sets the position of the Boot Logo. + # TRUE - The Logo is positioned following the recommendations from Mi= crosoft. + # FALSE - The logo is positioned in the center of the screen. + # @ Prompt This position of the boot logo + gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|FALSE|BOOLE= AN|0x10000026 + [PcdsPatchableInModule] ## Specify memory size with page number for PEI code when # Loading Module at Fixed Address feature is enabled. diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index 33ce9f6198..09c1ac1cc1 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -1338,3 +1338,9 @@ #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPcieResizableBarSupport_HELP= #language en-US "Indicates if the PCIe Resizable BAR Capability Supported.=

\n" = "TRUE - PCIe Resizable BAR Capability is supported.
\= n" = "FALSE - PCIe Resizable BAR Capability is not supported.<= BR>" + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommended_P= ROMPT #language en-US "The position of the Boot Logo" + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommend_HEL= P #language en-US "Sets the position of the Logo. When set to true, the L= ogo is positioned following the recommendations" + = " from Microsoft, 38.2% from the top of the screen." + --=20 2.37.2 -=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 (#97494): https://edk2.groups.io/g/devel/message/97494 Mute This Topic: https://groups.io/mt/95697776/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-