public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sean Rhodes" <sean@starlabs.systems>
To: devel@edk2.groups.io
Cc: Sean Rhodes <sean@starlabs.systems>,
	Zhichao Gao <zhichao.gao@intel.com>, Ray Ni <ray.ni@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>
Subject: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo
Date: Tue, 26 Jul 2022 09:15:18 +0100	[thread overview]
Message-ID: <4db16236c17eeb47b48ffb43f61d2d4e8f2e2671.1658823319.git.sean@starlabs.systems> (raw)
In-Reply-To: <cd15a90e1fffcc3460b1cdf593a78d94f2442b27.1658823319.git.sean@starlabs.systems>

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/Library/BootLogoLib/BootLogoLib.inf | 5 ++++-
 MdeModulePkg/Logo/Logo.c                         | 5 +++++
 MdeModulePkg/Logo/LogoDxe.inf                    | 4 ++++
 MdeModulePkg/MdeModulePkg.dec                    | 6 ++++++
 MdeModulePkg/MdeModulePkg.uni                    | 6 ++++++
 5 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
index 7d50f2dfa3..14ba8a5906 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
@@ -48,5 +48,8 @@
   gEfiUserManagerProtocolGuid                   ## CONSUMES
   gEdkiiPlatformLogoProtocolGuid                ## CONSUMES
 
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFollowBGRTSpecification ## CONSUMES
+
 [FeaturePcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport             ## CONSUMES
diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c
index 8ab874d2da..73546b32f4 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 (PcdFollowBGRTSpecification)) {
+    mLogos[Current].Attribute = EdkiiPlatformLogoDisplayAttributeBGRTSpecification;
+  }
+
   (*Instance)++;
   *Attribute = mLogos[Current].Attribute;
   *OffsetX   = mLogos[Current].OffsetX;
diff --git a/MdeModulePkg/Logo/LogoDxe.inf b/MdeModulePkg/Logo/LogoDxe.inf
index 41215d25d8..c5c8ad0bcf 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.PcdFollowBGRTSpecification ## CONSUMES
+
 [Depex]
   gEfiHiiDatabaseProtocolGuid AND
   gEfiHiiImageExProtocolGuid
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 2bcb9f9453..e09918387c 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -2095,6 +2095,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 according to the BGRT specification.
+  #   FALSE - The logo is positioned in the center of the screen.
+  # @ Prompt This position of the boot logo
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFollowBGRTSpecification|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..c6ff7bc1bd 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_PcdFollowBGRTSpecification_PROMPT #language en-US "The position of the Boot Logo"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowBGRTSpecification_HELP   #language en-US "Sets 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."
+
-- 
2.34.1


  reply	other threads:[~2022-07-26  8:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26  8:15 [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow BGRT specification Sean Rhodes
2022-07-26  8:15 ` Sean Rhodes [this message]
2022-08-05  5:58   ` 回复: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo gaoliming
2022-07-26  8:15 ` [PATCH 3/3] UefiPayloadPkg: Hook up FOLLOW_BGRT_SPEC macro Sean Rhodes
2022-08-04 10:01 ` [edk2-devel] [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow BGRT specification Sean Rhodes
2022-08-05  5:59 ` 回复: " gaoliming
2022-08-05  6:55   ` Sean Rhodes
2022-08-05  7:04     ` Pedro Falcato
2022-08-12  4:54       ` 回复: " gaoliming
  -- strict thread matches above, loose matches on Subject: below --
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-09-26  8:09 [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow Microsoft Recommendations Sean Rhodes
2022-09-26  8:09 ` [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo Sean Rhodes
2022-10-08  2:02   ` Ni, Ray
2022-10-10  8:51     ` Sean Rhodes
2022-10-10  9:25       ` Ni, Ray
2022-10-10  9:44         ` Sean Rhodes
2022-10-25  7:26         ` Sean Rhodes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4db16236c17eeb47b48ffb43f61d2d4e8f2e2671.1658823319.git.sean@starlabs.systems \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox