]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol
authorKinney, Michael D <michael.d.kinney@intel.com>
Wed, 20 Dec 2017 20:47:39 +0000 (12:47 -0800)
committerMichael D Kinney <michael.d.kinney@intel.com>
Wed, 28 Feb 2018 19:59:31 +0000 (11:59 -0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=799

Based on content from the following branch/commit:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d

Add check to see if the Boot Logo 2 Protocol is available
and attempt to set the location and size of the boot logo
using both the Boot Logo Protocol and the Boot Logo 2
Protocol.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf

index 8bd9985cb27189b3742e9ee3f3dbd0f9419717df..e14c097510436f4ce1ff3e963eaa14f8b4931976 100644 (file)
@@ -3,6 +3,7 @@
   to show progress bar and LOGO.\r
 \r
 Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
   to show progress bar and LOGO.\r
 \r
 Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016, Microsoft Corporation<BR>\r
 This program and the accompanying materials are licensed and made available under\r
 the terms and conditions of the BSD License that accompanies this distribution.\r
 The full text of the license may be found at\r
 This program and the accompanying materials are licensed and made available under\r
 the terms and conditions of the BSD License that accompanies this distribution.\r
 The full text of the license may be found at\r
@@ -19,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/PlatformLogo.h>\r
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/BootLogo.h>\r
 #include <Protocol/PlatformLogo.h>\r
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/BootLogo.h>\r
+#include <Protocol/BootLogo2.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
@@ -56,6 +58,7 @@ BootLogoEnableLogo (
   UINT32                                RefreshRate;\r
   EFI_GRAPHICS_OUTPUT_PROTOCOL          *GraphicsOutput;\r
   EFI_BOOT_LOGO_PROTOCOL                *BootLogo;\r
   UINT32                                RefreshRate;\r
   EFI_GRAPHICS_OUTPUT_PROTOCOL          *GraphicsOutput;\r
   EFI_BOOT_LOGO_PROTOCOL                *BootLogo;\r
+  EDKII_BOOT_LOGO2_PROTOCOL             *BootLogo2;\r
   UINTN                                 NumberOfLogos;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *LogoBlt;\r
   UINTN                                 LogoDestX;\r
   UINTN                                 NumberOfLogos;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *LogoBlt;\r
   UINTN                                 LogoDestX;\r
@@ -98,6 +101,14 @@ BootLogoEnableLogo (
     BootLogo = NULL;\r
   }\r
 \r
     BootLogo = NULL;\r
   }\r
 \r
+  //\r
+  // Try to open Boot Logo 2 Protocol.\r
+  //\r
+  Status = gBS->LocateProtocol (&gEdkiiBootLogo2ProtocolGuid, NULL, (VOID **) &BootLogo2);\r
+  if (EFI_ERROR (Status)) {\r
+    BootLogo2 = NULL;\r
+  }\r
+\r
   //\r
   // Erase Cursor from screen\r
   //\r
   //\r
   // Erase Cursor from screen\r
   //\r
@@ -259,7 +270,7 @@ BootLogoEnableLogo (
     }\r
   }\r
 \r
     }\r
   }\r
 \r
-  if (BootLogo == NULL || NumberOfLogos == 0) {\r
+  if ((BootLogo == NULL && BootLogo2 == NULL) || NumberOfLogos == 0) {\r
     //\r
     // No logo displayed.\r
     //\r
     //\r
     // No logo displayed.\r
     //\r
@@ -330,7 +341,24 @@ BootLogoEnableLogo (
   }\r
 \r
   if (!EFI_ERROR (Status)) {\r
   }\r
 \r
   if (!EFI_ERROR (Status)) {\r
-    BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);\r
+    //\r
+    // Attempt to register logo with Boot Logo 2 Protocol first\r
+    //\r
+    if (BootLogo2 != NULL) {\r
+      Status = BootLogo2->SetBootLogo (BootLogo2, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);\r
+    }\r
+    //\r
+    // If Boot Logo 2 Protocol is not available or registration with Boot Logo 2\r
+    // Protocol failed, then attempt to register logo with Boot Logo Protocol\r
+    //\r
+    if (EFI_ERROR (Status) && BootLogo != NULL) {\r
+      Status = BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);\r
+    }\r
+    //\r
+    // Status of this function is EFI_SUCCESS even if registration with Boot\r
+    // Logo 2 Protocol or Boot Logo Protocol fails.\r
+    //\r
+    Status = EFI_SUCCESS;\r
   }\r
   FreePool (LogoBlt);\r
 \r
   }\r
   FreePool (LogoBlt);\r
 \r
index 79b5fc511a8b822fc9083f4cfb5edb7c0f96c0c9..47969cc05a02fada4275c6d120e5295598788170 100644 (file)
@@ -3,6 +3,7 @@
 #  to show progress bar and logo.\r
 #  \r
 #  Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
 #  to show progress bar and logo.\r
 #  \r
 #  Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2016, Microsoft Corporation<BR>\r
 #  This program and the accompanying materials are licensed and made available under\r
 #  the terms and conditions of the BSD License that accompanies this distribution.\r
 #  The full text of the license may be found at\r
 #  This program and the accompanying materials are licensed and made available under\r
 #  the terms and conditions of the BSD License that accompanies this distribution.\r
 #  The full text of the license may be found at\r
@@ -49,6 +50,7 @@
   gEfiGraphicsOutputProtocolGuid                ## SOMETIMES_CONSUMES\r
   gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES\r
   gEfiBootLogoProtocolGuid                      ## SOMETIMES_CONSUMES  \r
   gEfiGraphicsOutputProtocolGuid                ## SOMETIMES_CONSUMES\r
   gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES\r
   gEfiBootLogoProtocolGuid                      ## SOMETIMES_CONSUMES  \r
+  gEdkiiBootLogo2ProtocolGuid                   ## SOMETIMES_CONSUMES\r
   gEfiUserManagerProtocolGuid                   ## CONSUMES\r
   gEdkiiPlatformLogoProtocolGuid                ## CONSUMES\r
 \r
   gEfiUserManagerProtocolGuid                   ## CONSUMES\r
   gEdkiiPlatformLogoProtocolGuid                ## CONSUMES\r
 \r