From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.42.134; helo=nam03-by2-obe.outbound.protection.outlook.com; envelope-from=sean.brogan@microsoft.com; receiver=edk2-devel@lists.01.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0134.outbound.protection.outlook.com [104.47.42.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7F0CB21CF1CE5 for ; Tue, 13 Feb 2018 19:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y9e8i8yTsdrxtpunKS5H37Pgf2jKd5aXExrjNqg3ywg=; b=gd2Wtfsx+ZzUq4J6RLlnumyPxGvqelE+2L1lWDs3Mn6eXfviQX2S6mK9s6udRgMbKy4gGfgcT9h+Babjvzn9NxE67f7G6QqX1/ew/Ho4raWWODDJSlL3inMXBjSE7b9C9LjoMFdktfgvIvXJ1y7choE0bsGwrZ2FOg/6q8ILwng= Received: from MWHPR21MB0480.namprd21.prod.outlook.com (10.172.102.19) by MWHPR21MB0175.namprd21.prod.outlook.com (10.173.52.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.527.2; Wed, 14 Feb 2018 03:20:44 +0000 Received: from MWHPR21MB0480.namprd21.prod.outlook.com ([10.172.102.19]) by MWHPR21MB0480.namprd21.prod.outlook.com ([10.172.102.19]) with mapi id 15.20.0527.006; Wed, 14 Feb 2018 03:20:42 +0000 From: Sean Brogan To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: Bret Barkelew , Jiewen Yao , Star Zeng , Eric Dong Thread-Topic: [Patch 3/3] MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol Thread-Index: AQHTpTiSsO1/qLNh3EK+APLwXQAXFKOjNcmH Date: Wed, 14 Feb 2018 03:20:41 +0000 Message-ID: References: <20180214020722.5412-1-michael.d.kinney@intel.com>, <20180214020722.5412-4-michael.d.kinney@intel.com> In-Reply-To: <20180214020722.5412-4-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [131.107.32.41] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR21MB0175; 7:UjDmcOlzE2LESkyknYMydAtVso/Y3SclmABxaSjMVDWE1wnRwB2kwAFiTkWVto/tjiXmGadLUYGgQ7y99RwKoPXHUL/pspfNHIM71M0gZmVXAGnaLcktKb1v0nJ57bPghXwkvBs0eS+hav+k/xeoADl5H9IxrC3ei1A6/asBZvWgs038NXcB+U8GFIT+pU33tWDfxZP899iTeHr7KSfrUdl1+uTx4EkBOhttohd6OZGoWEhm0xmFo++LYdHv5Dtd x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-o365ent-eop-header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY) x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(396003)(39380400002)(39860400002)(376002)(346002)(366004)(199004)(189003)(5660300001)(26005)(77096007)(99286004)(33656002)(8936002)(81166006)(105003)(81156014)(186003)(8676002)(86362001)(575784001)(7696005)(86612001)(105586002)(6436002)(6346003)(2501003)(102836004)(3660700001)(97736004)(106356001)(68736007)(4326008)(229853002)(66066001)(3846002)(6116002)(110136005)(54906003)(25786009)(2950100002)(22452003)(316002)(76176011)(966005)(14454004)(6246003)(10290500003)(19627405001)(478600001)(10090500001)(3280700002)(74316002)(2900100001)(606006)(7736002)(2906002)(54896002)(6306002)(59450400001)(53936002)(53546011)(9686003)(236005)(55016002)(8990500004)(6506007); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR21MB0175; H:MWHPR21MB0480.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 954e7932-ccee-40a2-94a4-08d57359ede3 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:MWHPR21MB0175; x-ms-traffictypediagnostic: MWHPR21MB0175: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(189930954265078)(162533806227266)(219752817060721)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001016)(61425038)(6040501)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231101)(944501161)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR21MB0175; BCL:0; PCL:0; RULEID:; SRVR:MWHPR21MB0175; x-forefront-prvs: 0583A86C08 received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=sean.brogan@microsoft.com; x-microsoft-antispam-message-info: xDcQWWVMCFETdIk/jCbHClCENRlKO+E0gPb3AWF42RkHYsa9DUXHiO+xpPZfcjHJVb05Q5HpHeHID322EyQ47w== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 954e7932-ccee-40a2-94a4-08d57359ede3 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2018 03:20:41.9798 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0175 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: Wed, 14 Feb 2018 03:14:56 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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