public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Sean Brogan <sean.brogan@microsoft.com>
To: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Star Zeng <star.zeng@intel.com>, Eric Dong <eric.dong@intel.com>
Subject: Re: [Patch 3/3] MdeModulePkg/BootLogoLib: Use Boot Logo 2 Protocol
Date: Wed, 14 Feb 2018 03:20:41 +0000	[thread overview]
Message-ID: <MWHPR21MB0480F838DCF8BF5A446BAC90E1F50@MWHPR21MB0480.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20180214020722.5412-4-michael.d.kinney@intel.com>

Mike,

Looking over the MdeModulePkg library changes it seems wasteful to call both protocols for Set.  In the previously submitted protocol implementation you 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, LogoWidth, LogoHeight);
+    if (BootLogo != NULL) {
+      BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);
+    }
+    if (BootLogo2 != NULL) {
+      BootLogo2->SetBootLogo (BootLogo2, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);
+    }
   }



Thanks

Sean


________________________________
From: Kinney, Michael D <michael.d.kinney@intel.com>
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=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D799&data=04%7C01%7Csean.brogan%40microsoft.com%7Cb3a0f58079524830920308d5734fb3d2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636541708515157356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=p7ewroezUhc94MuBjA%2Fo9GziZ5wSpS9Yb876GKyzvuY%3D&reserved=0

Based on content from the following branch/commit:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FMS_UEFI%2Ftree%2Fshare%2FMsCapsuleSupport&data=04%7C01%7Csean.brogan%40microsoft.com%7Cb3a0f58079524830920308d5734fb3d2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636541708515157356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=ByXtODKvhwrOV3mkK5MnCXLzYwFy9tKyIr16FRkDmB0%3D&reserved=0
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FMS_UEFI%2Fcommit%2F33bab4031a417d7d5a7d356c15a14c2e60302b2d&data=04%7C01%7Csean.brogan%40microsoft.com%7Cb3a0f58079524830920308d5734fb3d2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636541708515157356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=TWY5Okohr1%2FbJ1Wpyx12QF4ZgRikfvuCk%2FE6B3DT9sM%3D&reserved=0

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 <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 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.<BR>
+Copyright (c) 2016, Microsoft Corporation<BR>
 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
@@ -26,6 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PcdLib.h>
 #include <Library/MemoryAllocationLib.h>
 #include <Library/DebugLib.h>
+#include <Protocol/BootLogo2.h>

 /**
   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 = 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
   //
@@ -330,7 +341,12 @@ BootLogoEnableLogo (
   }

   if (!EFI_ERROR (Status)) {
-    BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);
+    if (BootLogo != NULL) {
+      BootLogo->SetBootLogo (BootLogo, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);
+    }
+    if (BootLogo2 != NULL) {
+      BootLogo2->SetBootLogo (BootLogo2, LogoBlt, LogoDestX, LogoDestY, LogoWidth, LogoHeight);
+    }
   }
   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.<BR>
+#  Copyright (c) 2016, Microsoft Corporation<BR>
 #  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 @@ [Protocols]
   gEfiGraphicsOutputProtocolGuid                ## SOMETIMES_CONSUMES
   gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES
   gEfiBootLogoProtocolGuid                      ## SOMETIMES_CONSUMES
+  gEdkiiBootLogo2ProtocolGuid                   ## SOMETIMES_CONSUMES
   gEfiUserManagerProtocolGuid                   ## CONSUMES
   gEdkiiPlatformLogoProtocolGuid                ## CONSUMES

--
2.14.2.windows.3



  reply	other threads:[~2018-02-14  3:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14  2:07 [Patch 0/3] MdeModulePkg: Add Boot Logo 2 Protocol Kinney, Michael D
2018-02-14  2:07 ` [Patch 1/3] " Kinney, Michael D
2018-02-14  2:07 ` [Patch 2/3] MdeModulePkg/BootGraphicsResourceDxe: " Kinney, Michael D
2018-02-14  2:07 ` [Patch 3/3] MdeModulePkg/BootLogoLib: Use " Kinney, Michael D
2018-02-14  3:20   ` Sean Brogan [this message]
2018-02-15 22:52     ` Kinney, Michael D

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR21MB0480F838DCF8BF5A446BAC90E1F50@MWHPR21MB0480.namprd21.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox