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 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "InternalBdsLib.h"
19 Check if we need to save the EFI variable with "ConVarName" as name
21 If ConVarName is NULL, then ASSERT().
23 @param ConVarName The name of the EFI variable.
25 @retval TRUE Set the EFI variable as NV type.
26 @retval FALSE EFI variable as NV type can be set NonNV.
35 ASSERT (ConVarName
!= NULL
);
40 // If the variable includes "Dev" at last, we consider
41 // it does not support NV attribute.
43 while (*Ptr
!= L
'\0') {
47 if (((INTN
)((UINTN
)Ptr
- (UINTN
)ConVarName
) / sizeof (CHAR16
)) <= 3) {
51 if ((*(Ptr
- 3) == 'D') && (*(Ptr
- 2) == 'e') && (*(Ptr
- 1) == 'v')) {
59 Fill console handle in System Table if there are no valid console handle in.
61 Firstly, check the validation of console handle in System Table. If it is invalid,
62 update it by the first console device handle from EFI console variable.
64 @param VarName The name of the EFI console variable.
65 @param ConsoleGuid Specified Console protocol GUID.
66 @param ConsoleHandle On IN, console handle in System Table to be checked.
67 On OUT, new console handle in system table.
68 @param ProtocolInterface On IN, console protocol on console handle in System Table to be checked.
69 On OUT, new console protocol on new console handle in system table.
71 @retval TRUE System Table has been updated.
72 @retval FALSE System Table hasn't been updated.
76 UpdateSystemTableConsole (
78 IN EFI_GUID
*ConsoleGuid
,
79 IN OUT EFI_HANDLE
*ConsoleHandle
,
80 IN OUT VOID
**ProtocolInterface
85 EFI_DEVICE_PATH_PROTOCOL
*FullDevicePath
;
86 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
87 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
90 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*TextOut
;
92 ASSERT (VarName
!= NULL
);
93 ASSERT (ConsoleHandle
!= NULL
);
94 ASSERT (ConsoleGuid
!= NULL
);
95 ASSERT (ProtocolInterface
!= NULL
);
97 if (*ConsoleHandle
!= NULL
) {
98 Status
= gBS
->HandleProtocol (
103 if (Status
== EFI_SUCCESS
&& Interface
== *ProtocolInterface
) {
105 // If ConsoleHandle is valid and console protocol on this handle also
106 // also matched, just return.
113 // Get all possible consoles device path from EFI variable
115 VarConsole
= BdsLibGetVariableAndSize (
117 &gEfiGlobalVariableGuid
,
120 if (VarConsole
== NULL
) {
122 // If there is no any console device, just return.
127 FullDevicePath
= VarConsole
;
131 // Check every instance of the console variable
133 Instance
= GetNextDevicePathInstance (&VarConsole
, &DevicePathSize
);
134 if (Instance
== NULL
) {
135 FreePool (FullDevicePath
);
140 // Find console device handle by device path instance
142 Status
= gBS
->LocateDevicePath (
147 if (!EFI_ERROR (Status
)) {
149 // Get the console protocol on this console device handle
151 Status
= gBS
->HandleProtocol (
156 if (!EFI_ERROR (Status
)) {
158 // Update new console handle in System Table.
160 *ConsoleHandle
= NewHandle
;
161 *ProtocolInterface
= Interface
;
162 if (CompareGuid (ConsoleGuid
, &gEfiSimpleTextOutProtocolGuid
)) {
164 // If it is console out device, set console mode 80x25 if current mode is invalid.
166 TextOut
= (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*) Interface
;
167 if (TextOut
->Mode
->Mode
== -1) {
168 TextOut
->SetMode (TextOut
, 0);
175 } while (Instance
!= NULL
);
178 // No any available console devcie found.
184 This function update console variable based on ConVarName, it can
185 add or remove one specific console device path from the variable
187 @param ConVarName Console related variable name, ConIn, ConOut,
189 @param CustomizedConDevicePath The console device path which will be added to
190 the console variable ConVarName, this parameter
191 can not be multi-instance.
192 @param ExclusiveDevicePath The console device path which will be removed
193 from the console variable ConVarName, this
194 parameter can not be multi-instance.
196 @retval EFI_UNSUPPORTED The added device path is same to the removed one.
197 @retval EFI_SUCCESS Success add or remove the device path from the
203 BdsLibUpdateConsoleVariable (
204 IN CHAR16
*ConVarName
,
205 IN EFI_DEVICE_PATH_PROTOCOL
*CustomizedConDevicePath
,
206 IN EFI_DEVICE_PATH_PROTOCOL
*ExclusiveDevicePath
210 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
211 UINTN DevicePathSize
;
212 EFI_DEVICE_PATH_PROTOCOL
*NewDevicePath
;
213 EFI_DEVICE_PATH_PROTOCOL
*TempNewDevicePath
;
220 // Notes: check the device path point, here should check
221 // with compare memory
223 if (CustomizedConDevicePath
== ExclusiveDevicePath
) {
224 return EFI_UNSUPPORTED
;
227 // Delete the ExclusiveDevicePath from current default console
229 VarConsole
= BdsLibGetVariableAndSize (
231 &gEfiGlobalVariableGuid
,
236 // Initialize NewDevicePath
238 NewDevicePath
= VarConsole
;
241 // If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.
242 // In the end, NewDevicePath is the final device path.
244 if (ExclusiveDevicePath
!= NULL
&& VarConsole
!= NULL
) {
245 NewDevicePath
= BdsLibDelPartMatchInstance (VarConsole
, ExclusiveDevicePath
);
248 // Try to append customized device path to NewDevicePath.
250 if (CustomizedConDevicePath
!= NULL
) {
251 if (!BdsLibMatchDevicePaths (NewDevicePath
, CustomizedConDevicePath
)) {
253 // Check if there is part of CustomizedConDevicePath in NewDevicePath, delete it.
255 NewDevicePath
= BdsLibDelPartMatchInstance (NewDevicePath
, CustomizedConDevicePath
);
257 // In the first check, the default console variable will be _ModuleEntryPoint,
258 // just append current customized device path
260 TempNewDevicePath
= NewDevicePath
;
261 NewDevicePath
= AppendDevicePathInstance (NewDevicePath
, CustomizedConDevicePath
);
262 if (TempNewDevicePath
!= NULL
) {
263 FreePool(TempNewDevicePath
);
269 // The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV.
271 if (IsNvNeed(ConVarName
)) {
273 // ConVarName has NV attribute.
275 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
| EFI_VARIABLE_NON_VOLATILE
;
278 // ConVarName does not have NV attribute.
280 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
;
284 // Finally, Update the variable of the default console by NewDevicePath
286 DevicePathSize
= GetDevicePathSize (NewDevicePath
);
287 Status
= SetVariableAndReportStatusCodeOnError (
289 &gEfiGlobalVariableGuid
,
294 if ((DevicePathSize
== 0) && (Status
== EFI_NOT_FOUND
)) {
295 Status
= EFI_SUCCESS
;
298 if (VarConsole
== NewDevicePath
) {
299 if (VarConsole
!= NULL
) {
300 FreePool(VarConsole
);
303 if (VarConsole
!= NULL
) {
304 FreePool(VarConsole
);
306 if (NewDevicePath
!= NULL
) {
307 FreePool(NewDevicePath
);
317 Connect the console device base on the variable ConVarName, if
318 device path of the ConVarName is multi-instance device path and
319 anyone of the instances is connected success, then this function
321 If the handle associate with one device path node can not
322 be created successfully, then still give chance to do the dispatch,
323 which load the missing drivers if possible..
325 @param ConVarName Console related variable name, ConIn, ConOut,
328 @retval EFI_NOT_FOUND There is not any console devices connected
330 @retval EFI_SUCCESS Success connect any one instance of the console
331 device path base on the variable ConVarName.
336 BdsLibConnectConsoleVariable (
337 IN CHAR16
*ConVarName
341 EFI_DEVICE_PATH_PROTOCOL
*StartDevicePath
;
343 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
344 EFI_DEVICE_PATH_PROTOCOL
*Next
;
345 EFI_DEVICE_PATH_PROTOCOL
*CopyOfDevicePath
;
349 Status
= EFI_SUCCESS
;
353 // Check if the console variable exist
355 StartDevicePath
= BdsLibGetVariableAndSize (
357 &gEfiGlobalVariableGuid
,
360 if (StartDevicePath
== NULL
) {
361 return EFI_UNSUPPORTED
;
364 CopyOfDevicePath
= StartDevicePath
;
367 // Check every instance of the console variable
369 Instance
= GetNextDevicePathInstance (&CopyOfDevicePath
, &Size
);
370 if (Instance
== NULL
) {
371 FreePool (StartDevicePath
);
372 return EFI_UNSUPPORTED
;
376 while (!IsDevicePathEndType (Next
)) {
377 Next
= NextDevicePathNode (Next
);
380 SetDevicePathEndNode (Next
);
382 // Connect the USB console
383 // USB console device path is a short-form device path that
384 // starts with the first element being a USB WWID
385 // or a USB Class device path
387 if ((DevicePathType (Instance
) == MESSAGING_DEVICE_PATH
) &&
388 ((DevicePathSubType (Instance
) == MSG_USB_CLASS_DP
)
389 || (DevicePathSubType (Instance
) == MSG_USB_WWID_DP
)
391 Status
= BdsLibConnectUsbDevByShortFormDP (0xFF, Instance
);
392 if (!EFI_ERROR (Status
)) {
397 // Connect the instance device path
399 Status
= BdsLibConnectDevicePath (Instance
);
401 if (EFI_ERROR (Status
)) {
403 // Delete the instance from the console varialbe
405 BdsLibUpdateConsoleVariable (ConVarName
, NULL
, Instance
);
411 } while (CopyOfDevicePath
!= NULL
);
413 FreePool (StartDevicePath
);
416 return EFI_NOT_FOUND
;
423 This function will search every simpletext device in current system,
424 and make every simpletext device as pertantial console device.
429 BdsLibConnectAllConsoles (
434 EFI_DEVICE_PATH_PROTOCOL
*ConDevicePath
;
436 EFI_HANDLE
*HandleBuffer
;
441 ConDevicePath
= NULL
;
444 // Update all the console variables
446 gBS
->LocateHandleBuffer (
448 &gEfiSimpleTextInProtocolGuid
,
454 for (Index
= 0; Index
< HandleCount
; Index
++) {
455 gBS
->HandleProtocol (
457 &gEfiDevicePathProtocolGuid
,
458 (VOID
**) &ConDevicePath
460 BdsLibUpdateConsoleVariable (L
"ConIn", ConDevicePath
, NULL
);
463 if (HandleBuffer
!= NULL
) {
464 FreePool(HandleBuffer
);
468 gBS
->LocateHandleBuffer (
470 &gEfiSimpleTextOutProtocolGuid
,
475 for (Index
= 0; Index
< HandleCount
; Index
++) {
476 gBS
->HandleProtocol (
478 &gEfiDevicePathProtocolGuid
,
479 (VOID
**) &ConDevicePath
481 BdsLibUpdateConsoleVariable (L
"ConOut", ConDevicePath
, NULL
);
482 BdsLibUpdateConsoleVariable (L
"ErrOut", ConDevicePath
, NULL
);
485 if (HandleBuffer
!= NULL
) {
486 FreePool(HandleBuffer
);
490 // Connect all console variables
492 BdsLibConnectAllDefaultConsoles ();
497 This function will connect console device base on the console
498 device variable ConIn, ConOut and ErrOut.
500 @retval EFI_SUCCESS At least one of the ConIn and ConOut device have
501 been connected success.
502 @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
507 BdsLibConnectAllDefaultConsoles (
512 BOOLEAN SystemTableUpdated
;
515 // Connect all default console variables
519 // It seems impossible not to have any ConOut device on platform,
520 // so we check the status here.
522 Status
= BdsLibConnectConsoleVariable (L
"ConOut");
523 if (EFI_ERROR (Status
)) {
528 // Insert the performance probe for Console Out
530 PERF_START (NULL
, "ConOut", "BDS", 1);
531 PERF_END (NULL
, "ConOut", "BDS", 0);
534 // Because possibly the platform is legacy free, in such case,
535 // ConIn devices (Serial Port and PS2 Keyboard ) does not exist,
536 // so we need not check the status.
538 BdsLibConnectConsoleVariable (L
"ConIn");
541 // The _ModuleEntryPoint err out var is legal.
543 BdsLibConnectConsoleVariable (L
"ErrOut");
545 SystemTableUpdated
= FALSE
;
547 // Fill console handles in System Table if no console device assignd.
549 if (UpdateSystemTableConsole (L
"ConIn", &gEfiSimpleTextInProtocolGuid
, &gST
->ConsoleInHandle
, (VOID
**) &gST
->ConIn
)) {
550 SystemTableUpdated
= TRUE
;
552 if (UpdateSystemTableConsole (L
"ConOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->ConsoleOutHandle
, (VOID
**) &gST
->ConOut
)) {
553 SystemTableUpdated
= TRUE
;
555 if (UpdateSystemTableConsole (L
"ErrOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->StandardErrorHandle
, (VOID
**) &gST
->StdErr
)) {
556 SystemTableUpdated
= TRUE
;
559 if (SystemTableUpdated
) {
561 // Update the CRC32 in the EFI System Table header
564 gBS
->CalculateCrc32 (
576 This function will connect console device except ConIn base on the console
577 device variable ConOut and ErrOut.
579 @retval EFI_SUCCESS At least one of the ConOut device have
580 been connected success.
581 @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
586 BdsLibConnectAllDefaultConsolesWithOutConIn (
591 BOOLEAN SystemTableUpdated
;
594 // Connect all default console variables except ConIn
598 // It seems impossible not to have any ConOut device on platform,
599 // so we check the status here.
601 Status
= BdsLibConnectConsoleVariable (L
"ConOut");
602 if (EFI_ERROR (Status
)) {
607 // Insert the performance probe for Console Out
609 PERF_START (NULL
, "ConOut", "BDS", 1);
610 PERF_END (NULL
, "ConOut", "BDS", 0);
613 // The _ModuleEntryPoint err out var is legal.
615 BdsLibConnectConsoleVariable (L
"ErrOut");
617 SystemTableUpdated
= FALSE
;
619 // Fill console handles in System Table if no console device assignd.
621 if (UpdateSystemTableConsole (L
"ConOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->ConsoleOutHandle
, (VOID
**) &gST
->ConOut
)) {
622 SystemTableUpdated
= TRUE
;
624 if (UpdateSystemTableConsole (L
"ErrOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->StandardErrorHandle
, (VOID
**) &gST
->StdErr
)) {
625 SystemTableUpdated
= TRUE
;
628 if (SystemTableUpdated
) {
630 // Update the CRC32 in the EFI System Table header
633 gBS
->CalculateCrc32 (
645 Use SystemTable Conout to stop video based Simple Text Out consoles from going
646 to the video device. Put up LogoFile on every video device that is a console.
648 @param[in] LogoFile File name of logo to display on the center of the screen.
650 @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.
651 @retval EFI_UNSUPPORTED Logo not found
657 IN EFI_GUID
*LogoFile
661 EFI_OEM_BADGING_PROTOCOL
*Badging
;
670 EFI_BADGING_FORMAT Format
;
671 EFI_BADGING_DISPLAY_ATTRIBUTE Attribute
;
676 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Blt
;
677 EFI_UGA_DRAW_PROTOCOL
*UgaDraw
;
680 EFI_GRAPHICS_OUTPUT_PROTOCOL
*GraphicsOutput
;
681 EFI_BOOT_LOGO_PROTOCOL
*BootLogo
;
683 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*LogoBlt
;
696 // Try to open GOP first
698 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiGraphicsOutputProtocolGuid
, (VOID
**) &GraphicsOutput
);
699 if (EFI_ERROR (Status
) && FeaturePcdGet (PcdUgaConsumeSupport
)) {
700 GraphicsOutput
= NULL
;
702 // Open GOP failed, try to open UGA
704 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiUgaDrawProtocolGuid
, (VOID
**) &UgaDraw
);
706 if (EFI_ERROR (Status
)) {
707 return EFI_UNSUPPORTED
;
711 // Try to open Boot Logo Protocol.
714 gBS
->LocateProtocol (&gEfiBootLogoProtocolGuid
, NULL
, (VOID
**) &BootLogo
);
717 // Erase Cursor from screen
719 gST
->ConOut
->EnableCursor (gST
->ConOut
, FALSE
);
722 Status
= gBS
->LocateProtocol (&gEfiOEMBadgingProtocolGuid
, NULL
, (VOID
**) &Badging
);
724 if (GraphicsOutput
!= NULL
) {
725 SizeOfX
= GraphicsOutput
->Mode
->Info
->HorizontalResolution
;
726 SizeOfY
= GraphicsOutput
->Mode
->Info
->VerticalResolution
;
728 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
729 Status
= UgaDraw
->GetMode (UgaDraw
, &SizeOfX
, &SizeOfY
, &ColorDepth
, &RefreshRate
);
730 if (EFI_ERROR (Status
)) {
731 return EFI_UNSUPPORTED
;
734 return EFI_UNSUPPORTED
;
752 if (Badging
!= NULL
) {
754 // Get image from OEMBadging protocol.
756 Status
= Badging
->GetImage (
766 if (EFI_ERROR (Status
)) {
771 // Currently only support BMP format.
773 if (Format
!= EfiBadgingFormatBMP
) {
774 if (ImageData
!= NULL
) {
775 FreePool (ImageData
);
781 // Get the specified image from FV.
783 Status
= GetSectionFromAnyFv (LogoFile
, EFI_SECTION_RAW
, 0, (VOID
**) &ImageData
, &ImageSize
);
784 if (EFI_ERROR (Status
)) {
785 return EFI_UNSUPPORTED
;
790 if (!FeaturePcdGet(PcdBootlogoOnlyEnable
)) {
791 Attribute
= EfiBadgingDisplayAttributeCenter
;
793 Attribute
= EfiBadgingDisplayAttributeCustomized
;
801 Status
= TranslateBmpToGopBlt (
809 if (EFI_ERROR (Status
)) {
810 FreePool (ImageData
);
812 if (Badging
== NULL
) {
820 // Calculate the display position according to Attribute.
823 case EfiBadgingDisplayAttributeLeftTop
:
828 case EfiBadgingDisplayAttributeCenterTop
:
829 DestX
= (SizeOfX
- Width
) / 2;
833 case EfiBadgingDisplayAttributeRightTop
:
834 DestX
= (SizeOfX
- Width
- CoordinateX
);
835 DestY
= CoordinateY
;;
838 case EfiBadgingDisplayAttributeCenterRight
:
839 DestX
= (SizeOfX
- Width
- CoordinateX
);
840 DestY
= (SizeOfY
- Height
) / 2;
843 case EfiBadgingDisplayAttributeRightBottom
:
844 DestX
= (SizeOfX
- Width
- CoordinateX
);
845 DestY
= (SizeOfY
- Height
- CoordinateY
);
848 case EfiBadgingDisplayAttributeCenterBottom
:
849 DestX
= (SizeOfX
- Width
) / 2;
850 DestY
= (SizeOfY
- Height
- CoordinateY
);
853 case EfiBadgingDisplayAttributeLeftBottom
:
855 DestY
= (SizeOfY
- Height
- CoordinateY
);
858 case EfiBadgingDisplayAttributeCenterLeft
:
860 DestY
= (SizeOfY
- Height
) / 2;
863 case EfiBadgingDisplayAttributeCenter
:
864 DestX
= (SizeOfX
- Width
) / 2;
865 DestY
= (SizeOfY
- Height
) / 2;
868 case EfiBadgingDisplayAttributeCustomized
:
869 DestX
= (SizeOfX
- Width
) / 2;
870 DestY
= ((SizeOfY
* 382) / 1000) - Height
/ 2;
879 if ((DestX
>= 0) && (DestY
>= 0)) {
880 if (GraphicsOutput
!= NULL
) {
881 Status
= GraphicsOutput
->Blt (
891 Width
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
893 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
894 Status
= UgaDraw
->Blt (
896 (EFI_UGA_PIXEL
*) Blt
,
897 EfiUgaBltBufferToVideo
,
904 Width
* sizeof (EFI_UGA_PIXEL
)
907 Status
= EFI_UNSUPPORTED
;
911 // Report displayed Logo information.
913 if (!EFI_ERROR (Status
)) {
916 if (LogoWidth
== 0) {
920 LogoDestX
= (UINTN
) DestX
;
921 LogoDestY
= (UINTN
) DestY
;
926 // Merge new logo with old one.
928 NewDestX
= MIN ((UINTN
) DestX
, LogoDestX
);
929 NewDestY
= MIN ((UINTN
) DestY
, LogoDestY
);
930 NewWidth
= MAX ((UINTN
) DestX
+ Width
, LogoDestX
+ LogoWidth
) - NewDestX
;
931 NewHeight
= MAX ((UINTN
) DestY
+ Height
, LogoDestY
+ LogoHeight
) - NewDestY
;
933 LogoDestX
= NewDestX
;
934 LogoDestY
= NewDestY
;
935 LogoWidth
= NewWidth
;
936 LogoHeight
= NewHeight
;
941 FreePool (ImageData
);
943 if (Badging
== NULL
) {
949 if (BootLogo
== NULL
|| NumberOfLogos
== 0) {
951 // No logo displayed.
961 // Advertise displayed Logo information.
963 if (NumberOfLogos
== 1) {
965 // Only one logo displayed, use its Blt buffer directly for BootLogo protocol.
968 Status
= EFI_SUCCESS
;
971 // More than one Logo displayed, get merged BltBuffer using VideoToBuffer operation.
978 // Ensure the LogoHeight * LogoWidth doesn't overflow
980 if (LogoHeight
> DivU64x64Remainder ((UINTN
) ~0, LogoWidth
, NULL
)) {
981 return EFI_UNSUPPORTED
;
983 BufferSize
= MultU64x64 (LogoWidth
, LogoHeight
);
986 // Ensure the BufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow
988 if (BufferSize
> DivU64x32 ((UINTN
) ~0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
))) {
989 return EFI_UNSUPPORTED
;
992 LogoBlt
= AllocateZeroPool ((UINTN
)BufferSize
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
));
993 if (LogoBlt
== NULL
) {
994 return EFI_OUT_OF_RESOURCES
;
997 if (GraphicsOutput
!= NULL
) {
998 Status
= GraphicsOutput
->Blt (
1001 EfiBltVideoToBltBuffer
,
1008 LogoWidth
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
1010 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
1011 Status
= UgaDraw
->Blt (
1013 (EFI_UGA_PIXEL
*) LogoBlt
,
1014 EfiUgaVideoToBltBuffer
,
1021 LogoWidth
* sizeof (EFI_UGA_PIXEL
)
1024 Status
= EFI_UNSUPPORTED
;
1028 if (!EFI_ERROR (Status
)) {
1029 BootLogo
->SetBootLogo (BootLogo
, LogoBlt
, LogoDestX
, LogoDestY
, LogoWidth
, LogoHeight
);
1037 Use SystemTable Conout to turn on video based Simple Text Out consoles. The
1038 Simple Text Out screens will now be synced up with all non video output devices
1040 @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
1051 // Enable Cursor on Screen
1053 gST
->ConOut
->EnableCursor (gST
->ConOut
, TRUE
);