summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Acpi
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2018-01-02 08:46:58 -0800
committerMichael D Kinney <michael.d.kinney@intel.com>2018-02-28 11:58:27 -0800
commit7777360637d590d694cb805c5edfb930ff7379d0 (patch)
tree64c18f7a7f0752fcd0521a972d95d4257f992aa9 /MdeModulePkg/Universal/Acpi
parentb7c7ec8c178d4a6de7ee8d75be2cc505a72b56f6 (diff)
downloadedk2-7777360637d590d694cb805c5edfb930ff7379d0.tar.gz
edk2-7777360637d590d694cb805c5edfb930ff7379d0.tar.bz2
edk2-7777360637d590d694cb805c5edfb930ff7379d0.zip
MdeModulePkg/BootGraphicsResourceDxe: Add Boot Logo 2 Protocol
https://bugzilla.tianocore.org/show_bug.cgi?id=799 Based on content from the following branch/commit: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d 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 <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> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
Diffstat (limited to 'MdeModulePkg/Universal/Acpi')
-rw-r--r--MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c210
-rw-r--r--MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf2
2 files changed, 197 insertions, 15 deletions
diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
index 118fb4a922..cfd4be0ebf 100644
--- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
+++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.c
@@ -2,6 +2,7 @@
This module install ACPI Boot Graphics Resource Table (BGRT).
Copyright (c) 2011 - 2018, 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
which accompanies this distribution. The full text of the license may be found at
@@ -18,6 +19,7 @@
#include <Protocol/AcpiTable.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/BootLogo.h>
+#include <Protocol/BootLogo2.h>
#include <Guid/EventGroup.h>
@@ -33,20 +35,19 @@
/**
Update information of logo image drawn on screen.
- @param This The pointer to the Boot Logo protocol instance.
- @param BltBuffer The BLT buffer for logo drawn on screen. If BltBuffer
- 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 value.
- @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 instance.
+ @param[in] BltBuffer The BLT buffer for logo drawn on screen. If BltBuffer
+ 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 value.
+ @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
);
+/**
+ Update information of logo image drawn on screen.
+
+ @param[in] This The pointer to the Boot Logo protocol 2 instance.
+ @param[in] BltBuffer The BLT buffer for logo drawn on screen. If BltBuffer
+ 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 value.
+ @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 instance
+ @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 buffer
+ that was previously registered with SetBootLogo2().
+ @param[out] DestinationY Returns the Y start position of the GOP BLT buffer
+ that was previously registered with SetBootLogo2().
+ @param[out] Width Returns the width of the GOP BLT buffer
+ that was previously registered with SetBootLogo2().
+ @param[out] Height Returns the height of the GOP BLT buffer
+ that was previously registered with SetBootLogo2().
+
+ @retval EFI_SUCCESS The location of the boot logo was returned.
+ @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 = {
SetBootLogo
};
+///
+/// Boot Logo 2 Protocol instance
+///
+EDKII_BOOT_LOGO2_PROTOCOL mBootLogo2ProtocolTemplate = {
+ SetBootLogo2,
+ GetBootLogo2
+};
+
EFI_EVENT mBootGraphicsReadyToBootEvent;
UINTN mBootGraphicsResourceTableKey = 0;
BOOLEAN mIsLogoValid = FALSE;
@@ -138,6 +210,47 @@ SetBootLogo (
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 instance.
+ @param[in] BltBuffer The BLT buffer for logo drawn on screen. If BltBuffer
+ 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 value.
+ @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;
UINT32 Result32;
@@ -228,6 +341,71 @@ SetBootLogo (
}
/**
+ Get the location of the boot logo on the screen.
+
+ @param[in] This The pointer to the Boot Logo Protocol 2 instance
+ @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 buffer
+ that was previously registered with SetBootLogo2().
+ @param[out] DestinationY Returns the Y start position of the GOP BLT buffer
+ that was previously registered with SetBootLogo2().
+ @param[out] Width Returns the width of the GOP BLT buffer
+ that was previously registered with SetBootLogo2().
+ @param[out] Height Returns the height of the GOP BLT buffer
+ that was previously registered with SetBootLogo2().
+
+ @retval EFI_SUCCESS The location of the boot logo was returned.
+ @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 == NULL) {
+ DEBUG ((DEBUG_ERROR, "Request to get boot logo location before boot logo has been set.\n"));
+ return EFI_NOT_READY;
+ }
+
+ //
+ // Make sure none of the boot logo location parameters are NULL.
+ //
+ if (BltBuffer == NULL || DestinationX == NULL || DestinationY == NULL ||
+ Width == NULL || Height == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Boot logo is valid. Return values from module globals.
+ //
+ *BltBuffer = mLogoBltBuffer;
+ *DestinationX = mLogoDestX;
+ *DestinationY = mLogoDestY;
+ *Width = mLogoWidth;
+ *Height = mLogoHeight;
+
+ return EFI_SUCCESS;
+}
+
+/**
Notify function for event group EFI_EVENT_GROUP_READY_TO_BOOT. This is used to
install the Boot Graphics Resource Table.
@@ -401,12 +579,14 @@ BootGraphicsDxeEntryPoint (
Header->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
- // Install Boot Logo protocol.
+ // Install Boot Logo and Boot Logo 2 Protocols.
//
Status = gBS->InstallMultipleProtocolInterfaces (
&mBootLogoHandle,
&gEfiBootLogoProtocolGuid,
&mBootLogoProtocolTemplate,
+ &gEdkiiBootLogo2ProtocolGuid,
+ &mBootLogo2ProtocolTemplate,
NULL
);
ASSERT_EFI_ERROR (Status);
diff --git a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
index ff33405acd..bc1c10e981 100644
--- a/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
+++ b/MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
@@ -2,6 +2,7 @@
# This module install ACPI Boot Graphics Resource Table (BGRT).
#
# Copyright (c) 2011 - 2018, 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
# which accompanies this distribution. The full text of the license may be found at
@@ -49,6 +50,7 @@
[Protocols]
gEfiAcpiTableProtocolGuid ## CONSUMES
gEfiBootLogoProtocolGuid ## PRODUCES
+ gEdkiiBootLogo2ProtocolGuid ## PRODUCES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId ## CONSUMES