From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 EE46B223230D0 for ; Thu, 15 Feb 2018 14:47:06 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2018 14:52:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,518,1511856000"; d="scan'208,217";a="18533855" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by orsmga008.jf.intel.com with ESMTP; 15 Feb 2018 14:52:59 -0800 Received: from orsmsx155.amr.corp.intel.com (10.22.240.21) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 15 Feb 2018 14:52:59 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.97]) by ORSMSX155.amr.corp.intel.com ([169.254.7.73]) with mapi id 14.03.0319.002; Thu, 15 Feb 2018 14:52:58 -0800 From: "Kinney, Michael D" To: Sean Brogan , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: Bret Barkelew , "Yao, Jiewen" , "Zeng, Star" , "Dong, Eric" Thread-Topic: [Patch 3/3] MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol Thread-Index: AQHTpTiTaUqlMyMWikaZMnLhlBwOiKOjwUCAgAJTlOA= Date: Thu, 15 Feb 2018 22:52:58 +0000 Message-ID: References: <20180214020722.5412-1-michael.d.kinney@intel.com>, <20180214020722.5412-4-michael.d.kinney@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: Re: [Patch 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: , X-List-Received-Date: Thu, 15 Feb 2018 22:47:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sean, Thanks for the feedback. I have posted V2 with this change. Mike From: Sean Brogan [mailto:sean.brogan@microsoft.com] Sent: Tuesday, February 13, 2018 7:21 PM To: Kinney, Michael D ; edk2-devel@lists.01.org Cc: Bret Barkelew ; Yao, Jiewen ; Zeng, Star ; Dong, Eric Subject: Re: [Patch 3/3] MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol Mike, Looking over the MdeModulePkg library changes it seems wasteful to call bot= h protocols for Set. In the previously submitted protocol implementation y= ou actually allocate/free memory and copy the buffer in the set routines. = For a high resolution screen/logo this could be an expensive operation. I would suggest that if BootLogo2 exists then maybe BootLogo can be ignored= ? if (!EFI_ERROR (Status)) { - BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWi= dth, LogoHeight); + if (BootLogo !=3D NULL) { + BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, Logo= Width, LogoHeight); + } + if (BootLogo2 !=3D NULL) { + BootLogo2->SetBootLogo (BootLogo2, LogoBlt, LogoDestX, LogoDestY, Lo= goWidth, LogoHeight); + } } Thanks Sean ________________________________ From: Kinney, Michael D > Sent: Tuesday, February 13, 2018 6:07 PM To: edk2-devel@lists.01.org Cc: Sean Brogan; Bret Barkelew; Jiewen Yao; Star Zeng; Eric Dong; Michael D= Kinney Subject: [Patch 3/3] MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol https://na01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzilla= .tianocore.org%2Fshow_bug.cgi%3Fid%3D799&data=3D04%7C01%7Csean.brogan%40mic= rosoft.com%7Cb3a0f58079524830920308d5734fb3d2%7C72f988bf86f141af91ab2d7cd01= 1db47%7C1%7C0%7C636541708515157356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw= MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=3Dp7ewroezUhc94MuBj= A%2Fo9GziZ5wSpS9Yb876GKyzvuY%3D&reserved=3D0 Based on content from the following branch/commit: https://na01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.c= om%2FMicrosoft%2FMS_UEFI%2Ftree%2Fshare%2FMsCapsuleSupport&data=3D04%7C01%7= Csean.brogan%40microsoft.com%7Cb3a0f58079524830920308d5734fb3d2%7C72f988bf8= 6f141af91ab2d7cd011db47%7C1%7C0%7C636541708515157356%7CUnknown%7CTWFpbGZsb3= d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata= =3DByXtODKvhwrOV3mkK5MnCXLzYwFy9tKyIr16FRkDmB0%3D&reserved=3D0 https://na01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.c= om%2FMicrosoft%2FMS_UEFI%2Fcommit%2F33bab4031a417d7d5a7d356c15a14c2e60302b2= d&data=3D04%7C01%7Csean.brogan%40microsoft.com%7Cb3a0f58079524830920308d573= 4fb3d2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636541708515157356%7CUn= known%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%= 3D%3D%7C-1&sdata=3DTWY5Okohr1%2FbJ1Wpyx12QF4ZgRikfvuCk%2FE6B3DT9sM%3D&reser= ved=3D0 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 > --- MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 18 +++++++++++++++++- MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/= Library/BootLogoLib/BootLogoLib.c index 8bd9985cb2..9872f7eeea 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 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 @@ -26,6 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include #include #include +#include /** Show LOGO returned from Edkii Platform Logo protocol on all consoles. @@ -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; } + // + // 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 // @@ -330,7 +341,12 @@ BootLogoEnableLogo ( } if (!EFI_ERROR (Status)) { - BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWi= dth, LogoHeight); + if (BootLogo !=3D NULL) { + BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, Logo= Width, LogoHeight); + } + if (BootLogo2 !=3D NULL) { + BootLogo2->SetBootLogo (BootLogo2, LogoBlt, LogoDestX, LogoDestY, Lo= goWidth, LogoHeight); + } } FreePool (LogoBlt); 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. # # 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 + gEdkiiBootLogo2ProtocolGuid ## SOMETIMES_CONSUMES gEfiUserManagerProtocolGuid ## CONSUMES gEdkiiPlatformLogoProtocolGuid ## CONSUMES -- 2.14.2.windows.3