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 ((((UINTN
)Ptr
- (UINTN
)ConVarName
) / sizeof (CHAR16
)) <= 3) {
48 if ((*(Ptr
- 3) == 'D') && (*(Ptr
- 2) == 'e') && (*(Ptr
- 1) == 'v')) {
56 Fill console handle in System Table if there are no valid console handle in.
58 Firstly, check the validation of console handle in System Table. If it is invalid,
59 update it by the first console device handle from EFI console variable.
61 @param VarName The name of the EFI console variable.
62 @param ConsoleGuid Specified Console protocol GUID.
63 @param ConsoleHandle On IN, console handle in System Table to be checked.
64 On OUT, new console hanlde in system table.
65 @param ProtocolInterface On IN, console protocol on console handle in System Table to be checked.
66 On OUT, new console protocol on new console hanlde in system table.
68 @retval TRUE System Table has been updated.
69 @retval FALSE System Table hasn't been updated.
73 UpdateSystemTableConsole (
75 IN EFI_GUID
*ConsoleGuid
,
76 IN OUT EFI_HANDLE
*ConsoleHandle
,
77 IN OUT VOID
**ProtocolInterface
82 EFI_DEVICE_PATH_PROTOCOL
*FullDevicePath
;
83 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
84 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
88 ASSERT (VarName
!= NULL
);
89 ASSERT (ConsoleHandle
!= NULL
);
90 ASSERT (ConsoleGuid
!= NULL
);
91 ASSERT (ProtocolInterface
!= NULL
);
93 if (*ConsoleHandle
!= NULL
) {
94 Status
= gBS
->HandleProtocol (
99 if (Status
== EFI_SUCCESS
&& Interface
== *ProtocolInterface
) {
101 // If ConsoleHandle is valid and console protocol on this handle also
102 // also matched, just return.
109 // Get all possible consoles device path from EFI variable
111 VarConsole
= BdsLibGetVariableAndSize (
113 &gEfiGlobalVariableGuid
,
116 if (VarConsole
== NULL
) {
118 // If there is no any console device, just return.
123 FullDevicePath
= VarConsole
;
127 // Check every instance of the console variable
129 Instance
= GetNextDevicePathInstance (&VarConsole
, &DevicePathSize
);
130 if (Instance
== NULL
) {
131 FreePool (FullDevicePath
);
136 // Find console device handle by device path instance
138 Status
= gBS
->LocateDevicePath (
143 if (!EFI_ERROR (Status
)) {
145 // Get the console protocol on this console device handle
147 Status
= gBS
->HandleProtocol (
152 if (!EFI_ERROR (Status
)) {
154 // Update new console handle in System Table.
156 *ConsoleHandle
= NewHandle
;
157 *ProtocolInterface
= Interface
;
162 } while (Instance
!= NULL
);
165 // No any available console devcie found.
171 This function update console variable based on ConVarName, it can
172 add or remove one specific console device path from the variable
174 @param ConVarName Console related variable name, ConIn, ConOut,
176 @param CustomizedConDevicePath The console device path which will be added to
177 the console variable ConVarName, this parameter
178 can not be multi-instance.
179 @param ExclusiveDevicePath The console device path which will be removed
180 from the console variable ConVarName, this
181 parameter can not be multi-instance.
183 @retval EFI_UNSUPPORTED The added device path is same to the removed one.
184 @retval EFI_SUCCESS Success add or remove the device path from the
190 BdsLibUpdateConsoleVariable (
191 IN CHAR16
*ConVarName
,
192 IN EFI_DEVICE_PATH_PROTOCOL
*CustomizedConDevicePath
,
193 IN EFI_DEVICE_PATH_PROTOCOL
*ExclusiveDevicePath
196 EFI_DEVICE_PATH_PROTOCOL
*VarConsole
;
197 UINTN DevicePathSize
;
198 EFI_DEVICE_PATH_PROTOCOL
*NewDevicePath
;
199 EFI_DEVICE_PATH_PROTOCOL
*TempNewDevicePath
;
206 // Notes: check the device path point, here should check
207 // with compare memory
209 if (CustomizedConDevicePath
== ExclusiveDevicePath
) {
210 return EFI_UNSUPPORTED
;
213 // Delete the ExclusiveDevicePath from current default console
215 VarConsole
= BdsLibGetVariableAndSize (
217 &gEfiGlobalVariableGuid
,
222 // Initialize NewDevicePath
224 NewDevicePath
= VarConsole
;
227 // If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.
228 // In the end, NewDevicePath is the final device path.
230 if (ExclusiveDevicePath
!= NULL
&& VarConsole
!= NULL
) {
231 NewDevicePath
= BdsLibDelPartMatchInstance (VarConsole
, ExclusiveDevicePath
);
234 // Try to append customized device path to NewDevicePath.
236 if (CustomizedConDevicePath
!= NULL
) {
237 if (!BdsLibMatchDevicePaths (NewDevicePath
, CustomizedConDevicePath
)) {
239 // Check if there is part of CustomizedConDevicePath in NewDevicePath, delete it.
241 NewDevicePath
= BdsLibDelPartMatchInstance (NewDevicePath
, CustomizedConDevicePath
);
243 // In the first check, the default console variable will be _ModuleEntryPoint,
244 // just append current customized device path
246 TempNewDevicePath
= NewDevicePath
;
247 NewDevicePath
= AppendDevicePathInstance (NewDevicePath
, CustomizedConDevicePath
);
248 if (TempNewDevicePath
!= NULL
) {
249 FreePool(TempNewDevicePath
);
255 // The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV.
257 if (IsNvNeed(ConVarName
)) {
259 // ConVarName has NV attribute.
261 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
| EFI_VARIABLE_NON_VOLATILE
;
264 // ConVarName does not have NV attribute.
266 Attributes
= EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
;
270 // Finally, Update the variable of the default console by NewDevicePath
274 &gEfiGlobalVariableGuid
,
276 GetDevicePathSize (NewDevicePath
),
280 if (VarConsole
== NewDevicePath
) {
281 if (VarConsole
!= NULL
) {
282 FreePool(VarConsole
);
285 if (VarConsole
!= NULL
) {
286 FreePool(VarConsole
);
288 if (NewDevicePath
!= NULL
) {
289 FreePool(NewDevicePath
);
299 Connect the console device base on the variable ConVarName, if
300 device path of the ConVarName is multi-instance device path, if
301 anyone of the instances is connected success, then this function
304 @param ConVarName Console related variable name, ConIn, ConOut,
307 @retval EFI_NOT_FOUND There is not any console devices connected
309 @retval EFI_SUCCESS Success connect any one instance of the console
310 device path base on the variable ConVarName.
315 BdsLibConnectConsoleVariable (
316 IN CHAR16
*ConVarName
320 EFI_DEVICE_PATH_PROTOCOL
*StartDevicePath
;
322 EFI_DEVICE_PATH_PROTOCOL
*Instance
;
323 EFI_DEVICE_PATH_PROTOCOL
*Next
;
324 EFI_DEVICE_PATH_PROTOCOL
*CopyOfDevicePath
;
328 Status
= EFI_SUCCESS
;
332 // Check if the console variable exist
334 StartDevicePath
= BdsLibGetVariableAndSize (
336 &gEfiGlobalVariableGuid
,
339 if (StartDevicePath
== NULL
) {
340 return EFI_UNSUPPORTED
;
343 CopyOfDevicePath
= StartDevicePath
;
346 // Check every instance of the console variable
348 Instance
= GetNextDevicePathInstance (&CopyOfDevicePath
, &Size
);
349 if (Instance
== NULL
) {
350 FreePool (StartDevicePath
);
351 return EFI_UNSUPPORTED
;
355 while (!IsDevicePathEndType (Next
)) {
356 Next
= NextDevicePathNode (Next
);
359 SetDevicePathEndNode (Next
);
361 // Check USB1.1 console
363 if ((DevicePathType (Instance
) == MESSAGING_DEVICE_PATH
) &&
364 ((DevicePathSubType (Instance
) == MSG_USB_CLASS_DP
)
365 || (DevicePathSubType (Instance
) == MSG_USB_WWID_DP
)
368 // Check the Usb console in Usb2.0 bus firstly, then Usb1.1 bus
370 Status
= BdsLibConnectUsbDevByShortFormDP (PCI_CLASSC_PI_EHCI
, Instance
);
371 if (!EFI_ERROR (Status
)) {
375 Status
= BdsLibConnectUsbDevByShortFormDP (PCI_CLASSC_PI_UHCI
, Instance
);
376 if (!EFI_ERROR (Status
)) {
381 // Connect the instance device path
383 Status
= BdsLibConnectDevicePath (Instance
);
384 if (EFI_ERROR (Status
)) {
386 // Delete the instance from the console varialbe
388 BdsLibUpdateConsoleVariable (ConVarName
, NULL
, Instance
);
394 } while (CopyOfDevicePath
!= NULL
);
396 FreePool (StartDevicePath
);
399 return EFI_NOT_FOUND
;
407 This function will search every simpletext device in current system,
408 and make every simpletext device as pertantial console device.
413 BdsLibConnectAllConsoles (
418 EFI_DEVICE_PATH_PROTOCOL
*ConDevicePath
;
420 EFI_HANDLE
*HandleBuffer
;
425 ConDevicePath
= NULL
;
428 // Update all the console variables
430 gBS
->LocateHandleBuffer (
432 &gEfiSimpleTextInProtocolGuid
,
438 for (Index
= 0; Index
< HandleCount
; Index
++) {
439 gBS
->HandleProtocol (
441 &gEfiDevicePathProtocolGuid
,
442 (VOID
**) &ConDevicePath
444 BdsLibUpdateConsoleVariable (L
"ConIn", ConDevicePath
, NULL
);
447 if (HandleBuffer
!= NULL
) {
448 FreePool(HandleBuffer
);
452 gBS
->LocateHandleBuffer (
454 &gEfiSimpleTextOutProtocolGuid
,
459 for (Index
= 0; Index
< HandleCount
; Index
++) {
460 gBS
->HandleProtocol (
462 &gEfiDevicePathProtocolGuid
,
463 (VOID
**) &ConDevicePath
465 BdsLibUpdateConsoleVariable (L
"ConOut", ConDevicePath
, NULL
);
466 BdsLibUpdateConsoleVariable (L
"ErrOut", ConDevicePath
, NULL
);
469 if (HandleBuffer
!= NULL
) {
470 FreePool(HandleBuffer
);
474 // Connect all console variables
476 BdsLibConnectAllDefaultConsoles ();
481 This function will connect console device base on the console
482 device variable ConIn, ConOut and ErrOut.
484 @retval EFI_SUCCESS At least one of the ConIn and ConOut device have
485 been connected success.
486 @retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
491 BdsLibConnectAllDefaultConsoles (
496 BOOLEAN SystemTableUpdated
;
499 // Connect all default console variables
503 // It seems impossible not to have any ConOut device on platform,
504 // so we check the status here.
506 Status
= BdsLibConnectConsoleVariable (L
"ConOut");
507 if (EFI_ERROR (Status
)) {
512 // Insert the performance probe for Console Out
514 PERF_START (NULL
, "ConOut", "BDS", 1);
515 PERF_END (NULL
, "ConOut", "BDS", 0);
518 // Because possibly the platform is legacy free, in such case,
519 // ConIn devices (Serial Port and PS2 Keyboard ) does not exist,
520 // so we need not check the status.
522 BdsLibConnectConsoleVariable (L
"ConIn");
525 // The _ModuleEntryPoint err out var is legal.
527 BdsLibConnectConsoleVariable (L
"ErrOut");
529 SystemTableUpdated
= FALSE
;
531 // Fill console handles in System Table if no console device assignd.
533 if (UpdateSystemTableConsole (L
"ConIn", &gEfiSimpleTextInProtocolGuid
, &gST
->ConsoleInHandle
, (VOID
**) &gST
->ConIn
)) {
534 SystemTableUpdated
= TRUE
;
536 if (UpdateSystemTableConsole (L
"ConOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->ConsoleOutHandle
, (VOID
**) &gST
->ConOut
)) {
537 SystemTableUpdated
= TRUE
;
539 if (UpdateSystemTableConsole (L
"ErrOut", &gEfiSimpleTextOutProtocolGuid
, &gST
->StandardErrorHandle
, (VOID
**) &gST
->StdErr
)) {
540 SystemTableUpdated
= TRUE
;
543 if (SystemTableUpdated
) {
545 // Update the CRC32 in the EFI System Table header
548 gBS
->CalculateCrc32 (
560 Convert a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer
561 is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt
562 buffer is passed in it will be used if it is big enough.
564 @param BmpImage Pointer to BMP file
565 @param BmpImageSize Number of bytes in BmpImage
566 @param GopBlt Buffer containing GOP version of BmpImage.
567 @param GopBltSize Size of GopBlt in bytes.
568 @param PixelHeight Height of GopBlt/BmpImage in pixels
569 @param PixelWidth Width of GopBlt/BmpImage in pixels
571 @retval EFI_SUCCESS GopBlt and GopBltSize are returned.
572 @retval EFI_UNSUPPORTED BmpImage is not a valid *.BMP image
573 @retval EFI_BUFFER_TOO_SMALL The passed in GopBlt buffer is not big enough.
574 GopBltSize will contain the required size.
575 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate.
581 IN UINTN BmpImageSize
,
582 IN OUT VOID
**GopBlt
,
583 IN OUT UINTN
*GopBltSize
,
584 OUT UINTN
*PixelHeight
,
585 OUT UINTN
*PixelWidth
590 BMP_IMAGE_HEADER
*BmpHeader
;
591 BMP_COLOR_MAP
*BmpColorMap
;
592 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BltBuffer
;
593 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Blt
;
594 UINT64 BltBufferSize
;
601 BmpHeader
= (BMP_IMAGE_HEADER
*) BmpImage
;
603 if (BmpHeader
->CharB
!= 'B' || BmpHeader
->CharM
!= 'M') {
604 return EFI_UNSUPPORTED
;
608 // Doesn't support compress.
610 if (BmpHeader
->CompressionType
!= 0) {
611 return EFI_UNSUPPORTED
;
615 // Calculate Color Map offset in the image.
618 BmpColorMap
= (BMP_COLOR_MAP
*) (Image
+ sizeof (BMP_IMAGE_HEADER
));
621 // Calculate graphics image data address in the image
623 Image
= ((UINT8
*) BmpImage
) + BmpHeader
->ImageOffset
;
627 // Calculate the BltBuffer needed size.
629 BltBufferSize
= BmpHeader
->PixelWidth
* BmpHeader
->PixelHeight
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
);
630 if (BltBufferSize
>= SIZE_4GB
) {
632 // If the BMP resolution is too large
634 return EFI_UNSUPPORTED
;
638 if (*GopBlt
== NULL
) {
640 // GopBlt is not allocated by caller.
642 *GopBltSize
= (UINTN
) BltBufferSize
;
643 *GopBlt
= AllocatePool (*GopBltSize
);
645 if (*GopBlt
== NULL
) {
646 return EFI_OUT_OF_RESOURCES
;
650 // GopBlt has been allocated by caller.
652 if (*GopBltSize
< (UINTN
) BltBufferSize
) {
653 *GopBltSize
= (UINTN
) BltBufferSize
;
654 return EFI_BUFFER_TOO_SMALL
;
658 *PixelWidth
= BmpHeader
->PixelWidth
;
659 *PixelHeight
= BmpHeader
->PixelHeight
;
662 // Convert image from BMP to Blt buffer format
665 for (Height
= 0; Height
< BmpHeader
->PixelHeight
; Height
++) {
666 Blt
= &BltBuffer
[(BmpHeader
->PixelHeight
- Height
- 1) * BmpHeader
->PixelWidth
];
667 for (Width
= 0; Width
< BmpHeader
->PixelWidth
; Width
++, Image
++, Blt
++) {
668 switch (BmpHeader
->BitPerPixel
) {
671 // Convert 1-bit (2 colors) BMP to 24-bit color
673 for (Index
= 0; Index
< 8 && Width
< BmpHeader
->PixelWidth
; Index
++) {
674 Blt
->Red
= BmpColorMap
[((*Image
) >> (7 - Index
)) & 0x1].Red
;
675 Blt
->Green
= BmpColorMap
[((*Image
) >> (7 - Index
)) & 0x1].Green
;
676 Blt
->Blue
= BmpColorMap
[((*Image
) >> (7 - Index
)) & 0x1].Blue
;
687 // Convert 4-bit (16 colors) BMP Palette to 24-bit color
689 Index
= (*Image
) >> 4;
690 Blt
->Red
= BmpColorMap
[Index
].Red
;
691 Blt
->Green
= BmpColorMap
[Index
].Green
;
692 Blt
->Blue
= BmpColorMap
[Index
].Blue
;
693 if (Width
< (BmpHeader
->PixelWidth
- 1)) {
696 Index
= (*Image
) & 0x0f;
697 Blt
->Red
= BmpColorMap
[Index
].Red
;
698 Blt
->Green
= BmpColorMap
[Index
].Green
;
699 Blt
->Blue
= BmpColorMap
[Index
].Blue
;
705 // Convert 8-bit (256 colors) BMP Palette to 24-bit color
707 Blt
->Red
= BmpColorMap
[*Image
].Red
;
708 Blt
->Green
= BmpColorMap
[*Image
].Green
;
709 Blt
->Blue
= BmpColorMap
[*Image
].Blue
;
716 Blt
->Blue
= *Image
++;
717 Blt
->Green
= *Image
++;
723 // Other bit format BMP is not supported.
729 return EFI_UNSUPPORTED
;
735 ImageIndex
= (UINTN
) (Image
- ImageHeader
);
736 if ((ImageIndex
% 4) != 0) {
738 // Bmp Image starts each row on a 32-bit boundary!
740 Image
= Image
+ (4 - (ImageIndex
% 4));
749 Use Console Control Protocol to lock the Console In Spliter virtual handle.
750 This is the ConInHandle and ConIn handle in the EFI system table. All key
751 presses will be ignored until the Password is typed in. The only way to
752 disable the password is to type it in to a ConIn device.
754 @param Password Password used to lock ConIn device.
756 @retval EFI_SUCCESS lock the Console In Spliter virtual handle successfully.
757 @retval EFI_UNSUPPORTED Password not found
766 return EFI_UNSUPPORTED
;
771 Use Console Control to turn off UGA based Simple Text Out consoles from going
772 to the UGA device. Put up LogoFile on every UGA device that is a console
774 @param[in] LogoFile File name of logo to display on the center of the screen.
776 @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.
777 @retval EFI_UNSUPPORTED Logo not found
783 IN EFI_GUID
*LogoFile
787 EFI_OEM_BADGING_PROTOCOL
*Badging
;
796 EFI_BADGING_FORMAT Format
;
797 EFI_BADGING_DISPLAY_ATTRIBUTE Attribute
;
802 EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*Blt
;
803 EFI_UGA_DRAW_PROTOCOL
*UgaDraw
;
806 EFI_GRAPHICS_OUTPUT_PROTOCOL
*GraphicsOutput
;
810 // Try to open GOP first
812 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiGraphicsOutputProtocolGuid
, (VOID
**) &GraphicsOutput
);
813 if (EFI_ERROR (Status
) && FeaturePcdGet (PcdUgaConsumeSupport
)) {
814 GraphicsOutput
= NULL
;
816 // Open GOP failed, try to open UGA
818 Status
= gBS
->HandleProtocol (gST
->ConsoleOutHandle
, &gEfiUgaDrawProtocolGuid
, (VOID
**) &UgaDraw
);
820 if (EFI_ERROR (Status
)) {
821 return EFI_UNSUPPORTED
;
825 // Erase Cursor from screen
827 gST
->ConOut
->EnableCursor (gST
->ConOut
, FALSE
);
830 Status
= gBS
->LocateProtocol (&gEfiOEMBadgingProtocolGuid
, NULL
, (VOID
**) &Badging
);
832 if (GraphicsOutput
!= NULL
) {
833 SizeOfX
= GraphicsOutput
->Mode
->Info
->HorizontalResolution
;
834 SizeOfY
= GraphicsOutput
->Mode
->Info
->VerticalResolution
;
836 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
837 Status
= UgaDraw
->GetMode (UgaDraw
, &SizeOfX
, &SizeOfY
, &ColorDepth
, &RefreshRate
);
838 if (EFI_ERROR (Status
)) {
839 return EFI_UNSUPPORTED
;
842 return EFI_UNSUPPORTED
;
850 if (Badging
!= NULL
) {
852 // Get image from OEMBadging protocol.
854 Status
= Badging
->GetImage (
864 if (EFI_ERROR (Status
)) {
869 // Currently only support BMP format.
871 if (Format
!= EfiBadgingFormatBMP
) {
872 if (ImageData
!= NULL
) {
873 FreePool (ImageData
);
879 // Get the specified image from FV.
881 Status
= GetSectionFromAnyFv (LogoFile
, EFI_SECTION_RAW
, 0, (VOID
**) &ImageData
, &ImageSize
);
882 if (EFI_ERROR (Status
)) {
883 return EFI_UNSUPPORTED
;
888 Attribute
= EfiBadgingDisplayAttributeCenter
;
892 Status
= ConvertBmpToGopBlt (
900 if (EFI_ERROR (Status
)) {
901 FreePool (ImageData
);
903 if (Badging
== NULL
) {
911 // Calculate the display position according to Attribute.
914 case EfiBadgingDisplayAttributeLeftTop
:
919 case EfiBadgingDisplayAttributeCenterTop
:
920 DestX
= (SizeOfX
- Width
) / 2;
924 case EfiBadgingDisplayAttributeRightTop
:
925 DestX
= (SizeOfX
- Width
- CoordinateX
);
926 DestY
= CoordinateY
;;
929 case EfiBadgingDisplayAttributeCenterRight
:
930 DestX
= (SizeOfX
- Width
- CoordinateX
);
931 DestY
= (SizeOfY
- Height
) / 2;
934 case EfiBadgingDisplayAttributeRightBottom
:
935 DestX
= (SizeOfX
- Width
- CoordinateX
);
936 DestY
= (SizeOfY
- Height
- CoordinateY
);
939 case EfiBadgingDisplayAttributeCenterBottom
:
940 DestX
= (SizeOfX
- Width
) / 2;
941 DestY
= (SizeOfY
- Height
- CoordinateY
);
944 case EfiBadgingDisplayAttributeLeftBottom
:
946 DestY
= (SizeOfY
- Height
- CoordinateY
);
949 case EfiBadgingDisplayAttributeCenterLeft
:
951 DestY
= (SizeOfY
- Height
) / 2;
954 case EfiBadgingDisplayAttributeCenter
:
955 DestX
= (SizeOfX
- Width
) / 2;
956 DestY
= (SizeOfY
- Height
) / 2;
965 if ((DestX
>= 0) && (DestY
>= 0)) {
966 if (GraphicsOutput
!= NULL
) {
967 Status
= GraphicsOutput
->Blt (
977 Width
* sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL
)
979 } else if (UgaDraw
!= NULL
&& FeaturePcdGet (PcdUgaConsumeSupport
)) {
980 Status
= UgaDraw
->Blt (
982 (EFI_UGA_PIXEL
*) Blt
,
983 EfiUgaBltBufferToVideo
,
990 Width
* sizeof (EFI_UGA_PIXEL
)
993 Status
= EFI_UNSUPPORTED
;
997 FreePool (ImageData
);
1003 if (Badging
== NULL
) {
1012 Use Console Control to turn on UGA based Simple Text Out consoles. The UGA
1013 Simple Text Out screens will now be synced up with all non UGA output devices
1015 @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
1026 // Enable Cursor on Screen
1028 gST
->ConOut
->EnableCursor (gST
->ConOut
, TRUE
);