[PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo


Sean Rhodes
 

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@...>
Cc: Ray Ni <ray.ni@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Sean Rhodes <sean@...>
---
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 <Protocol/HiiPackageList.h>=0D
#include <Library/UefiBootServicesTableLib.h>=0D
#include <Library/DebugLib.h>=0D
+#include <Library/PcdLib.h>=0D
=0D
typedef struct {=0D
EFI_IMAGE_ID ImageId;=0D
@@ -69,6 +70,10 @@ GetImage (
return EFI_NOT_FOUND;=0D
}=0D
=0D
+ if (FixedPcdGetBool (PcdFollowMicrosoftRecommended)) {=0D
+ mLogos[Current].Attribute =3D EdkiiPlatformLogoDisplayAttributeMicroso=
ftRecommended;=0D
+ }=0D
+=0D
(*Instance)++;=0D
*Attribute =3D mLogos[Current].Attribute;=0D
*OffsetX =3D mLogos[Current].OffsetX;=0D
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=0D
UefiDriverEntryPoint=0D
DebugLib=0D
+ PcdLib=0D
=0D
[Protocols]=0D
gEfiHiiDatabaseProtocolGuid ## CONSUMES=0D
@@ -48,6 +49,9 @@
gEfiHiiPackageListProtocolGuid ## PRODUCES CONSUMES=0D
gEdkiiPlatformLogoProtocolGuid ## PRODUCES=0D
=0D
+[Pcd]=0D
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended ## CONSUMES=
=0D
+=0D
[Depex]=0D
gEfiHiiDatabaseProtocolGuid AND=0D
gEfiHiiImageExProtocolGuid=0D
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 7d98910832..a503aaf58d 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -2098,6 +2098,12 @@
# @Prompt The shared bit mask when Intel Tdx is enabled.=0D
gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10000025=
=0D
=0D
+ ## This PCD sets the position of the Boot Logo.=0D
+ # TRUE - The Logo is positioned following the recommendations from Mi=
crosoft.=0D
+ # FALSE - The logo is positioned in the center of the screen.=0D
+ # @ Prompt This position of the boot logo=0D
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|FALSE|BOOLE=
AN|0x10000026=0D
+=0D
[PcdsPatchableInModule]=0D
## Specify memory size with page number for PEI code when=0D
# Loading Module at Fixed Address feature is enabled.=0D
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index b070f15ff2..e7050df7b7 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -1334,3 +1334,9 @@
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPcieResizableBarSupport_HELP=
#language en-US "Indicates if the PCIe Resizable BAR Capability Supported.=
<BR><BR>\n"=0D
=
"TRUE - PCIe Resizable BAR Capability is supported.<BR>\=
n"=0D
=
"FALSE - PCIe Resizable BAR Capability is not supported.<=
BR>"=0D
+=0D
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommended_P=
ROMPT #language en-US "The position of the Boot Logo"=0D
+=0D
+#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"=0D
+ =
" from Microsoft, 38.2% from the top of the screen."=0D
+=0D
--=20
2.34.1

Join devel@edk2.groups.io to automatically receive all group messages.