From: Kinney, Michael D Date: Wed, 20 Dec 2017 20:47:39 +0000 (-0800) Subject: MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol X-Git-Tag: edk2-stable201903~2309 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=90f7f19ae7929af5662497af3318ed5c8bd96351;hp=7777360637d590d694cb805c5edfb930ff7379d0;p=mirror_edk2.git MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol 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 Cc: Bret Barkelew Cc: Jiewen Yao Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: Star Zeng Reviewed-by: Sean Brogan --- diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c index 8bd9985cb2..e14c097510 100644 --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c @@ -3,6 +3,7 @@ to show progress bar and LOGO. Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2016, Microsoft Corporation
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at @@ -19,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include @@ -56,6 +58,7 @@ BootLogoEnableLogo ( UINT32 RefreshRate; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; EFI_BOOT_LOGO_PROTOCOL *BootLogo; + EDKII_BOOT_LOGO2_PROTOCOL *BootLogo2; UINTN NumberOfLogos; EFI_GRAPHICS_OUTPUT_BLT_PIXEL *LogoBlt; UINTN LogoDestX; @@ -98,6 +101,14 @@ BootLogoEnableLogo ( BootLogo = NULL; } + // + // Try to open Boot Logo 2 Protocol. + // + Status = gBS->LocateProtocol (&gEdkiiBootLogo2ProtocolGuid, NULL, (VOID **) &BootLogo2); + if (EFI_ERROR (Status)) { + BootLogo2 = NULL; + } + // // Erase Cursor from screen // @@ -259,7 +270,7 @@ BootLogoEnableLogo ( } } - if (BootLogo == NULL || NumberOfLogos == 0) { + if ((BootLogo == NULL && BootLogo2 == NULL) || NumberOfLogos == 0) { // // No logo displayed. // @@ -330,7 +341,24 @@ BootLogoEnableLogo ( } if (!EFI_ERROR (Status)) { - BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight); + // + // Attempt to register logo with Boot Logo 2 Protocol first + // + if (BootLogo2 != NULL) { + Status = BootLogo2->SetBootLogo (BootLogo2, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight); + } + // + // If Boot Logo 2 Protocol is not available or registration with Boot Logo 2 + // Protocol failed, then attempt to register logo with Boot Logo Protocol + // + if (EFI_ERROR (Status) && BootLogo != NULL) { + Status = BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight); + } + // + // Status of this function is EFI_SUCCESS even if registration with Boot + // Logo 2 Protocol or Boot Logo Protocol fails. + // + Status = EFI_SUCCESS; } FreePool (LogoBlt); diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf index 79b5fc511a..47969cc05a 100644 --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf @@ -3,6 +3,7 @@ # to show progress bar and logo. # # Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2016, Microsoft Corporation
# This program and the accompanying materials are licensed and made available under # the terms and conditions of the BSD License that accompanies this distribution. # The full text of the license may be found at @@ -49,6 +50,7 @@ gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES gEfiBootLogoProtocolGuid ## SOMETIMES_CONSUMES + gEdkiiBootLogo2ProtocolGuid ## SOMETIMES_CONSUMES gEfiUserManagerProtocolGuid ## CONSUMES gEdkiiPlatformLogoProtocolGuid ## CONSUMES