public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow Microsoft Recommendations
@ 2022-08-05  7:52 Sean Rhodes
  2022-08-05  7:52 ` [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo Sean Rhodes
  2022-08-05  7:52 ` [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro Sean Rhodes
  0 siblings, 2 replies; 5+ messages in thread
From: Sean Rhodes @ 2022-08-05  7:52 UTC (permalink / raw)
  To: devel; +Cc: Sean Rhodes, Zhichao Gao, Ray Ni, Jian J Wang, Liming Gao

Add an option to position the logo 38.2% from the top of the screen,
which follows the recommendations from Microsoft. These can be found
here:
https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-screen-components

Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.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>
---
 MdeModulePkg/Include/Protocol/PlatformLogo.h   | 3 ++-
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Include/Protocol/PlatformLogo.h b/MdeModulePkg/Include/Protocol/PlatformLogo.h
index 08e1dc35a4..b24d7d5b79 100644
--- a/MdeModulePkg/Include/Protocol/PlatformLogo.h
+++ b/MdeModulePkg/Include/Protocol/PlatformLogo.h
@@ -29,7 +29,8 @@ typedef enum {
   EdkiiPlatformLogoDisplayAttributeCenterBottom,
   EdkiiPlatformLogoDisplayAttributeLeftBottom,
   EdkiiPlatformLogoDisplayAttributeCenterLeft,
-  EdkiiPlatformLogoDisplayAttributeCenter
+  EdkiiPlatformLogoDisplayAttributeCenter,
+  EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended
 } EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE;
 
 /**
diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
index 478ec2d40e..9065e5281b 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -169,7 +169,6 @@ BootLogoEnableLogo (
         DestX = SizeOfX - Image.Width;
         DestY = 0;
         break;
-
       case EdkiiPlatformLogoDisplayAttributeCenterLeft:
         DestX = 0;
         DestY = (SizeOfY - Image.Height) / 2;
@@ -182,7 +181,6 @@ BootLogoEnableLogo (
         DestX = SizeOfX - Image.Width;
         DestY = (SizeOfY - Image.Height) / 2;
         break;
-
       case EdkiiPlatformLogoDisplayAttributeLeftBottom:
         DestX = 0;
         DestY = SizeOfY - Image.Height;
@@ -195,7 +193,10 @@ BootLogoEnableLogo (
         DestX = SizeOfX - Image.Width;
         DestY = SizeOfY - Image.Height;
         break;
-
+      case EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended:
+        DestX = (SizeOfX - Image.Width) / 2;
+        DestY = (SizeOfY * 382) / 1000 - Image.Height / 2;
+        break;
       default:
         ASSERT (FALSE);
         continue;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo
  2022-08-05  7:52 [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow Microsoft Recommendations Sean Rhodes
@ 2022-08-05  7:52 ` Sean Rhodes
  2022-08-05  7:52 ` [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro Sean Rhodes
  1 sibling, 0 replies; 5+ messages in thread
From: Sean Rhodes @ 2022-08-05  7:52 UTC (permalink / raw)
  To: devel; +Cc: Sean Rhodes, Zhichao Gao, Ray Ni, Jian J Wang, Liming Gao

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 <ray.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>
---
 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>
 #include <Library/UefiBootServicesTableLib.h>
 #include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
 
 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 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.
   gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10000025
 
+  ## 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|FALSE|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 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"
                                                                                             "TRUE  - PCIe Resizable BAR Capability is supported.<BR>\n"
                                                                                             "FALSE - PCIe Resizable BAR Capability is not supported.<BR>"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommended_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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro
  2022-08-05  7:52 [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow Microsoft Recommendations Sean Rhodes
  2022-08-05  7:52 ` [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo Sean Rhodes
@ 2022-08-05  7:52 ` Sean Rhodes
  2022-08-09  5:29   ` Guo Dong
  1 sibling, 1 reply; 5+ messages in thread
From: Sean Rhodes @ 2022-08-05  7:52 UTC (permalink / raw)
  To: devel; +Cc: Sean Rhodes, Guo Dong, Ray Ni

Hook up MICROSOFT_RECOMMENDED macro to PcdFollowMicrosoftRecommended.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 91cd78dbf1..b3ed0f6a2e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -43,6 +43,7 @@
   DEFINE SD_MMC_TIMEOUT               = 1000000
   DEFINE USE_CBMEM_FOR_CONSOLE        = FALSE
   DEFINE BOOTSPLASH_IMAGE             = FALSE
+  DEFINE MICROSOFT_RECOMMENDED        = FALSE
 
   #
   # NULL:    NullMemoryTestDxe
@@ -440,6 +441,7 @@
 
   gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)
   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|$(MICROSOFT_RECOMMENDED)
 
   gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1800000
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro
  2022-08-05  7:52 ` [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro Sean Rhodes
@ 2022-08-09  5:29   ` Guo Dong
  2022-08-09  7:59     ` Sean Rhodes
  0 siblings, 1 reply; 5+ messages in thread
From: Guo Dong @ 2022-08-09  5:29 UTC (permalink / raw)
  To: Rhodes, Sean, devel@edk2.groups.io; +Cc: Rhodes, Sean, Ni, Ray


Hi Sean,
How about directly setting the PCD in the build command line instead of adding a MACRO?
Prefer not adding new MACRO if we could avoid it.

Thanks,
Guo
-----Original Message-----
From: Sean Rhodes <sean@starlabs.systems> 
Sent: Friday, August 5, 2022 12:53 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean <sean@starlabs.systems>; Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
Subject: [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro

Hook up MICROSOFT_RECOMMENDED macro to PcdFollowMicrosoftRecommended.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 91cd78dbf1..b3ed0f6a2e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -43,6 +43,7 @@
   DEFINE SD_MMC_TIMEOUT               = 1000000

   DEFINE USE_CBMEM_FOR_CONSOLE        = FALSE

   DEFINE BOOTSPLASH_IMAGE             = FALSE

+  DEFINE MICROSOFT_RECOMMENDED        = FALSE

 

   #

   # NULL:    NullMemoryTestDxe

@@ -440,6 +441,7 @@
 

   gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)

   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|$(MICROSOFT_RECOMMENDED)

 

   gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1800000

 

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro
  2022-08-09  5:29   ` Guo Dong
@ 2022-08-09  7:59     ` Sean Rhodes
  0 siblings, 0 replies; 5+ messages in thread
From: Sean Rhodes @ 2022-08-09  7:59 UTC (permalink / raw)
  To: Dong, Guo; +Cc: devel, Ni, Ray

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

Hi Guo

Yes, that's fine with me.

This single patch can be disregarded then.

Thank you

Sean

On Tue, 9 Aug 2022, 06:29 Dong, Guo, <guo.dong@intel.com> wrote:

>
> Hi Sean,
> How about directly setting the PCD in the build command line instead of
> adding a MACRO?
> Prefer not adding new MACRO if we could avoid it.
>
> Thanks,
> Guo
> -----Original Message-----
> From: Sean Rhodes <sean@starlabs.systems>
> Sent: Friday, August 5, 2022 12:53 AM
> To: devel@edk2.groups.io
> Cc: Rhodes, Sean <sean@starlabs.systems>; Dong, Guo <guo.dong@intel.com>;
> Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro
>
> Hook up MICROSOFT_RECOMMENDED macro to PcdFollowMicrosoftRecommended.
>
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 91cd78dbf1..b3ed0f6a2e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -43,6 +43,7 @@
>    DEFINE SD_MMC_TIMEOUT               = 1000000
>
>    DEFINE USE_CBMEM_FOR_CONSOLE        = FALSE
>
>    DEFINE BOOTSPLASH_IMAGE             = FALSE
>
> +  DEFINE MICROSOFT_RECOMMENDED        = FALSE
>
>
>
>    #
>
>    # NULL:    NullMemoryTestDxe
>
> @@ -440,6 +441,7 @@
>
>
>
>  gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)
>
>
>  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
>
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|$(MICROSOFT_RECOMMENDED)
>
>
>
>    gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1800000
>
>
>
> --
> 2.34.1
>
>

[-- Attachment #2: Type: text/html, Size: 2904 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-09  8:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-05  7:52 [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow Microsoft Recommendations Sean Rhodes
2022-08-05  7:52 ` [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo Sean Rhodes
2022-08-05  7:52 ` [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro Sean Rhodes
2022-08-09  5:29   ` Guo Dong
2022-08-09  7:59     ` Sean Rhodes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox