From nobody Mon Dec 23 10:16:46 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 1518574052933459.4942141896181; Tue, 13 Feb 2018 18:07:32 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A953C2237A4FC; Tue, 13 Feb 2018 18:01:38 -0800 (PST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 B5BB422212C0B for ; Tue, 13 Feb 2018 18:01:36 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 18:07:27 -0800 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.241.98.72]) by fmsmga006.fm.intel.com with ESMTP; 13 Feb 2018 18:07:26 -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.120; helo=mga04.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,510,1511856000"; d="scan'208";a="204007802" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Tue, 13 Feb 2018 18:07:21 -0800 Message-Id: <20180214020722.5412-3-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180214020722.5412-1-michael.d.kinney@intel.com> References: <20180214020722.5412-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch 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 --- .../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