From nobody Sun May 5 04:03:30 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+97479+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+97479+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1671138712; cv=none; d=zohomail.com; s=zohoarc; b=blFD6BsXm6yBA1WYmBs1al/9CT8mP98fOz3W8RohgRT8atDAP1jPC5UaqVFJvXVQqcAbiCBD9AZRD/Z9Z5DP3f+GEbZzAI99psqnvHXnlyLq0QoAU5KpLh5NxmypNaXTHZ/tfZq4letddvQvDRmnTUM2kxKmSs3xtPa0iS8JYhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671138712; 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=STKJIsrb8vCfklxN+Yfd8oUGEoP2LwqhrB1/NnoTuds=; b=ELTN7DfrXgKdJRskHW8k/C+XEM/24Quv3mtw/N1lHFd1hVToad6+TYAC2Yfzj5ZaYQviMSQ4Lt4FgvGrv+XaJBIZ4A4z0ha04FV5lV5c7en1NzAuVxFz9B2UW07RwQBhZwezATCzXnc4wBW7KEl6hfrxdrWVciRrSeOk9CtqsfY= 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+97479+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 167113871235358.291049977980265; Thu, 15 Dec 2022 13:11:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ibFxYY1788612xpnoSLirken; Thu, 15 Dec 2022 13:11:51 -0800 X-Received: from smarthost01b.sbp.mail.zen.net.uk (smarthost01b.sbp.mail.zen.net.uk [212.23.1.3]) by mx.groups.io with SMTP id smtpd.web11.146484.1671138709708500887 for ; Thu, 15 Dec 2022 13:11:50 -0800 X-Received: from [217.155.46.38] (helo=starbook..) by smarthost01b.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p5vW3-0000SI-Hq; Thu, 15 Dec 2022 21:11:43 +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: Thu, 15 Dec 2022 21:11:40 +0000 Message-Id: <743801c30caf65019b4b4097c0ad1c03ba053238.1671138700.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01b-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 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: 97HWJxSmaSQD3Kuq3zuYpqebx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1671138711; bh=tJOXM7R9Kk0dRfn3gAXfghsEwAIKEL4ZdrZO/3w67sI=; h=Cc:Date:From:Reply-To:Subject:To; b=R9SeIhWYKvl8GE6XbDAvpa9YkSZFHAblJRI8m801ZoSsVrobcqLakdvJ3Qm59nfYLhy 5jZ3R9YWoQldI7gUbhI9pg+PaugncR9krqrgzWhqeUSEnHCsW+CBTqOWT+3jn55ANh7VS qVlT7R30aEZ2oLR0Eg9yQLXtwMd4mchzf+4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1671138713846100002 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..48862d3207 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 (FixedPcdGetBool (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 (#97479): https://edk2.groups.io/g/devel/message/97479 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-