2 BDS Lib functions which contain all the code to connect console device
4 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "InternalBdsLib.h"
13 Check if we need to save the EFI variable with "ConVarName" as name
15 If ConVarName is NULL, then ASSERT().
17 @param ConVarName The name of the EFI variable.
19 @retval TRUE Set the EFI variable as NV type.
20 @retval FALSE EFI variable as NV type can be set NonNV.
29 ASSERT (ConVarName
!= NULL
);
34 // If the variable includes "Dev" at last, we consider
35 // it does not support NV attribute.
37 while (*Ptr
!= L
'\0') {
41 if (((INTN
)((UINTN
)Ptr
- (UINTN
)ConVarName
) / sizeof (CHAR16
)) <= 3) {
45 if ((*(Ptr
- 3) == 'D') && (*(Ptr
- 2) == 'e') && (*(Ptr
- 1) == 'v')) {
53 Fill console handle in System Table if there are no valid console handle in.
55 Firstly, check the validation of console handle in System Table. If it is invalid,
56 update it by the first console device handle from EFI console variable.
58 @param VarName The name of the EFI console variable.
59 @param ConsoleGuid Specified Console protocol GUID.
60 @param ConsoleHandle On IN, console handle in System Table to be checked.
61 On OUT, new console handle in system table.
62 @param ProtocolInterface On IN, console protocol on console handle in System Table to be checked.
63 On OUT, new console protocol on new console handle in system table.
65 @retval TRUE System Table has been updated.
66 @retval FALSE System Table hasn't been updated.
70 UpdateSystemTableConsole (
72 IN EFI_GUID
*ConsoleGuid
,
73 IN OUT EFI_HANDLE
*ConsoleHandle
,
74 IN OUT VOID
**ProtocolInterface
79 EFI_DEVICE_PATH_PROTOCOL
*FullDevicePath
;
80 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
81 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
84 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*TextOut
;
86 ASSERT (VarName
!= NULL
);
87 ASSERT (ConsoleHandle
!= NULL
);
88 ASSERT (ConsoleGuid
!= NULL
);
89 ASSERT (ProtocolInterface
!= NULL
);
91 if (*ConsoleHandle
!= NULL
) {
92 Status
= gBS
->HandleProtocol (
97 if (Status
== EFI_SUCCESS
&& Interface
== *ProtocolInterface
) {
99 // If ConsoleHandle is valid and console protocol on this handle also
100 // also matched, just return.
107 // Get all possible consoles device path from EFI variable
109 VarConsole
= BdsLibGetVariableAndSize (
111 &gEfiGlobalVariableGuid
,
114 if (VarConsole
== NULL
) {
116 // If there is no any console device, just return.
121 FullDevicePath
= VarConsole
;
125 // Check every instance of the console variable
127 Instance
= GetNextDevicePathInstance (&VarConsole
, &DevicePathSize
);
128 if (Instance
== NULL
) {
129 FreePool (FullDevicePath
);
134 // Find console device handle by device path instance
136 Status
= gBS
->LocateDevicePath (
141 if (!EFI_ERROR (Status
)) {
143 // Get the console protocol on this console device handle
145 Status
= gBS
->HandleProtocol (
150 if (!EFI_ERROR (Status
)) {
152 // Update new console handle in System Table.
154 *ConsoleHandle
= NewHandle
;
155 *ProtocolInterface
= Interface
;
156 if (CompareGuid (ConsoleGuid
, &gEfiSimpleTextOutProtocolGuid
)) {
158 // If it is console out device, set console mode 80x25 if current mode is invalid.
160 TextOut
= (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*) Interface
;
161 if (TextOut
->Mode
->Mode
== -1) {
162 TextOut
->SetMode (TextOut
, 0);
169 } while (Instance
!= NULL
);
172 // No any available console devcie found.
178 This function update console variable based on ConVarName, it can
179 add or remove one specific console device path from the variable
181 @param ConVarName Console related variable name, ConIn, ConOut,
183 @param CustomizedConDevicePath The console device path which will be added to
184 the console variable ConVarName, this parameter
185 can not be multi-instance.
186 @param ExclusiveDevicePath The console device path which will be removed
187 from the console variable ConVarName, this
188 parameter can not be multi-instance.
190 @retval EFI_UNSUPPORTED The added device path is same to the removed one.
191 @retval EFI_SUCCESS Success add or remove the device path from the
197 BdsLibUpdateConsoleVariable (
198 IN CHAR16
*ConVarName
,
199 IN EFI_DEVICE_PATH_PROTOCOL
*CustomizedConDevicePath
,
200 IN EFI_DEVICE_PATH_PROTOCOL
*ExclusiveDevicePath
204 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
205 UINTN DevicePathSize
;
206 EFI_DEVICE_PATH_PROTOCOL
*NewDevicePath
;
207 EFI_DEVICE_PATH_PROTOCOL
*TempNewDevicePath
;
214 // Notes: check the device path point, here should check
215 // with compare memory
217 if (CustomizedConDevicePath
== ExclusiveDevicePath
) {
218 return EFI_UNSUPPORTED
;
221 // Delete the ExclusiveDevicePath from current default console
223 VarConsole
= BdsLibGetVariableAndSize (
225 &gEfiGlobalVariableGuid
,
230 // Initialize NewDevicePath
232 NewDevicePath
= VarConsole
;
235 // If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.
236 // In the end, NewDevicePath is the final device path.
238 if (ExclusiveDevicePath
!= NULL
&& VarConsole
!= NULL
) {
239 NewDevicePath
= BdsLibDelPartMatchInstance (VarConsole
, ExclusiveDevicePath
);
242 // Try to append customized device path to NewDevicePath.
244 if (CustomizedConDevicePath
!= NULL
) {
245 if (!BdsLibMatchDevicePaths (NewDevicePath
, CustomizedConDevicePath
)) {
247 // Check if there is part of CustomizedConDevicePath in NewDevicePath, delete it.
249 NewDevicePath
= BdsLibDelPartMatchInstance (NewDevicePath
, CustomizedConDevicePath
);
251 // In the first check, the default console variable will be _ModuleEntryPoint,
252 // just append current customized device path
254 TempNewDevicePath
= NewDevicePath
;
255 NewDevicePath
= AppendDevicePathInstance (NewDevicePath
, CustomizedConDevicePath
);
256 if (TempNewDevicePath
!= NULL
) {
257 FreePool(TempNewDevicePath
);
263 // The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV.
265 if (IsNvNeed(ConVarName
)) {
267 // ConVarName has NV attribute.
269 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
| EFI_VARIABLE_NON_VOLATILE
;
272 // ConVarName does not have NV attribute.
274 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
;
278 // Finally, Update the variable of the default console by NewDevicePath
280 DevicePathSize
= GetDevicePathSize (NewDevicePath
);
281 Status
= SetVariableAndReportStatusCodeOnError (
283 &gEfiGlobalVariableGuid
,
288 if ((DevicePathSize
== 0) && (Status
== EFI_NOT_FOUND
)) {
289 Status
= EFI_SUCCESS
;
292 if (VarConsole
== NewDevicePath
) {
293 if (VarConsole
!= NULL
) {
294 FreePool(VarConsole
);
297 if (VarConsole
!= NULL
) {
298 FreePool(VarConsole
);
300 if (NewDevicePath
!= NULL
) {
301 FreePool(NewDevicePath
);
311 Connect the console device base on the variable ConVarName, if
312 device path of the ConVarName is multi-instance device path and
313 anyone of the instances is connected success, then this function
315 If the handle associate with one device path node can not
316 be created successfully, then still give chance to do the dispatch,
317 which load the missing drivers if possible..
319 @param ConVarName Console related variable name, ConIn, ConOut,
322 @retval EFI_NOT_FOUND There is not any console devices connected
324 @retval EFI_SUCCESS Success connect any one instance of the console
325 device path base on the variable ConVarName.
330 BdsLibConnectConsoleVariable (
331 IN CHAR16
*ConVarName
335 EFI_DEVICE_PATH_PROTOCOL
*StartDevicePath
;
337 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
338 EFI_DEVICE_PATH_PROTOCOL
*Next
;
339 EFI_DEVICE_PATH_PROTOCOL
*CopyOfDevicePath
;
343 Status
= EFI_SUCCESS
;
347 // Check if the console variable exist
349 StartDevicePath
= BdsLibGetVariableAndSize (
351 &gEfiGlobalVariableGuid
,
354 if (StartDevicePath
== NULL
) {
355 return EFI_UNSUPPORTED
;
358 CopyOfDevicePath
= StartDevicePath
;
361 // Check every instance of the console variable
363 Instance
= GetNextDevicePathInstance (&CopyOfDevicePath
, &Size
);
364 if (Instance
== NULL
) {
365 FreePool (StartDevicePath
);
366 return EFI_UNSUPPORTED
;
370 while (!IsDevicePathEndType (Next
)) {
371 Next
= NextDevicePathNode (Next
);
374 SetDevicePathEndNode (Next
);
376 // Connect the USB console
377 // USB console device path is a short-form device path that
378 // starts with the first element being a USB WWID
379 // or a USB Class device path
381 if ((DevicePathType (Instance
) == MESSAGING_DEVICE_PATH
) &&
382 ((DevicePathSubType (Instance
) == MSG_USB_CLASS_DP
)
383 || (DevicePathSubType (Instance
) == MSG_USB_WWID_DP
)
385 Status
= BdsLibConnectUsbDevByShortFormDP (0xFF, Instance
);
386 if (!EFI_ERROR (Status
)) {
391 // Connect the instance device path
393 Status
= BdsLibConnectDevicePath (Instance
);
395 if (EFI_ERROR (Status
)) {
397 // Delete the instance from the console varialbe
399 BdsLibUpdateConsoleVariable (ConVarName
, NULL
, Instance
);
405 } while (CopyOfDevicePath
!= NULL
);
407 FreePool (StartDevicePath
);
410 return EFI_NOT_FOUND
;
417 This function will search every simpletext device in current system,
418 and make every simpletext device as pertantial console device.
423 BdsLibConnectAllConsoles (
428 EFI_DEVICE_PATH_PROTOCOL
*ConDevicePath
;
430 EFI_HANDLE
*HandleBuffer
;
435 ConDevicePath
= NULL
;
438 // Update all the console variables
440 gBS
->LocateHandleBuffer (
442 &gEfiSimpleTextInProtocolGuid
,
448 for (Index
= 0; Index
< HandleCount
; Index
++) {
449 gBS
->HandleProtocol (
451 &gEfiDevicePathProtocolGuid
,
452 (VOID
**) &ConDevicePath
454 BdsLibUpdateConsoleVariable (L
"ConIn", ConDevicePath
, NULL
);
457 if (HandleBuffer
!= NULL
) {
458 FreePool(HandleBuffer
);
462 gBS
->LocateHandleBuffer (
464 &gEfiSimpleTextOutProtocolGuid
,
469 for (Index
= 0; Index
< HandleCount
; Index
++) {
470 gBS
->HandleProtocol (
472 &gEfiDevicePathProtocolGuid
,
473 (VOID
**) &ConDevicePath
475 BdsLibUpdateConsoleVariable (L
"ConOut", ConDevicePath
, NULL
);
476 BdsLibUpdateConsoleVariable (L
"ErrOut", ConDevicePath
, NULL
);
479 if (HandleBuffer
!= NULL
) {
480 FreePool(HandleBuffer
);
484 // Connect all console variables
486 BdsLibConnectAllDefaultConsoles ();
491 This function will connect console device base on the console
492 device variable ConIn, ConOut and ErrOut.
494 @retval EFI_SUCCESS At least one of the ConIn and ConOut device have
495 been connected success.
496 @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
501 BdsLibConnectAllDefaultConsoles (
506 BOOLEAN SystemTableUpdated
;
509 // Connect all default console variables
513 // It seems impossible not to have any ConOut device on platform,
514 // so we check the status here.
516 Status
= BdsLibConnectConsoleVariable (L
"ConOut");
517 if (EFI_ERROR (Status
)) {
522 // Insert the performance probe for Console Out
524 PERF_START (NULL
, "ConOut", "BDS", 1);
525 PERF_END (NULL
, "ConOut", "BDS", 0);
528 // Because possibly the platform is legacy free, in such case,
529 // ConIn devices (Serial Port and PS2 Keyboard ) does not exist,
530 // so we need not check the status.
532 BdsLibConnectConsoleVariable (L
"ConIn");
535 // The _ModuleEntryPoint err out var is legal.
537 BdsLibConnectConsoleVariable (L
"ErrOut");
539 SystemTableUpdated
= FALSE
;
541 // Fill console handles in System Table if no console device assignd.
543 if (UpdateSystemTableConsole (L
"ConIn", &gEfiSimpleTextInProtocolGuid
, &gST
->ConsoleInHandle
, (VOID
**) &gST
->ConIn
)) {
544 SystemTableUpdated
= TRUE
;
546 if (UpdateSystemTableConsole (L
"ConOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->ConsoleOutHandle
, (VOID
**) &gST
->ConOut
)) {
547 SystemTableUpdated
= TRUE
;
549 if (UpdateSystemTableConsole (L
"ErrOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->StandardErrorHandle
, (VOID
**) &gST
->StdErr
)) {
550 SystemTableUpdated
= TRUE
;
553 if (SystemTableUpdated
) {
555 // Update the CRC32 in the EFI System Table header
558 gBS
->CalculateCrc32 (
566 // If any component set PcdTestKeyUsed to TRUE because use of a test key
567 // was detected, then display a warning message on the debug log and the console
569 if (PcdGetBool (PcdTestKeyUsed
) == TRUE
) {
570 DEBUG ((DEBUG_ERROR
, "**********************************\n"));
571 DEBUG ((DEBUG_ERROR
, "** WARNING: Test Key is used. **\n"));
572 DEBUG ((DEBUG_ERROR
, "**********************************\n"));
573 Print (L
"** WARNING: Test Key is used. **\n");
581 This function will connect console device except ConIn base on the console
582 device variable ConOut and ErrOut.
584 @retval EFI_SUCCESS At least one of the ConOut device have
585 been connected success.
586 @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
591 BdsLibConnectAllDefaultConsolesWithOutConIn (
596 BOOLEAN SystemTableUpdated
;
599 // Connect all default console variables except ConIn
603 // It seems impossible not to have any ConOut device on platform,
604 // so we check the status here.
606 Status
= BdsLibConnectConsoleVariable (L
"ConOut");
607 if (EFI_ERROR (Status
)) {
612 // Insert the performance probe for Console Out
614 PERF_START (NULL
, "ConOut", "BDS", 1);
615 PERF_END (NULL
, "ConOut", "BDS", 0);
618 // The _ModuleEntryPoint err out var is legal.
620 BdsLibConnectConsoleVariable (L
"ErrOut");
622 SystemTableUpdated
= FALSE
;
624 // Fill console handles in System Table if no console device assignd.
626 if (UpdateSystemTableConsole (L
"ConOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->ConsoleOutHandle
, (VOID
**) &gST
->ConOut
)) {
627 SystemTableUpdated
= TRUE
;
629 if (UpdateSystemTableConsole (L
"ErrOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->StandardErrorHandle
, (VOID
**) &gST
->StdErr
)) {
630 SystemTableUpdated
= TRUE
;
633 if (SystemTableUpdated
) {
635 // Update the CRC32 in the EFI System Table header
638 gBS
->CalculateCrc32 (
650 Use SystemTable Conout to stop video based Simple Text Out consoles from going
651 to the video device. Put up LogoFile on every video device that is a console.
653 @param[in] LogoFile File name of logo to display on the center of the screen.
655 @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.
656 @retval EFI_UNSUPPORTED Logo not found
662 IN EFI_GUID
*LogoFile
666 EFI_OEM_BADGING_PROTOCOL
*Badging
;
675 EFI_BADGING_FORMAT Format
;
676 EFI_BADGING_DISPLAY_ATTRIBUTE Attribute
;
681 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Blt
;
682 EFI_UGA_DRAW_PROTOCOL
*UgaDraw
;
685 EFI_GRAPHICS_OUTPUT_PROTOCOL
*GraphicsOutput
;
686 EFI_BOOT_LOGO_PROTOCOL
*BootLogo
;
688 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*LogoBlt
;
701 // Try to open GOP first
703 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiGraphicsOutputProtocolGuid
, (VOID
**) &GraphicsOutput
);
704 if (EFI_ERROR (Status
) && FeaturePcdGet (PcdUgaConsumeSupport
)) {
705 GraphicsOutput
= NULL
;
707 // Open GOP failed, try to open UGA
709 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiUgaDrawProtocolGuid
, (VOID
**) &UgaDraw
);
711 if (EFI_ERROR (Status
)) {
712 return EFI_UNSUPPORTED
;
716 // Try to open Boot Logo Protocol.
719 gBS
->LocateProtocol (&gEfiBootLogoProtocolGuid
, NULL
, (VOID
**) &BootLogo
);
722 // Erase Cursor from screen
724 gST
->ConOut
->EnableCursor (gST
->ConOut
, FALSE
);
727 Status
= gBS
->LocateProtocol (&gEfiOEMBadgingProtocolGuid
, NULL
, (VOID
**) &Badging
);
729 if (GraphicsOutput
!= NULL
) {
730 SizeOfX
= GraphicsOutput
->Mode
->Info
->HorizontalResolution
;
731 SizeOfY
= GraphicsOutput
->Mode
->Info
->VerticalResolution
;
733 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
734 Status
= UgaDraw
->GetMode (UgaDraw
, &SizeOfX
, &SizeOfY
, &ColorDepth
, &RefreshRate
);
735 if (EFI_ERROR (Status
)) {
736 return EFI_UNSUPPORTED
;
739 return EFI_UNSUPPORTED
;
757 if (Badging
!= NULL
) {
759 // Get image from OEMBadging protocol.
761 Status
= Badging
->GetImage (
771 if (EFI_ERROR (Status
)) {
776 // Currently only support BMP format.
778 if (Format
!= EfiBadgingFormatBMP
) {
779 if (ImageData
!= NULL
) {
780 FreePool (ImageData
);
786 // Get the specified image from FV.
788 Status
= GetSectionFromAnyFv (LogoFile
, EFI_SECTION_RAW
, 0, (VOID
**) &ImageData
, &ImageSize
);
789 if (EFI_ERROR (Status
)) {
790 return EFI_UNSUPPORTED
;
795 if (!FeaturePcdGet(PcdBootlogoOnlyEnable
)) {
796 Attribute
= EfiBadgingDisplayAttributeCenter
;
798 Attribute
= EfiBadgingDisplayAttributeCustomized
;
806 Status
= TranslateBmpToGopBlt (
814 if (EFI_ERROR (Status
)) {
815 FreePool (ImageData
);
817 if (Badging
== NULL
) {
825 // Calculate the display position according to Attribute.
828 case EfiBadgingDisplayAttributeLeftTop
:
833 case EfiBadgingDisplayAttributeCenterTop
:
834 DestX
= (SizeOfX
- Width
) / 2;
838 case EfiBadgingDisplayAttributeRightTop
:
839 DestX
= (SizeOfX
- Width
- CoordinateX
);
840 DestY
= CoordinateY
;;
843 case EfiBadgingDisplayAttributeCenterRight
:
844 DestX
= (SizeOfX
- Width
- CoordinateX
);
845 DestY
= (SizeOfY
- Height
) / 2;
848 case EfiBadgingDisplayAttributeRightBottom
:
849 DestX
= (SizeOfX
- Width
- CoordinateX
);
850 DestY
= (SizeOfY
- Height
- CoordinateY
);
853 case EfiBadgingDisplayAttributeCenterBottom
:
854 DestX
= (SizeOfX
- Width
) / 2;
855 DestY
= (SizeOfY
- Height
- CoordinateY
);
858 case EfiBadgingDisplayAttributeLeftBottom
:
860 DestY
= (SizeOfY
- Height
- CoordinateY
);
863 case EfiBadgingDisplayAttributeCenterLeft
:
865 DestY
= (SizeOfY
- Height
) / 2;
868 case EfiBadgingDisplayAttributeCenter
:
869 DestX
= (SizeOfX
- Width
) / 2;
870 DestY
= (SizeOfY
- Height
) / 2;
873 case EfiBadgingDisplayAttributeCustomized
:
874 DestX
= (SizeOfX
- Width
) / 2;
875 DestY
= ((SizeOfY
* 382) / 1000) - Height
/ 2;
884 if ((DestX
>= 0) && (DestY
>= 0)) {
885 if (GraphicsOutput
!= NULL
) {
886 Status
= GraphicsOutput
->Blt (
896 Width
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
898 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
899 Status
= UgaDraw
->Blt (
901 (EFI_UGA_PIXEL
*) Blt
,
902 EfiUgaBltBufferToVideo
,
909 Width
* sizeof (EFI_UGA_PIXEL
)
912 Status
= EFI_UNSUPPORTED
;
916 // Report displayed Logo information.
918 if (!EFI_ERROR (Status
)) {
921 if (LogoWidth
== 0) {
925 LogoDestX
= (UINTN
) DestX
;
926 LogoDestY
= (UINTN
) DestY
;
931 // Merge new logo with old one.
933 NewDestX
= MIN ((UINTN
) DestX
, LogoDestX
);
934 NewDestY
= MIN ((UINTN
) DestY
, LogoDestY
);
935 NewWidth
= MAX ((UINTN
) DestX
+ Width
, LogoDestX
+ LogoWidth
) - NewDestX
;
936 NewHeight
= MAX ((UINTN
) DestY
+ Height
, LogoDestY
+ LogoHeight
) - NewDestY
;
938 LogoDestX
= NewDestX
;
939 LogoDestY
= NewDestY
;
940 LogoWidth
= NewWidth
;
941 LogoHeight
= NewHeight
;
946 FreePool (ImageData
);
948 if (Badging
== NULL
) {
954 if (BootLogo
== NULL
|| NumberOfLogos
== 0) {
956 // No logo displayed.
966 // Advertise displayed Logo information.
968 if (NumberOfLogos
== 1) {
970 // Only one logo displayed, use its Blt buffer directly for BootLogo protocol.
973 Status
= EFI_SUCCESS
;
976 // More than one Logo displayed, get merged BltBuffer using VideoToBuffer operation.
983 // Ensure the LogoHeight * LogoWidth doesn't overflow
985 if (LogoHeight
> DivU64x64Remainder ((UINTN
) ~0, LogoWidth
, NULL
)) {
986 return EFI_UNSUPPORTED
;
988 BufferSize
= MultU64x64 (LogoWidth
, LogoHeight
);
991 // Ensure the BufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow
993 if (BufferSize
> DivU64x32 ((UINTN
) ~0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
))) {
994 return EFI_UNSUPPORTED
;
997 LogoBlt
= AllocateZeroPool ((UINTN
)BufferSize
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
998 if (LogoBlt
== NULL
) {
999 return EFI_OUT_OF_RESOURCES
;
1002 if (GraphicsOutput
!= NULL
) {
1003 Status
= GraphicsOutput
->Blt (
1006 EfiBltVideoToBltBuffer
,
1013 LogoWidth
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
1015 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
1016 Status
= UgaDraw
->Blt (
1018 (EFI_UGA_PIXEL
*) LogoBlt
,
1019 EfiUgaVideoToBltBuffer
,
1026 LogoWidth
* sizeof (EFI_UGA_PIXEL
)
1029 Status
= EFI_UNSUPPORTED
;
1033 if (!EFI_ERROR (Status
)) {
1034 BootLogo
->SetBootLogo (BootLogo
, LogoBlt
, LogoDestX
, LogoDestY
, LogoWidth
, LogoHeight
);
1042 Use SystemTable Conout to turn on video based Simple Text Out consoles. The
1043 Simple Text Out screens will now be synced up with all non video output devices
1045 @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
1056 // Enable Cursor on Screen
1058 gST
->ConOut
->EnableCursor (gST
->ConOut
, TRUE
);