From nobody Tue Apr 30 04:20:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15187351349074.14870271026075; Thu, 15 Feb 2018 14:52:14 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EE5DC223230D9; Thu, 15 Feb 2018 14:46:19 -0800 (PST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8C701223230D0 for ; Thu, 15 Feb 2018 14:46:17 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2018 14:52:10 -0800 Received: from aanandan-mobl.amr.corp.intel.com (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.254.74.32]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2018 14:52:10 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,518,1511856000"; d="scan'208";a="31222127" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Thu, 15 Feb 2018 14:52:03 -0800 Message-Id: <20180215225205.16856-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180215225205.16856-1-michael.d.kinney@intel.com> References: <20180215225205.16856-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch v2 1/3] MdeModulePkg: Add Boot Logo 2 Protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Dong , Jiewen Yao , Michael D Kinney , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D799 Based on content from the following branch/commit: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2= e60302b2d Add new Boot Logo 2 Protocol that adds a GetBootLogo() service that can be used to retrieve the GOP BLT buffer, location, and size of the boot logo that was previously registered with the SetBootLogo() service. The Boot Logo 2 Protocol service GetBootLogo() is amended to return the pointer to the GOP BLT buffer previously registered with the SetBootLogo() service. 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: Sean Brogan --- MdeModulePkg/Include/Protocol/BootLogo2.h | 118 ++++++++++++++++++++++++++= ++++ MdeModulePkg/MdeModulePkg.dec | 3 + 2 files changed, 121 insertions(+) create mode 100644 MdeModulePkg/Include/Protocol/BootLogo2.h diff --git a/MdeModulePkg/Include/Protocol/BootLogo2.h b/MdeModulePkg/Inclu= de/Protocol/BootLogo2.h new file mode 100644 index 0000000000..6c4c4cf30a --- /dev/null +++ b/MdeModulePkg/Include/Protocol/BootLogo2.h @@ -0,0 +1,118 @@ +/** +Boot Logo 2 Protocol is used to convey information of Logo dispayed during= boot. + +The Boot Logo 2 Protocol is a replacement for the Boot Logo Protocol. If a +platform produces both the Boot Logo 2 Protocol and the Boot Logo Protocol +then the Boot Logo 2 Protocol must be used instead of the Boot Logo Protoc= ol. + +Copyright (c) 2016, Microsoft Corporation +Copyright (c) 2018, Intel Corporation. All rights reserved.
+ +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notic= e, +this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS= " AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPL= IED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS= CLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY D= IRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUD= ING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF U= SE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO= RY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLI= GENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +**/ + +#ifndef _BOOT_LOGO2_H_ +#define _BOOT_LOGO2_H_ + +#include + +#define EDKII_BOOT_LOGO2_PROTOCOL_GUID \ + { \ + 0x4b5dc1df, 0x1eaa, 0x48b2, { 0xa7, 0xe9, 0xea, 0xc4, 0x89, 0xa0, 0xb,= 0x5c } \ + } + +// +// Forward reference for pure ANSI compatability +// +typedef struct _EDKII_BOOT_LOGO2_PROTOCOL EDKII_BOOT_LOGO2_PROTOCOL; + +/** + Update information of logo image drawn on screen. + + @param[in] This The pointer to the Boot Logo protocol 2 instanc= e. + @param[in] BltBuffer The BLT buffer for logo drawn on screen. If Blt= Buffer + is set to NULL, it indicates that logo image is= no + longer on the screen. + @param[in] DestinationX X coordinate of destination for the BltBuffer. + @param[in] DestinationY Y coordinate of destination for the BltBuffer. + @param[in] Width Width of rectangle in BltBuffer in pixels. + @param[in] Height Hight of rectangle in BltBuffer in pixels. + + @retval EFI_SUCCESS The boot logo information was updated. + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid valu= e. + @retval EFI_OUT_OF_RESOURCES The logo information was not updated due = to + insufficient memory resources. +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_SET_BOOT_LOGO2)( + IN EDKII_BOOT_LOGO2_PROTOCOL *This, + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL, + IN UINTN DestinationX, + IN UINTN DestinationY, + IN UINTN Width, + IN UINTN Height + ); + +/** + Get the location of the boot logo on the screen. + + @param[in] This The pointer to the Boot Logo Protocol 2 instan= ce + @param[out] BltBuffer Returns pointer to the GOP BLT buffer that was + previously registered with SetBootLogo2(). The + buffer returned must not be modified or freed. + @param[out] DestinationX Returns the X start position of the GOP BLT bu= ffer + that was previously registers with SetBootLogo= 2(). + @param[out] DestinationY Returns the Y start position of the GOP BLT bu= ffer + that was previously registers with SetBootLogo= 2(). + @param[out] Width Returns the width of the GOP BLT buffer + that was previously registers with SetBootLogo= 2(). + @param[out] Height Returns the height of the GOP BLT buffer + that was previously registers with SetBootLogo= 2(). + + @retval EFI_SUCCESS The location of the boot logo was returne= d. + @retval EFI_NOT_READY The boot logo has not been set. + @retval EFI_INVALID_PARAMETER BltBuffer is NULL. + @retval EFI_INVALID_PARAMETER DestinationX is NULL. + @retval EFI_INVALID_PARAMETER DestinationY is NULL. + @retval EFI_INVALID_PARAMETER Width is NULL. + @retval EFI_INVALID_PARAMETER Height is NULL. +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_GET_BOOT_LOGO2)( + IN EDKII_BOOT_LOGO2_PROTOCOL *This, + OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **BltBuffer, + OUT UINTN *DestinationX, + OUT UINTN *DestinationY, + OUT UINTN *Width, + OUT UINTN *Height + ); + +struct _EDKII_BOOT_LOGO2_PROTOCOL { + EDKII_SET_BOOT_LOGO2 SetBootLogo; + EDKII_GET_BOOT_LOGO2 GetBootLogo; +}; + +extern EFI_GUID gEdkiiBootLogo2ProtocolGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 455979386e..ba0585936b 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -538,6 +538,9 @@ [Protocols] ## Include/Protocol/BootLogo.h gEfiBootLogoProtocolGuid =3D { 0xcdea2bd3, 0xfc25, 0x4c1c, { 0xb9, 0x7c,= 0xb3, 0x11, 0x86, 0x6, 0x49, 0x90 } } =20 + # Include/Protocol/BootLogo2.h + gEdkiiBootLogo2ProtocolGuid =3D { 0x4b5dc1df, 0x1eaa, 0x48b2, { 0xa7, 0x= e9, 0xea, 0xc4, 0x89, 0xa0, 0xb, 0x5c } } + ## Include/Protocol/DisplayProtocol.h gEdkiiFormDisplayEngineProtocolGuid =3D { 0x9bbe29e9, 0xfda1, 0x41ec, { = 0xad, 0x52, 0x45, 0x22, 0x13, 0x74, 0x2d, 0x2e } } =20 --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue Apr 30 04:20:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1518735137267266.80923984755975; Thu, 15 Feb 2018 14:52:17 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 66E31223230DE; Thu, 15 Feb 2018 14:46:20 -0800 (PST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 79B69223230D0 for ; Thu, 15 Feb 2018 14:46:18 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2018 14:52:11 -0800 Received: from aanandan-mobl.amr.corp.intel.com (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.254.74.32]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2018 14:52:11 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,518,1511856000"; d="scan'208";a="31222133" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Thu, 15 Feb 2018 14:52:04 -0800 Message-Id: <20180215225205.16856-3-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180215225205.16856-1-michael.d.kinney@intel.com> References: <20180215225205.16856-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch v2 2/3] MdeModulePkg/BootGraphicsResourceDxe: Add Boot Logo 2 Protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Dong , Jiewen Yao , Michael D Kinney , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Michael D Kinney https://bugzilla.tianocore.org/show_bug.cgi?id=3D799 Based on content from the following branch/commit: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2= e60302b2d Update BootGraphicsResourceDxe to produce both the Boot Logo Protocol and the Boot Logo 2 Protocol. The Boot Logo 2 Protocol service GetBootLogo() is amended to return the pointer to the GOP BLT buffer previously registered with the SetBootLogo() service. 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: Sean Brogan --- .../BootGraphicsResourceTableDxe.c | 208 +++++++++++++++++= ++-- .../BootGraphicsResourceTableDxe.inf | 2 + 2 files changed, 196 insertions(+), 14 deletions(-) diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootG= raphicsResourceTableDxe.c b/MdeModulePkg/Universal/Acpi/BootGraphicsResourc= eTableDxe/BootGraphicsResourceTableDxe.c index 118fb4a922..85e79c6ce6 100644 --- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.c +++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.c @@ -2,6 +2,7 @@ This module install ACPI Boot Graphics Resource Table (BGRT). =20 Copyright (c) 2011 - 2018, 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 BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -18,6 +19,7 @@ #include #include #include +#include =20 #include =20 @@ -33,20 +35,19 @@ /** Update information of logo image drawn on screen. =20 - @param This The pointer to the Boot Logo protocol instance. - @param BltBuffer The BLT buffer for logo drawn on screen. If BltBu= ffer - is set to NULL, it indicates that logo image is no - longer on the screen. - @param DestinationX X coordinate of destination for the BltBuffer. - @param DestinationY Y coordinate of destination for the BltBuffer. - @param Width Width of rectangle in BltBuffer in pixels. - @param Height Hight of rectangle in BltBuffer in pixels. - - @retval EFI_SUCCESS The boot logo information was updated. - @retval EFI_INVALID_PARAMETER One of the parameters has an invalid val= ue. - @retval EFI_OUT_OF_RESOURCES The logo information was not updated due= to - insufficient memory resources. + @param[in] This The pointer to the Boot Logo protocol 2 instanc= e. + @param[in] BltBuffer The BLT buffer for logo drawn on screen. If Blt= Buffer + is set to NULL, it indicates that logo image is= no + longer on the screen. + @param[in] DestinationX X coordinate of destination for the BltBuffer. + @param[in] DestinationY Y coordinate of destination for the BltBuffer. + @param[in] Width Width of rectangle in BltBuffer in pixels. + @param[in] Height Hight of rectangle in BltBuffer in pixels. =20 + @retval EFI_SUCCESS The boot logo information was updated. + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid valu= e. + @retval EFI_OUT_OF_RESOURCES The logo information was not updated due = to + insufficient memory resources. **/ EFI_STATUS EFIAPI @@ -59,6 +60,69 @@ SetBootLogo ( IN UINTN Height ); =20 +/** + Update information of logo image drawn on screen. + + @param[in] This The pointer to the Boot Logo protocol 2 instanc= e. + @param[in] BltBuffer The BLT buffer for logo drawn on screen. If Blt= Buffer + is set to NULL, it indicates that logo image is= no + longer on the screen. + @param[in] DestinationX X coordinate of destination for the BltBuffer. + @param[in] DestinationY Y coordinate of destination for the BltBuffer. + @param[in] Width Width of rectangle in BltBuffer in pixels. + @param[in] Height Hight of rectangle in BltBuffer in pixels. + + @retval EFI_SUCCESS The boot logo information was updated. + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid valu= e. + @retval EFI_OUT_OF_RESOURCES The logo information was not updated due = to + insufficient memory resources. +**/ +EFI_STATUS +EFIAPI +SetBootLogo2 ( + IN EDKII_BOOT_LOGO2_PROTOCOL *This, + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL, + IN UINTN DestinationX, + IN UINTN DestinationY, + IN UINTN Width, + IN UINTN Height + ); + +/** + Get the location of the boot logo on the screen. + + @param[in] This The pointer to the Boot Logo Protocol 2 instan= ce + @param[out] BltBuffer Returns pointer to the GOP BLT buffer that was + previously registered with SetBootLogo2(). The + buffer returned must not be modified or freed. + @param[out] DestinationX Returns the X start position of the GOP BLT bu= ffer + that was previously registers with SetBootLogo= 2(). + @param[out] DestinationY Returns the Y start position of the GOP BLT bu= ffer + that was previously registers with SetBootLogo= 2(). + @param[out] Width Returns the width of the GOP BLT buffer + that was previously registers with SetBootLogo= 2(). + @param[out] Height Returns the height of the GOP BLT buffer + that was previously registers with SetBootLogo= 2(). + + @retval EFI_SUCCESS The location of the boot logo was returne= d. + @retval EFI_NOT_READY The boot logo has not been set. + @retval EFI_INVALID_PARAMETER BltBuffer is NULL. + @retval EFI_INVALID_PARAMETER DestinationX is NULL. + @retval EFI_INVALID_PARAMETER DestinationY is NULL. + @retval EFI_INVALID_PARAMETER Width is NULL. + @retval EFI_INVALID_PARAMETER Height is NULL. +**/ +EFI_STATUS +EFIAPI +GetBootLogo2 ( + IN EDKII_BOOT_LOGO2_PROTOCOL *This, + OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **BltBuffer, + OUT UINTN *DestinationX, + OUT UINTN *DestinationY, + OUT UINTN *Width, + OUT UINTN *Height + ); + // // Boot Logo Protocol Handle // @@ -71,6 +135,14 @@ EFI_BOOT_LOGO_PROTOCOL mBootLogoProtocolTemplate =3D { SetBootLogo }; =20 +/// +/// Boot Logo 2 Protocol instance +/// +EDKII_BOOT_LOGO2_PROTOCOL mBootLogo2ProtocolTemplate =3D { + SetBootLogo2, + GetBootLogo2 +}; + EFI_EVENT mBootGraphicsReadyToBootEvent; UINTN mBootGraphicsResourceTableKey =3D 0; BOOLEAN mIsLogoValid =3D FALSE; @@ -137,6 +209,47 @@ SetBootLogo ( IN UINTN Width, IN UINTN Height ) +{ + // + // Call same service in Boot Logo 2 Protocol + // + return SetBootLogo2 ( + &mBootLogo2ProtocolTemplate, + BltBuffer, + DestinationX, + DestinationY, + Width, + Height + ); +} + +/** + Update information of logo image drawn on screen. + + @param[in] This The pointer to the Boot Logo protocol 2 instanc= e. + @param[in] BltBuffer The BLT buffer for logo drawn on screen. If Blt= Buffer + is set to NULL, it indicates that logo image is= no + longer on the screen. + @param[in] DestinationX X coordinate of destination for the BltBuffer. + @param[in] DestinationY Y coordinate of destination for the BltBuffer. + @param[in] Width Width of rectangle in BltBuffer in pixels. + @param[in] Height Hight of rectangle in BltBuffer in pixels. + + @retval EFI_SUCCESS The boot logo information was updated. + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid valu= e. + @retval EFI_OUT_OF_RESOURCES The logo information was not updated due = to + insufficient memory resources. +**/ +EFI_STATUS +EFIAPI +SetBootLogo2 ( + IN EDKII_BOOT_LOGO2_PROTOCOL *This, + IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL, + IN UINTN DestinationX, + IN UINTN DestinationY, + IN UINTN Width, + IN UINTN Height + ) { EFI_STATUS Status; UINTN BufferSize; @@ -227,6 +340,71 @@ SetBootLogo ( return EFI_SUCCESS; } =20 +/** + Get the location of the boot logo on the screen. + + @param[in] This The pointer to the Boot Logo Protocol 2 instan= ce + @param[out] BltBuffer Returns pointer to the GOP BLT buffer that was + previously registered with SetBootLogo2(). The + buffer returned must not be modified or freed. + @param[out] DestinationX Returns the X start position of the GOP BLT bu= ffer + that was previously registers with SetBootLogo= 2(). + @param[out] DestinationY Returns the Y start position of the GOP BLT bu= ffer + that was previously registers with SetBootLogo= 2(). + @param[out] Width Returns the width of the GOP BLT buffer + that was previously registers with SetBootLogo= 2(). + @param[out] Height Returns the height of the GOP BLT buffer + that was previously registers with SetBootLogo= 2(). + + @retval EFI_SUCCESS The location of the boot logo was returne= d. + @retval EFI_NOT_READY The boot logo has not been set. + @retval EFI_INVALID_PARAMETER BltBuffer is NULL. + @retval EFI_INVALID_PARAMETER DestinationX is NULL. + @retval EFI_INVALID_PARAMETER DestinationY is NULL. + @retval EFI_INVALID_PARAMETER Width is NULL. + @retval EFI_INVALID_PARAMETER Height is NULL. +**/ +EFI_STATUS +EFIAPI +GetBootLogo2 ( + IN EDKII_BOOT_LOGO2_PROTOCOL *This, + OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **BltBuffer, + OUT UINTN *DestinationX, + OUT UINTN *DestinationY, + OUT UINTN *Width, + OUT UINTN *Height + ) +{ + // + // If the boot logo has not been set with SetBootLogo() or SetBootLogo()= was + // called with a NULL BltBuffer then the boot logo is not valid and + // EFI_NOT_READY is returned. + // + if (mLogoBltBuffer =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "Request to get boot logo location before boot lo= go has been set.\n")); + return EFI_NOT_READY; + } + + // + // Make sure none of the boot logo location parameters are NULL. + // + if (BltBuffer =3D=3D NULL || DestinationX =3D=3D NULL || DestinationY = =3D=3D NULL || + Width =3D=3D NULL || Height =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // Boot logo is valid. Return values from module globals. + // + *BltBuffer =3D mLogoBltBuffer; + *DestinationX =3D mLogoDestX; + *DestinationY =3D mLogoDestY; + *Width =3D mLogoWidth; + *Height =3D mLogoHeight; + + return EFI_SUCCESS; +} + /** Notify function for event group EFI_EVENT_GROUP_READY_TO_BOOT. This is u= sed to install the Boot Graphics Resource Table. @@ -401,12 +579,14 @@ BootGraphicsDxeEntryPoint ( Header->CreatorRevision =3D PcdGet32 (PcdAcpiDefaultCreatorRevision); =20 // - // Install Boot Logo protocol. + // Install Boot Logo and Boot Logo 2 Protocols. // Status =3D gBS->InstallMultipleProtocolInterfaces ( &mBootLogoHandle, &gEfiBootLogoProtocolGuid, &mBootLogoProtocolTemplate, + &gEdkiiBootLogo2ProtocolGuid, + &mBootLogo2ProtocolTemplate, NULL ); ASSERT_EFI_ERROR (Status); diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootG= raphicsResourceTableDxe.inf b/MdeModulePkg/Universal/Acpi/BootGraphicsResou= rceTableDxe/BootGraphicsResourceTableDxe.inf index ff33405acd..bc1c10e981 100644 --- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf +++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf @@ -2,6 +2,7 @@ # This module install ACPI Boot Graphics Resource Table (BGRT). # # Copyright (c) 2011 - 2018, 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 B= SD License # which accompanies this distribution. The full text of the license may = be found at @@ -49,6 +50,7 @@ [LibraryClasses] [Protocols] gEfiAcpiTableProtocolGuid ## CONSUMES gEfiBootLogoProtocolGuid ## PRODUCES + gEdkiiBootLogo2ProtocolGuid ## PRODUCES =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId ## CONSUMES --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue Apr 30 04:20:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1518735139865574.5362165283119; Thu, 15 Feb 2018 14:52:19 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D474E223230E0; Thu, 15 Feb 2018 14:46:21 -0800 (PST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 19F05223230DB for ; Thu, 15 Feb 2018 14:46:20 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2018 14:52:13 -0800 Received: from aanandan-mobl.amr.corp.intel.com (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.254.74.32]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2018 14:52:11 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,518,1511856000"; d="scan'208";a="31222143" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Thu, 15 Feb 2018 14:52:05 -0800 Message-Id: <20180215225205.16856-4-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180215225205.16856-1-michael.d.kinney@intel.com> References: <20180215225205.16856-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch v2 3/3] MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Dong , Jiewen Yao , Michael D Kinney , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D799 Based on content from the following branch/commit: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2= e60302b2d 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: Sean Brogan --- MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 32 ++++++++++++++++++++= ++-- MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf | 2 ++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/= Library/BootLogoLib/BootLogoLib.c index 8bd9985cb2..659f29ec66 100644 --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c @@ -3,6 +3,7 @@ to show progress bar and LOGO. =20 Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2016, Microsoft Corporation
This program and the accompanying materials are licensed and made availabl= e under the terms and conditions of the BSD License that accompanies this distribu= tion. 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 =3D NULL; } =20 + // + // Try to open Boot Logo 2 Protocol. + // + Status =3D gBS->LocateProtocol (&gEdkiiBootLogo2ProtocolGuid, NULL, (VOI= D **) &BootLogo2); + if (EFI_ERROR (Status)) { + BootLogo2 =3D NULL; + } + // // Erase Cursor from screen // @@ -259,7 +270,7 @@ BootLogoEnableLogo ( } } =20 - if (BootLogo =3D=3D NULL || NumberOfLogos =3D=3D 0) { + if ((BootLogo =3D=3D NULL && BootLogo2 =3D=3D NULL) || NumberOfLogos =3D= =3D 0) { // // No logo displayed. // @@ -330,7 +341,24 @@ BootLogoEnableLogo ( } =20 if (!EFI_ERROR (Status)) { - BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWi= dth, LogoHeight); + // + // Attempt to register logo with Boot Logo 2 Protocol first + // + if (BootLogo2 !=3D NULL) { + Status =3D BootLogo2->SetBootLogo (BootLogo2, LogoBlt, LogoDestX, Lo= goDestY, 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 Proto= col + // + if (EFI_ERROR (Status) && BootLogo !=3D NULL) { + Status =3D BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, Logo= DestY, LogoWidth, LogoHeight); + } + // + // Status of this functionm is EFI_SUCCESS even if registration with B= oot + // Logo 2 Protocol or Boot Logo Protocol fails. + // + Status =3D EFI_SUCCESS; } FreePool (LogoBlt); =20 diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf b/MdeModulePk= g/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. # =20 # Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2016, Microsoft Corporation
# This program and the accompanying materials are licensed and made avail= able under # the terms and conditions of the BSD License that accompanies this distr= ibution. # The full text of the license may be found at @@ -49,6 +50,7 @@ [Protocols] gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES gEfiBootLogoProtocolGuid ## SOMETIMES_CONSUMES =20 + gEdkiiBootLogo2ProtocolGuid ## SOMETIMES_CONSUMES gEfiUserManagerProtocolGuid ## CONSUMES gEdkiiPlatformLogoProtocolGuid ## CONSUMES =20 --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel