From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) by mx.groups.io with SMTP id smtpd.web12.4090.1665391872796174835 for ; Mon, 10 Oct 2022 01:51:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@starlabs-systems.20210112.gappssmtp.com header.s=20210112 header.b=O+nJ8LjN; spf=pass (domain: starlabs.systems, ip: 209.85.160.42, mailfrom: sean@starlabs.systems) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-1321a1e94b3so11798294fac.1 for ; Mon, 10 Oct 2022 01:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starlabs-systems.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OimMWIF69BdchMasccxrj+IJj7VWyV+tHmewG7cMDqw=; b=O+nJ8LjNmACuEgPQhNKBRmTBUCglCE1p/6GkfQ/2ErEkcn8W5N8o3dwUT+fu60Wq9A rXv597/uOAYO0y3MB1V7yhFJcFL7eB3kqbZyx4gKDCrUXf233lltW48du8V0YK8tZaIz /jxlB+oUwSIkS0YcLGdMpwJuhQyvLh6vZPpjwY/UrguZqoOvSw8f9k2CjZpmHRCrDJk5 f7Q/DXHN5sm7yAS5FTwZEM2YjK40SBujfWTDnCa0jZh9G0mV0PO5sP5gc57LKEtk+ha5 xj/1ghpCp0eFj9QF1WNLFeZ6UqsoGDkULmoGT0mWD+Bni4HlolGQz1kBegAcbbxIY7Ra IB4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OimMWIF69BdchMasccxrj+IJj7VWyV+tHmewG7cMDqw=; b=UIxOjskBnKrijph2A2+30m2bI9iGzrxOHE2WFKncmC1QmiFWvhVT4YoWVRal3VrMnX dIxLQG1dv7x/Z2u1i1xBedygF2uLb4TwZ+pC8PgUK5/SBVLTj/s+8BWDiQdWA1lKziTA wHyfp/0mY6YFCCZRFUjM/E9evon0+RjWV6wKiTafiiPmHQstRc920rSNBf9F8bGrCDwj wPdKGWddQiROr1xUWyefYvlZI/LZl6XlNhIH6d/B55TQpqIKUeBwdHlDw7DeOdx8Sezs qPG+SxLRysHM1Q2XXGFY6upzCh44D1jT+j/g1evS4ctpnphz7Z+LjhBxxFtOhQSaMAgy h83w== X-Gm-Message-State: ACrzQf09RJ6hmKCzf6QNY3ZkMIObakM0V35+2G/GRSFUD9lN1QS5RRyC hSwIkwXdRf90JXBubycYJOXLct87zSryM6FTzwJm X-Google-Smtp-Source: AMsMyM4SSKNfAAORa1NS6hLnvTfHIUdbhi10XuQNo+KxSIfLUPw3mqYuuNfr5HHz8MbRw6mDkbsr1qBGm6RM78zf1wU= X-Received: by 2002:a05:6870:c59b:b0:131:8d2e:e808 with SMTP id ba27-20020a056870c59b00b001318d2ee808mr14362649oab.280.1665391871416; Mon, 10 Oct 2022 01:51:11 -0700 (PDT) MIME-Version: 1.0 References: <9c3d2f03a7f021c5044301f7b4d869b70e8990e0.1664179796.git.sean@starlabs.systems> <18575f8eca30cec6eb2fab56b878196925f0dd90.1664179796.git.sean@starlabs.systems> In-Reply-To: From: "Sean Rhodes" Date: Mon, 10 Oct 2022 09:51:00 +0100 Message-ID: Subject: Re: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo To: "Ni, Ray" Cc: "devel@edk2.groups.io" , "Gao, Zhichao" , "Wang, Jian J" , "Gao, Liming" Content-Type: multipart/alternative; boundary="000000000000e8780705eaaa42ce" --000000000000e8780705eaaa42ce Content-Type: text/plain; charset="UTF-8" Hi Ray Thank you, it does, and I think it will work for most splash images. However, the way it's written in my patch accounts for the Image size. This will handle splash images that are equal to, or larger than the resolution of the display. Thanks Sean On Sat, 8 Oct 2022 at 03:02, Ni, Ray wrote: > Sean, > I remember that I evaluated the BGRT requirement when designing the > PlatformLogo protocol. > > So, I went back to got the code I wrote long time ago as below. > I didn't try to understand them now. Does it make sense to you? > > Status = gBS->HandleProtocol (gST->ConsoleOutHandle, > &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput); > if (!EFI_ERROR (Status)) { > // > // Center of LOGO is in the vertical position 38.2% when > PcdBootLogoOnlyEnable is TRUE > // Y = (VerticalResolution - LogoHeight) / 2 > // Y' = VerticalResolution * 0.382 - LogoHeight * 0.5 > // OffsetY + Y = Y' > // OffsetY = Y' - Y = -0.118 * VerticalResolution > // > *Attribute = EdkiiPlatformLogoDisplayAttributeCenter; > *OffsetX = 0; > *OffsetY = -118 * (INTN) > GraphicsOutput->Mode->Info->VerticalResolution / 1000; > } > > Thanks, > Ray > > > -----Original Message----- > > From: Sean Rhodes > > Sent: Monday, September 26, 2022 4:10 PM > > To: devel@edk2.groups.io > > Cc: Rhodes, Sean ; Gao, Zhichao > > ; Ni, Ray ; Wang, Jian J > > ; Gao, Liming > > Subject: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the > > position of the Logo > > > > 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 | 5 +++++ > > MdeModulePkg/Logo/LogoDxe.inf | 4 ++++ > > MdeModulePkg/MdeModulePkg.dec | 6 ++++++ > > MdeModulePkg/MdeModulePkg.uni | 6 ++++++ > > 4 files changed, 21 insertions(+) > > > > diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c > > index 8ab874d2da..1638d0f984 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 > > > > > > > > typedef struct { > > > > EFI_IMAGE_ID ImageId; > > > > @@ -69,6 +70,10 @@ GetImage ( > > return EFI_NOT_FOUND; > > > > } > > > > > > > > + if (FixedPcdGetBool (PcdFollowMicrosoftRecommended)) { > > > > + mLogos[Current].Attribute = > > EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended; > > > > + } > > > > + > > > > (*Instance)++; > > > > *Attribute = mLogos[Current].Attribute; > > > > *OffsetX = 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 > > > > > > > > [Protocols] > > > > gEfiHiiDatabaseProtocolGuid ## CONSUMES > > > > @@ -48,6 +49,9 @@ > > gEfiHiiPackageListProtocolGuid ## PRODUCES CONSUMES > > > > gEdkiiPlatformLogoProtocolGuid ## PRODUCES > > > > > > > > +[Pcd] > > > > + gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended > > ## CONSUMES > > > > + > > > > [Depex] > > > > gEfiHiiDatabaseProtocolGuid AND > > > > gEfiHiiImageExProtocolGuid > > > > diff --git a/MdeModulePkg/MdeModulePkg.dec > > b/MdeModulePkg/MdeModulePkg.dec > > index 58e6ab0048..ac437990f1 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|0x > > 10000025 > > > > > > > > + ## This PCD sets the position of the Boot Logo. > > > > + # TRUE - The Logo is positioned following the recommendations from > > Microsoft. > > > > + # FALSE - The logo is positioned in the center of the screen. > > > > + # @ Prompt This position of the boot logo > > > > + > > gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|FA > > LSE|BOOLEAN|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_HEL > > P #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.
" > > > > + > > > > +#string > > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommende > > d_PROMPT #language en-US "The position of the Boot Logo" > > > > + > > > > +#string > > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommend_ > > HELP #language en-US "Sets the position of the Logo. When set to true, > the > > Logo is positioned following the recommendations" > > > > + > " from Microsoft, 38.2% from > > the top of the screen." > > > > + > > > > -- > > 2.34.1 > > --000000000000e8780705eaaa42ce Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ray

Thank you, it does, and I think it= will work for most splash images. However, the way it's written in my = patch accounts for the Image size. This will handle splash images that are = equal to, or larger than the resolution of the display.=C2=A0


Sean

On Sat, 8 Oct 2022 at 03:02, Ni, Ray <= ray.ni@intel.com> wrote:
Sean,
I remember that I evaluated the BGRT requirement when designing the Platfor= mLogo protocol.

So, I went back to got the code I wrote long time ago as below.
I didn't try to understand them now. Does it make sense to you?

=C2=A0 =C2=A0 Status =3D gBS->HandleProtocol (gST->ConsoleOutHandle, = &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput);
=C2=A0 =C2=A0 if (!EFI_ERROR (Status)) {
=C2=A0 =C2=A0 =C2=A0 //
=C2=A0 =C2=A0 =C2=A0 // Center of LOGO is in the vertical position 38.2% wh= en PcdBootLogoOnlyEnable is TRUE
=C2=A0 =C2=A0 =C2=A0 // Y =3D (VerticalResolution - LogoHeight) / 2
=C2=A0 =C2=A0 =C2=A0 // Y' =3D VerticalResolution * 0.382 - LogoHeight = * 0.5
=C2=A0 =C2=A0 =C2=A0 // OffsetY + Y =3D Y'
=C2=A0 =C2=A0 =C2=A0 // OffsetY =3D Y' - Y =3D -0.118 * VerticalResolut= ion
=C2=A0 =C2=A0 =C2=A0 //
=C2=A0 =C2=A0 =C2=A0 *Attribute =3D EdkiiPlatformLogoDisplayAttributeCenter= ;
=C2=A0 =C2=A0 =C2=A0 *OffsetX=C2=A0 =C2=A0=3D 0;
=C2=A0 =C2=A0 =C2=A0 *OffsetY=C2=A0 =C2=A0=3D -118 * (INTN) GraphicsOutput-= >Mode->Info->VerticalResolution / 1000;
=C2=A0 =C2=A0 }

Thanks,
Ray

> -----Original Message-----
> From: Sean Rhodes <sean@starlabs.systems>
> Sent: Monday, September 26, 2022 4:10 PM
> To: devel@ed= k2.groups.io
> Cc: Rhodes, Sean <sean@starlabs.systems>; Gao, Zhichao
> <zhichao= .gao@intel.com>; Ni, Ray <ray.ni@intel.com>; Wang, Jian J
> <jian.j.= wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
> Subject: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the
> position of the Logo
>
> 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 <zhichao.gao@intel.com>
> Cc: Ray Ni <r= ay.ni@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
>=C2=A0 MdeModulePkg/Logo/Logo.c=C2=A0 =C2=A0 =C2=A0 | 5 +++++
>=C2=A0 MdeModulePkg/Logo/LogoDxe.inf | 4 ++++
>=C2=A0 MdeModulePkg/MdeModulePkg.dec | 6 ++++++
>=C2=A0 MdeModulePkg/MdeModulePkg.uni | 6 ++++++
>=C2=A0 4 files changed, 21 insertions(+)
>
> diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c
> index 8ab874d2da..1638d0f984 100644
> --- a/MdeModulePkg/Logo/Logo.c
> +++ b/MdeModulePkg/Logo/Logo.c
> @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>=C2=A0 #include <Protocol/HiiPackageList.h>
>
>=C2=A0 #include <Library/UefiBootServicesTableLib.h>
>
>=C2=A0 #include <Library/DebugLib.h>
>
> +#include <Library/PcdLib.h>
>
>
>
>=C2=A0 typedef struct {
>
>=C2=A0 =C2=A0 EFI_IMAGE_ID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageId;
>
> @@ -69,6 +70,10 @@ GetImage (
>=C2=A0 =C2=A0 =C2=A0 return EFI_NOT_FOUND;
>
>=C2=A0 =C2=A0 }
>
>
>
> +=C2=A0 if (FixedPcdGetBool (PcdFollowMicrosoftRecommended)) {
>
> +=C2=A0 =C2=A0 mLogos[Current].Attribute =3D
> EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended;
>
> +=C2=A0 }
>
> +
>
>=C2=A0 =C2=A0 (*Instance)++;
>
>=C2=A0 =C2=A0 *Attribute =3D mLogos[Current].Attribute;
>
>=C2=A0 =C2=A0 *OffsetX=C2=A0 =C2=A0=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 @@
>=C2=A0 =C2=A0 UefiBootServicesTableLib
>
>=C2=A0 =C2=A0 UefiDriverEntryPoint
>
>=C2=A0 =C2=A0 DebugLib
>
> +=C2=A0 PcdLib
>
>
>
>=C2=A0 [Protocols]
>
>=C2=A0 =C2=A0 gEfiHiiDatabaseProtocolGuid=C2=A0 =C2=A0 =C2=A0 =C2=A0 ##= CONSUMES
>
> @@ -48,6 +49,9 @@
>=C2=A0 =C2=A0 gEfiHiiPackageListProtocolGuid=C2=A0 =C2=A0 =C2=A0## PROD= UCES CONSUMES
>
>=C2=A0 =C2=A0 gEdkiiPlatformLogoProtocolGuid=C2=A0 =C2=A0 =C2=A0## PROD= UCES
>
>
>
> +[Pcd]
>
> +=C2=A0 gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended > ## CONSUMES
>
> +
>
>=C2=A0 [Depex]
>
>=C2=A0 =C2=A0 gEfiHiiDatabaseProtocolGuid AND
>
>=C2=A0 =C2=A0 gEfiHiiImageExProtocolGuid
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 58e6ab0048..ac437990f1 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -2102,6 +2102,12 @@
>=C2=A0 =C2=A0 # @Prompt The shared bit mask when Intel Tdx is enabled.<= br> >
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x
> 10000025
>
>
>
> +=C2=A0 ## This PCD sets the position of the Boot Logo.
>
> +=C2=A0 #=C2=A0 =C2=A0TRUE=C2=A0 - The Logo is positioned following th= e recommendations from
> Microsoft.
>
> +=C2=A0 #=C2=A0 =C2=A0FALSE - The logo is positioned in the center of = the screen.
>
> +=C2=A0 # @ Prompt This position of the boot logo
>
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|FA
> LSE|BOOLEAN|0x10000026
>
> +
>
>=C2=A0 [PcdsPatchableInModule]
>
>=C2=A0 =C2=A0 ## Specify memory size with page number for PEI code when=
>
>=C2=A0 =C2=A0 #=C2=A0 Loading Module at Fixed Address feature is enable= d.
>
> 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 @@
>=C2=A0 #string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPcieResizableBarSupport_HEL
> P #language en-US "Indicates if the PCIe Resizable BAR Capability=
> Supported.<BR><BR>\n"
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "TRUE=C2=A0 - PCIe Resizable BA= R
> Capability is supported.<BR>\n"
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "FALSE - PCIe Resizable BAR
> Capability is not supported.<BR>"
>
> +
>
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommende
> d_PROMPT #language en-US "The position of the Boot Logo"
>
> +
>
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommend_
> HELP=C2=A0 =C2=A0#language en-US "Sets the position of the Logo. = When set to true, the
> Logo is positioned following the recommendations"
>
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0" from Microsoft, 38.2% from
> the top of the screen."
>
> +
>
> --
> 2.34.1

--000000000000e8780705eaaa42ce--