diff mbox

[edk2,11/13] ArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBoot

Message ID 1462476147-10404-12-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek May 5, 2016, 7:22 p.m. UTC
UefiBootManagerLib does not provide these functions, we have to implement
them. (EnableQuietBoot() puts up the nice TianoCore logo.)

OvmfPkg commits 817fb3ac2a78 and 8e8fd3037788 have extracted these
functions already,
- from "IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c"
- to "OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c".

Copy the latter file, with minimal changes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

---
 ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  7 +++++
 ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.h               | 29 ++++++++++++++++++++
 {OvmfPkg => ArmVirtPkg}/Library/PlatformBootManagerLib/QuietBoot.c   |  9 +++++-
 3 files changed, 44 insertions(+), 1 deletion(-)

-- 
1.8.3.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 28d546027d5e..2500ad9d6805 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -33,6 +33,7 @@  [Defines]
 [Sources]
   PlatformBm.c
   QemuKernel.c
+  QuietBoot.c
 
 [Packages]
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
@@ -46,6 +47,7 @@  [LibraryClasses]
   BaseMemoryLib
   DebugLib
   DevicePathLib
+  DxeServicesLib
   MemoryAllocationLib
   PcdLib
   PrintLib
@@ -56,6 +58,10 @@  [LibraryClasses]
   UefiLib
   UefiRuntimeServicesTableLib
 
+[FeaturePcd]
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable
+  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
+
 [FixedPcd]
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
@@ -79,5 +85,6 @@  [Protocols]
   gEfiDevicePathProtocolGuid
   gEfiGraphicsOutputProtocolGuid
   gEfiLoadedImageProtocolGuid
+  gEfiOEMBadgingProtocolGuid
   gEfiPciRootBridgeIoProtocolGuid
   gEfiSimpleFileSystemProtocolGuid
diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.h b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.h
index df1519c24175..22df65f73026 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.h
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.h
@@ -48,4 +48,33 @@  TryRunningQemuKernel (
   VOID
   );
 
+/**
+  Use SystemTable Conout to stop video based Simple Text Out consoles from
+  going to the video device. Put up LogoFile on every video device that is a
+  console.
+
+  @param[in]  LogoFile   File name of logo to display on the center of the
+                         screen.
+
+  @retval EFI_SUCCESS     ConsoleControl has been flipped to graphics and logo
+                          displayed.
+  @retval EFI_UNSUPPORTED Logo not found
+**/
+EFI_STATUS
+EnableQuietBoot (
+  IN  EFI_GUID  *LogoFile
+  );
+
+/**
+  Use SystemTable Conout to turn on video based Simple Text Out consoles. The
+  Simple Text Out screens will now be synced up with all non video output
+  devices
+
+  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.
+**/
+EFI_STATUS
+DisableQuietBoot (
+  VOID
+  );
+
 #endif // _PLATFORM_BM_H_
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c b/ArmVirtPkg/Library/PlatformBootManagerLib/QuietBoot.c
similarity index 95%
copy from OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c
copy to ArmVirtPkg/Library/PlatformBootManagerLib/QuietBoot.c
index 972050fa9cc7..687bda0e0480 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/QuietBoot.c
@@ -1,6 +1,7 @@ 
 /** @file
   Platform BDS function for quiet boot support.
 
+Copyright (C) 2016, Red Hat, Inc.
 Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
@@ -12,7 +13,13 @@  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
-#include "BdsPlatform.h"
+#include <IndustryStandard/Bmp.h>
+#include <Library/DxeServicesLib.h>
+#include <Protocol/BootLogo.h>
+#include <Protocol/OEMBadging.h>
+#include <Protocol/UgaDraw.h>
+
+#include "PlatformBm.h"
 
 /**
   Convert a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer