141UINTN mBootGraphicsResourceTableKey = 0;
142BOOLEAN mIsLogoValid =
FALSE;
147UINTN mLogoHeight = 0;
148BOOLEAN mAcpiBgrtInstalled =
FALSE;
149BOOLEAN mAcpiBgrtStatusChanged =
FALSE;
150BOOLEAN mAcpiBgrtBufferChanged =
FALSE;
171 EFI_ACPI_5_0_BGRT_STATUS_VALID,
252 if (BltBuffer ==
NULL) {
253 mIsLogoValid =
FALSE;
254 mAcpiBgrtStatusChanged =
TRUE;
261 if ((Width == 0) || (Height == 0)) {
262 return EFI_INVALID_PARAMETER;
270 if (EFI_ERROR (Status)) {
271 return EFI_INVALID_PARAMETER;
275 if (EFI_ERROR (Status)) {
276 return EFI_INVALID_PARAMETER;
280 if (EFI_ERROR (Status)) {
281 return EFI_INVALID_PARAMETER;
285 if (EFI_ERROR (Status)) {
286 return EFI_INVALID_PARAMETER;
298 if (EFI_ERROR (Status)) {
299 return EFI_UNSUPPORTED;
307 if (EFI_ERROR (Status)) {
308 return EFI_UNSUPPORTED;
314 mAcpiBgrtBufferChanged =
TRUE;
319 if (mLogoBltBuffer !=
NULL) {
321 mLogoBltBuffer =
NULL;
328 if (mLogoBltBuffer ==
NULL) {
329 return EFI_OUT_OF_RESOURCES;
332 mLogoDestX = DestinationX;
333 mLogoDestY = DestinationY;
335 mLogoHeight = Height;
381 if (mLogoBltBuffer ==
NULL) {
382 DEBUG ((DEBUG_ERROR,
"Request to get boot logo location before boot logo has been set.\n"));
383 return EFI_NOT_READY;
389 if ((BltBuffer ==
NULL) || (DestinationX ==
NULL) || (DestinationY ==
NULL) ||
390 (Width ==
NULL) || (Height ==
NULL))
392 return EFI_INVALID_PARAMETER;
398 *BltBuffer = mLogoBltBuffer;
399 *DestinationX = mLogoDestX;
400 *DestinationY = mLogoDestY;
402 *Height = mLogoHeight;
430 Status =
gBS->LocateProtocol (
431 &gEfiAcpiTableProtocolGuid,
433 (VOID **)&AcpiTableProtocol
435 if (EFI_ERROR (Status)) {
442 if (mAcpiBgrtInstalled) {
443 if (!mAcpiBgrtStatusChanged && !mAcpiBgrtBufferChanged) {
452 Status = AcpiTableProtocol->UninstallAcpiTable (
454 mBootGraphicsResourceTableKey
456 if (EFI_ERROR (Status)) {
464 if (mLogoBltBuffer ==
NULL) {
469 if (mAcpiBgrtBufferChanged) {
474 if (ImageBuffer !=
NULL) {
490 if (EFI_ERROR (Status)) {
498 mLogoBltBuffer =
NULL;
504 mBootGraphicsResourceTableTemplate.
ImageOffsetX = (UINT32)mLogoDestX;
505 mBootGraphicsResourceTableTemplate.
ImageOffsetY = (UINT32)mLogoDestY;
512 mBootGraphicsResourceTableTemplate.
Status = EFI_ACPI_5_0_BGRT_STATUS_VALID;
514 mBootGraphicsResourceTableTemplate.
Status = EFI_ACPI_5_0_BGRT_STATUS_INVALID;
520 mBootGraphicsResourceTableTemplate.Header.Checksum = 0;
521 mBootGraphicsResourceTableTemplate.Header.Checksum =
523 (UINT8 *)&mBootGraphicsResourceTableTemplate,
530 Status = AcpiTableProtocol->InstallAcpiTable (
532 &mBootGraphicsResourceTableTemplate,
534 &mBootGraphicsResourceTableKey
536 if (EFI_ERROR (Status)) {
540 mAcpiBgrtInstalled =
TRUE;
541 mAcpiBgrtStatusChanged =
FALSE;
542 mAcpiBgrtBufferChanged =
FALSE;
568 Header = &mBootGraphicsResourceTableTemplate.Header;
569 ZeroMem (Header->OemId, sizeof (Header->OemId));
573 MIN (
PcdGetSize (PcdAcpiDefaultOemId),
sizeof (Header->OemId))
576 Header->OemRevision =
PcdGet32 (PcdAcpiDefaultOemRevision);
577 Header->CreatorId =
PcdGet32 (PcdAcpiDefaultCreatorId);
578 Header->CreatorRevision =
PcdGet32 (PcdAcpiDefaultCreatorRevision);
583 Status =
gBS->InstallMultipleProtocolInterfaces (
585 &gEfiBootLogoProtocolGuid,
586 &mBootLogoProtocolTemplate,
587 &gEdkiiBootLogo2ProtocolGuid,
596 Status =
gBS->CreateEventEx (
601 &gEfiEventReadyToBootGuid,
602 &mBootGraphicsReadyToBootEvent
#define EFI_ACPI_5_0_BGRT_IMAGE_TYPE_BMP
#define EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE_SIGNATURE
#define EFI_ACPI_5_0_BGRT_VERSION
#define EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION
UINT8 EFIAPI CalculateCheckSum8(IN CONST UINT8 *Buffer, IN UINTN Length)
UINT64 EFIAPI WriteUnaligned64(OUT UINT64 *Buffer, IN UINT64 Value)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
RETURN_STATUS EFIAPI TranslateGopBltToBmp(IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GopBlt, IN UINT32 PixelHeight, IN UINT32 PixelWidth, IN OUT VOID **BmpImage, IN OUT UINT32 *BmpImageSize)
EFI_STATUS EFIAPI BootGraphicsDxeEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
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 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)
EFI_STATUS EFIAPI SetBootLogo(IN EFI_BOOT_LOGO_PROTOCOL *This, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height)
EDKII_BOOT_LOGO2_PROTOCOL mBootLogo2ProtocolTemplate
VOID EFIAPI BgrtReadyToBootEventNotify(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define PcdGetSize(TokenName)
#define PcdGet64(TokenName)
#define PcdGet32(TokenName)
#define PcdGetPtr(TokenName)
RETURN_STATUS EFIAPI SafeUintnMult(IN UINTN Multiplicand, IN UINTN Multiplier, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUintnToUint32(IN UINTN Operand, OUT UINT32 *Result)