2 BDS Lib functions which contain all the code to connect console device
4 Copyright (c) 2004 - 2009, Intel Corporation. <BR>
5 All rights reserved. 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
22 @param ConVarName The name of the EFI variable.
24 @retval TRUE Set the EFI variable as NV type.
25 @retval FALSE EFI variable as NV type can be set NonNV.
37 // If the variable includes "Dev" at last, we consider
38 // it does not support NV attribute.
40 while (*Ptr
!= L
'\0') {
44 if ((*(Ptr
- 3) == 'D') && (*(Ptr
- 2) == 'e') && (*(Ptr
- 1) == 'v')) {
52 Fill console handle in System Table if there are no valid console handle in.
54 Firstly, check the validation of console handle in System Table. If it is invalid,
55 update it by the first console device handle from EFI console variable.
57 @param VarName The name of the EFI console variable.
58 @param ConsoleGuid Specified Console protocol GUID.
59 @param ConsoleHandle On IN, console handle in System Table to be checked.
60 On OUT, new console hanlde in system table.
61 @param ProtocolInterface On IN, console protocol on console handle in System Table to be checked.
62 On OUT, new console protocol on new console hanlde in system table.
64 @retval TRUE System Table has been updated.
65 @retval FALSE System Table hasn't been updated.
69 UpdateSystemTableConsole (
71 IN EFI_GUID
*ConsoleGuid
,
72 IN OUT EFI_HANDLE
*ConsoleHandle
,
73 IN OUT VOID
**ProtocolInterface
78 EFI_DEVICE_PATH_PROTOCOL
*FullDevicePath
;
79 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
80 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
84 ASSERT (VarName
!= NULL
);
85 ASSERT (ConsoleHandle
!= NULL
);
86 ASSERT (ConsoleGuid
!= NULL
);
87 ASSERT (ProtocolInterface
!= NULL
);
89 if (*ConsoleHandle
!= NULL
) {
90 Status
= gBS
->HandleProtocol (
95 if (Status
== EFI_SUCCESS
&& Interface
== *ProtocolInterface
) {
97 // If ConsoleHandle is valid and console protocol on this handle also
98 // also matched, just return.
105 // Get all possible consoles device path from EFI variable
107 VarConsole
= BdsLibGetVariableAndSize (
109 &gEfiGlobalVariableGuid
,
112 if (VarConsole
== NULL
) {
114 // If there is no any console device, just return.
119 FullDevicePath
= VarConsole
;
123 // Check every instance of the console variable
125 Instance
= GetNextDevicePathInstance (&VarConsole
, &DevicePathSize
);
126 if (Instance
== NULL
) {
127 FreePool (FullDevicePath
);
132 // Find console device handle by device path instance
134 Status
= gBS
->LocateDevicePath (
139 if (!EFI_ERROR (Status
)) {
141 // Get the console protocol on this console device handle
143 Status
= gBS
->HandleProtocol (
148 if (!EFI_ERROR (Status
)) {
150 // Update new console handle in System Table.
152 *ConsoleHandle
= NewHandle
;
153 *ProtocolInterface
= Interface
;
158 } while (Instance
!= NULL
);
161 // No any available console devcie found.
167 This function update console variable based on ConVarName, it can
168 add or remove one specific console device path from the variable
170 @param ConVarName Console related variable name, ConIn, ConOut,
172 @param CustomizedConDevicePath The console device path which will be added to
173 the console variable ConVarName, this parameter
174 can not be multi-instance.
175 @param ExclusiveDevicePath The console device path which will be removed
176 from the console variable ConVarName, this
177 parameter can not be multi-instance.
179 @retval EFI_UNSUPPORTED The added device path is same to the removed one.
180 @retval EFI_SUCCESS Success add or remove the device path from the
186 BdsLibUpdateConsoleVariable (
187 IN CHAR16
*ConVarName
,
188 IN EFI_DEVICE_PATH_PROTOCOL
*CustomizedConDevicePath
,
189 IN EFI_DEVICE_PATH_PROTOCOL
*ExclusiveDevicePath
192 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
193 UINTN DevicePathSize
;
194 EFI_DEVICE_PATH_PROTOCOL
*NewDevicePath
;
195 EFI_DEVICE_PATH_PROTOCOL
*TempNewDevicePath
;
202 // Notes: check the device path point, here should check
203 // with compare memory
205 if (CustomizedConDevicePath
== ExclusiveDevicePath
) {
206 return EFI_UNSUPPORTED
;
209 // Delete the ExclusiveDevicePath from current default console
211 VarConsole
= BdsLibGetVariableAndSize (
213 &gEfiGlobalVariableGuid
,
218 // Initialize NewDevicePath
220 NewDevicePath
= VarConsole
;
223 // If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.
224 // In the end, NewDevicePath is the final device path.
226 if (ExclusiveDevicePath
!= NULL
&& VarConsole
!= NULL
) {
227 NewDevicePath
= BdsLibDelPartMatchInstance (VarConsole
, ExclusiveDevicePath
);
230 // Try to append customized device path to NewDevicePath.
232 if (CustomizedConDevicePath
!= NULL
) {
233 if (!BdsLibMatchDevicePaths (NewDevicePath
, CustomizedConDevicePath
)) {
235 // Check if there is part of CustomizedConDevicePath in NewDevicePath, delete it.
237 NewDevicePath
= BdsLibDelPartMatchInstance (NewDevicePath
, CustomizedConDevicePath
);
239 // In the first check, the default console variable will be _ModuleEntryPoint,
240 // just append current customized device path
242 TempNewDevicePath
= NewDevicePath
;
243 NewDevicePath
= AppendDevicePathInstance (NewDevicePath
, CustomizedConDevicePath
);
244 if (TempNewDevicePath
!= NULL
) {
245 FreePool(TempNewDevicePath
);
251 // The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV.
253 if (IsNvNeed(ConVarName
)) {
255 // ConVarName has NV attribute.
257 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
| EFI_VARIABLE_NON_VOLATILE
;
260 // ConVarName does not have NV attribute.
262 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
;
266 // Finally, Update the variable of the default console by NewDevicePath
270 &gEfiGlobalVariableGuid
,
272 GetDevicePathSize (NewDevicePath
),
276 if (VarConsole
== NewDevicePath
) {
277 if (VarConsole
!= NULL
) {
278 FreePool(VarConsole
);
281 if (VarConsole
!= NULL
) {
282 FreePool(VarConsole
);
284 if (NewDevicePath
!= NULL
) {
285 FreePool(NewDevicePath
);
295 Connect the console device base on the variable ConVarName, if
296 device path of the ConVarName is multi-instance device path, if
297 anyone of the instances is connected success, then this function
300 @param ConVarName Console related variable name, ConIn, ConOut,
303 @retval EFI_NOT_FOUND There is not any console devices connected
305 @retval EFI_SUCCESS Success connect any one instance of the console
306 device path base on the variable ConVarName.
311 BdsLibConnectConsoleVariable (
312 IN CHAR16
*ConVarName
316 EFI_DEVICE_PATH_PROTOCOL
*StartDevicePath
;
318 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
319 EFI_DEVICE_PATH_PROTOCOL
*Next
;
320 EFI_DEVICE_PATH_PROTOCOL
*CopyOfDevicePath
;
324 Status
= EFI_SUCCESS
;
328 // Check if the console variable exist
330 StartDevicePath
= BdsLibGetVariableAndSize (
332 &gEfiGlobalVariableGuid
,
335 if (StartDevicePath
== NULL
) {
336 return EFI_UNSUPPORTED
;
339 CopyOfDevicePath
= StartDevicePath
;
342 // Check every instance of the console variable
344 Instance
= GetNextDevicePathInstance (&CopyOfDevicePath
, &Size
);
345 if (Instance
== NULL
) {
346 FreePool (StartDevicePath
);
347 return EFI_UNSUPPORTED
;
351 while (!IsDevicePathEndType (Next
)) {
352 Next
= NextDevicePathNode (Next
);
355 SetDevicePathEndNode (Next
);
357 // Check USB1.1 console
359 if ((DevicePathType (Instance
) == MESSAGING_DEVICE_PATH
) &&
360 ((DevicePathSubType (Instance
) == MSG_USB_CLASS_DP
)
361 || (DevicePathSubType (Instance
) == MSG_USB_WWID_DP
)
364 // Check the Usb console in Usb2.0 bus firstly, then Usb1.1 bus
366 Status
= BdsLibConnectUsbDevByShortFormDP (PCI_CLASSC_PI_EHCI
, Instance
);
367 if (!EFI_ERROR (Status
)) {
371 Status
= BdsLibConnectUsbDevByShortFormDP (PCI_CLASSC_PI_UHCI
, Instance
);
372 if (!EFI_ERROR (Status
)) {
377 // Connect the instance device path
379 Status
= BdsLibConnectDevicePath (Instance
);
380 if (EFI_ERROR (Status
)) {
382 // Delete the instance from the console varialbe
384 BdsLibUpdateConsoleVariable (ConVarName
, NULL
, Instance
);
390 } while (CopyOfDevicePath
!= NULL
);
392 FreePool (StartDevicePath
);
395 return EFI_NOT_FOUND
;
403 This function will search every simpletext device in current system,
404 and make every simpletext device as pertantial console device.
409 BdsLibConnectAllConsoles (
414 EFI_DEVICE_PATH_PROTOCOL
*ConDevicePath
;
416 EFI_HANDLE
*HandleBuffer
;
421 ConDevicePath
= NULL
;
424 // Update all the console variables
426 gBS
->LocateHandleBuffer (
428 &gEfiSimpleTextInProtocolGuid
,
434 for (Index
= 0; Index
< HandleCount
; Index
++) {
435 gBS
->HandleProtocol (
437 &gEfiDevicePathProtocolGuid
,
438 (VOID
**) &ConDevicePath
440 BdsLibUpdateConsoleVariable (L
"ConIn", ConDevicePath
, NULL
);
443 if (HandleBuffer
!= NULL
) {
444 FreePool(HandleBuffer
);
448 gBS
->LocateHandleBuffer (
450 &gEfiSimpleTextOutProtocolGuid
,
455 for (Index
= 0; Index
< HandleCount
; Index
++) {
456 gBS
->HandleProtocol (
458 &gEfiDevicePathProtocolGuid
,
459 (VOID
**) &ConDevicePath
461 BdsLibUpdateConsoleVariable (L
"ConOut", ConDevicePath
, NULL
);
462 BdsLibUpdateConsoleVariable (L
"ErrOut", ConDevicePath
, NULL
);
465 if (HandleBuffer
!= NULL
) {
466 FreePool(HandleBuffer
);
470 // Connect all console variables
472 BdsLibConnectAllDefaultConsoles ();
477 This function will connect console device base on the console
478 device variable ConIn, ConOut and ErrOut.
480 @retval EFI_SUCCESS At least one of the ConIn and ConOut device have
481 been connected success.
482 @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
487 BdsLibConnectAllDefaultConsoles (
492 BOOLEAN SystemTableUpdated
;
495 // Connect all default console variables
499 // It seems impossible not to have any ConOut device on platform,
500 // so we check the status here.
502 Status
= BdsLibConnectConsoleVariable (L
"ConOut");
503 if (EFI_ERROR (Status
)) {
508 // Insert the performance probe for Console Out
510 PERF_START (NULL
, "ConOut", "BDS", 1);
511 PERF_END (NULL
, "ConOut", "BDS", 0);
514 // Because possibly the platform is legacy free, in such case,
515 // ConIn devices (Serial Port and PS2 Keyboard ) does not exist,
516 // so we need not check the status.
518 BdsLibConnectConsoleVariable (L
"ConIn");
521 // The _ModuleEntryPoint err out var is legal.
523 BdsLibConnectConsoleVariable (L
"ErrOut");
525 SystemTableUpdated
= FALSE
;
527 // Fill console handles in System Table if no console device assignd.
529 if (UpdateSystemTableConsole (L
"ConIn", &gEfiSimpleTextInProtocolGuid
, &gST
->ConsoleInHandle
, (VOID
**) &gST
->ConIn
)) {
530 SystemTableUpdated
= TRUE
;
532 if (UpdateSystemTableConsole (L
"ConOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->ConsoleOutHandle
, (VOID
**) &gST
->ConOut
)) {
533 SystemTableUpdated
= TRUE
;
535 if (UpdateSystemTableConsole (L
"ErrOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->StandardErrorHandle
, (VOID
**) &gST
->StdErr
)) {
536 SystemTableUpdated
= TRUE
;
539 if (SystemTableUpdated
) {
541 // Update the CRC32 in the EFI System Table header
544 gBS
->CalculateCrc32 (
556 Convert a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer
557 is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt
558 buffer is passed in it will be used if it is big enough.
560 @param BmpImage Pointer to BMP file
561 @param BmpImageSize Number of bytes in BmpImage
562 @param GopBlt Buffer containing GOP version of BmpImage.
563 @param GopBltSize Size of GopBlt in bytes.
564 @param PixelHeight Height of GopBlt/BmpImage in pixels
565 @param PixelWidth Width of GopBlt/BmpImage in pixels
567 @retval EFI_SUCCESS GopBlt and GopBltSize are returned.
568 @retval EFI_UNSUPPORTED BmpImage is not a valid *.BMP image
569 @retval EFI_BUFFER_TOO_SMALL The passed in GopBlt buffer is not big enough.
570 GopBltSize will contain the required size.
571 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate.
577 IN UINTN BmpImageSize
,
578 IN OUT VOID
**GopBlt
,
579 IN OUT UINTN
*GopBltSize
,
580 OUT UINTN
*PixelHeight
,
581 OUT UINTN
*PixelWidth
586 BMP_IMAGE_HEADER
*BmpHeader
;
587 BMP_COLOR_MAP
*BmpColorMap
;
588 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BltBuffer
;
589 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Blt
;
590 UINT64 BltBufferSize
;
597 BmpHeader
= (BMP_IMAGE_HEADER
*) BmpImage
;
599 if (BmpHeader
->CharB
!= 'B' || BmpHeader
->CharM
!= 'M') {
600 return EFI_UNSUPPORTED
;
604 // Doesn't support compress.
606 if (BmpHeader
->CompressionType
!= 0) {
607 return EFI_UNSUPPORTED
;
611 // Calculate Color Map offset in the image.
614 BmpColorMap
= (BMP_COLOR_MAP
*) (Image
+ sizeof (BMP_IMAGE_HEADER
));
617 // Calculate graphics image data address in the image
619 Image
= ((UINT8
*) BmpImage
) + BmpHeader
->ImageOffset
;
623 // Calculate the BltBuffer needed size.
625 BltBufferSize
= BmpHeader
->PixelWidth
* BmpHeader
->PixelHeight
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
);
626 if (BltBufferSize
>= SIZE_4GB
) {
628 // If the BMP resolution is too large
630 return EFI_UNSUPPORTED
;
634 if (*GopBlt
== NULL
) {
636 // GopBlt is not allocated by caller.
638 *GopBltSize
= (UINTN
) BltBufferSize
;
639 *GopBlt
= AllocatePool (*GopBltSize
);
641 if (*GopBlt
== NULL
) {
642 return EFI_OUT_OF_RESOURCES
;
646 // GopBlt has been allocated by caller.
648 if (*GopBltSize
< BltBufferSize
) {
649 *GopBltSize
= (UINTN
) BltBufferSize
;
650 return EFI_BUFFER_TOO_SMALL
;
654 *PixelWidth
= BmpHeader
->PixelWidth
;
655 *PixelHeight
= BmpHeader
->PixelHeight
;
658 // Convert image from BMP to Blt buffer format
661 for (Height
= 0; Height
< BmpHeader
->PixelHeight
; Height
++) {
662 Blt
= &BltBuffer
[(BmpHeader
->PixelHeight
- Height
- 1) * BmpHeader
->PixelWidth
];
663 for (Width
= 0; Width
< BmpHeader
->PixelWidth
; Width
++, Image
++, Blt
++) {
664 switch (BmpHeader
->BitPerPixel
) {
667 // Convert 1-bit (2 colors) BMP to 24-bit color
669 for (Index
= 0; Index
< 8 && Width
< BmpHeader
->PixelWidth
; Index
++) {
670 Blt
->Red
= BmpColorMap
[((*Image
) >> (7 - Index
)) & 0x1].Red
;
671 Blt
->Green
= BmpColorMap
[((*Image
) >> (7 - Index
)) & 0x1].Green
;
672 Blt
->Blue
= BmpColorMap
[((*Image
) >> (7 - Index
)) & 0x1].Blue
;
683 // Convert 4-bit (16 colors) BMP Palette to 24-bit color
685 Index
= (*Image
) >> 4;
686 Blt
->Red
= BmpColorMap
[Index
].Red
;
687 Blt
->Green
= BmpColorMap
[Index
].Green
;
688 Blt
->Blue
= BmpColorMap
[Index
].Blue
;
689 if (Width
< (BmpHeader
->PixelWidth
- 1)) {
692 Index
= (*Image
) & 0x0f;
693 Blt
->Red
= BmpColorMap
[Index
].Red
;
694 Blt
->Green
= BmpColorMap
[Index
].Green
;
695 Blt
->Blue
= BmpColorMap
[Index
].Blue
;
701 // Convert 8-bit (256 colors) BMP Palette to 24-bit color
703 Blt
->Red
= BmpColorMap
[*Image
].Red
;
704 Blt
->Green
= BmpColorMap
[*Image
].Green
;
705 Blt
->Blue
= BmpColorMap
[*Image
].Blue
;
712 Blt
->Blue
= *Image
++;
713 Blt
->Green
= *Image
++;
719 // Other bit format BMP is not supported.
725 return EFI_UNSUPPORTED
;
731 ImageIndex
= (UINTN
) (Image
- ImageHeader
);
732 if ((ImageIndex
% 4) != 0) {
734 // Bmp Image starts each row on a 32-bit boundary!
736 Image
= Image
+ (4 - (ImageIndex
% 4));
745 Use Console Control Protocol to lock the Console In Spliter virtual handle.
746 This is the ConInHandle and ConIn handle in the EFI system table. All key
747 presses will be ignored until the Password is typed in. The only way to
748 disable the password is to type it in to a ConIn device.
750 @param Password Password used to lock ConIn device.
752 @retval EFI_SUCCESS lock the Console In Spliter virtual handle successfully.
753 @retval EFI_UNSUPPORTED Password not found
762 return EFI_UNSUPPORTED
;
767 Use Console Control to turn off UGA based Simple Text Out consoles from going
768 to the UGA device. Put up LogoFile on every UGA device that is a console
770 @param[in] LogoFile File name of logo to display on the center of the screen.
772 @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.
773 @retval EFI_UNSUPPORTED Logo not found
779 IN EFI_GUID
*LogoFile
783 EFI_OEM_BADGING_PROTOCOL
*Badging
;
792 EFI_BADGING_FORMAT Format
;
793 EFI_BADGING_DISPLAY_ATTRIBUTE Attribute
;
798 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Blt
;
799 EFI_UGA_DRAW_PROTOCOL
*UgaDraw
;
802 EFI_GRAPHICS_OUTPUT_PROTOCOL
*GraphicsOutput
;
806 // Try to open GOP first
808 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiGraphicsOutputProtocolGuid
, (VOID
**) &GraphicsOutput
);
809 if (EFI_ERROR (Status
) && FeaturePcdGet (PcdUgaConsumeSupport
)) {
810 GraphicsOutput
= NULL
;
812 // Open GOP failed, try to open UGA
814 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiUgaDrawProtocolGuid
, (VOID
**) &UgaDraw
);
816 if (EFI_ERROR (Status
)) {
817 return EFI_UNSUPPORTED
;
821 // Erase Cursor from screen
823 gST
->ConOut
->EnableCursor (gST
->ConOut
, FALSE
);
826 Status
= gBS
->LocateProtocol (&gEfiOEMBadgingProtocolGuid
, NULL
, (VOID
**) &Badging
);
828 if (GraphicsOutput
!= NULL
) {
829 SizeOfX
= GraphicsOutput
->Mode
->Info
->HorizontalResolution
;
830 SizeOfY
= GraphicsOutput
->Mode
->Info
->VerticalResolution
;
832 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
833 Status
= UgaDraw
->GetMode (UgaDraw
, &SizeOfX
, &SizeOfY
, &ColorDepth
, &RefreshRate
);
834 if (EFI_ERROR (Status
)) {
835 return EFI_UNSUPPORTED
;
838 return EFI_UNSUPPORTED
;
846 if (Badging
!= NULL
) {
848 // Get image from OEMBadging protocol.
850 Status
= Badging
->GetImage (
860 if (EFI_ERROR (Status
)) {
865 // Currently only support BMP format.
867 if (Format
!= EfiBadgingFormatBMP
) {
868 if (ImageData
!= NULL
) {
869 FreePool (ImageData
);
875 // Get the specified image from FV.
877 Status
= GetSectionFromAnyFv (LogoFile
, EFI_SECTION_RAW
, 0, (VOID
**) &ImageData
, &ImageSize
);
878 if (EFI_ERROR (Status
)) {
879 return EFI_UNSUPPORTED
;
884 Attribute
= EfiBadgingDisplayAttributeCenter
;
888 Status
= ConvertBmpToGopBlt (
896 if (EFI_ERROR (Status
)) {
897 FreePool (ImageData
);
899 if (Badging
== NULL
) {
907 // Calculate the display position according to Attribute.
910 case EfiBadgingDisplayAttributeLeftTop
:
915 case EfiBadgingDisplayAttributeCenterTop
:
916 DestX
= (SizeOfX
- Width
) / 2;
920 case EfiBadgingDisplayAttributeRightTop
:
921 DestX
= (SizeOfX
- Width
- CoordinateX
);
922 DestY
= CoordinateY
;;
925 case EfiBadgingDisplayAttributeCenterRight
:
926 DestX
= (SizeOfX
- Width
- CoordinateX
);
927 DestY
= (SizeOfY
- Height
) / 2;
930 case EfiBadgingDisplayAttributeRightBottom
:
931 DestX
= (SizeOfX
- Width
- CoordinateX
);
932 DestY
= (SizeOfY
- Height
- CoordinateY
);
935 case EfiBadgingDisplayAttributeCenterBottom
:
936 DestX
= (SizeOfX
- Width
) / 2;
937 DestY
= (SizeOfY
- Height
- CoordinateY
);
940 case EfiBadgingDisplayAttributeLeftBottom
:
942 DestY
= (SizeOfY
- Height
- CoordinateY
);
945 case EfiBadgingDisplayAttributeCenterLeft
:
947 DestY
= (SizeOfY
- Height
) / 2;
950 case EfiBadgingDisplayAttributeCenter
:
951 DestX
= (SizeOfX
- Width
) / 2;
952 DestY
= (SizeOfY
- Height
) / 2;
961 if ((DestX
>= 0) && (DestY
>= 0)) {
962 if (GraphicsOutput
!= NULL
) {
963 Status
= GraphicsOutput
->Blt (
973 Width
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
975 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
976 Status
= UgaDraw
->Blt (
978 (EFI_UGA_PIXEL
*) Blt
,
979 EfiUgaBltBufferToVideo
,
986 Width
* sizeof (EFI_UGA_PIXEL
)
989 Status
= EFI_UNSUPPORTED
;
993 FreePool (ImageData
);
999 if (Badging
== NULL
) {
1008 Use Console Control to turn on UGA based Simple Text Out consoles. The UGA
1009 Simple Text Out screens will now be synced up with all non UGA output devices
1011 @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
1022 // Enable Cursor on Screen
1024 gST
->ConOut
->EnableCursor (gST
->ConOut
, TRUE
);