2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS UEFI Boot Library
4 * FILE: boot/environ/lib/platform/display.c
5 * PURPOSE: Boot Library Display Management Routines
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES ******************************************************************/
14 /* DATA VARIABLES ************************************************************/
16 typedef enum _BL_COLOR
34 } BL_COLOR
, *PBL_COLOR
;
36 typedef struct _BL_DISPLAY_STATE
43 } BL_DISPLAY_STATE
, *PBL_DISPLAY_STATE
;
45 typedef struct _BL_DISPLAY_MODE
50 } BL_DISPLAY_MODE
, *PBL_DISPLAY_MODE
;
52 struct _BL_TEXT_CONSOLE
;
55 (*PCONSOLE_DESTRUCT
) (
56 _In_
struct _BL_TEXT_CONSOLE
* Console
61 (*PCONSOLE_REINITIALIZE
) (
62 _In_
struct _BL_TEXT_CONSOLE
* Console
67 (*PCONSOLE_GET_TEXT_STATE
) (
68 _In_
struct _BL_TEXT_CONSOLE
* Console
,
69 _Out_ PBL_DISPLAY_STATE TextState
74 (*PCONSOLE_SET_TEXT_STATE
) (
75 _In_
struct _BL_TEXT_CONSOLE
* Console
,
77 _In_ PBL_DISPLAY_STATE TextState
82 (*PCONSOLE_GET_TEXT_RESOLUTION
) (
83 _In_
struct _BL_TEXT_CONSOLE
* Console
,
84 _Out_ PULONG TextResolution
89 (*PCONSOLE_SET_TEXT_RESOLUTION
) (
90 _In_
struct _BL_TEXT_CONSOLE
* Console
,
91 _In_ ULONG NewTextResolution
,
92 _Out_ PULONG OldTextResolution
97 (*PCONSOLE_CLEAR_TEXT
) (
98 _In_
struct _BL_TEXT_CONSOLE
* Console
,
105 (*PCONSOLE_WRITE_TEXT
) (
106 _In_
struct _BL_TEXT_CONSOLE
* Console
,
111 typedef struct _BL_TEXT_CONSOLE_VTABLE
113 PCONSOLE_DESTRUCT Destruct
;
114 PCONSOLE_REINITIALIZE Reinitialize
;
115 PCONSOLE_GET_TEXT_STATE GetTextState
;
116 PCONSOLE_SET_TEXT_STATE SetTextState
;
117 PCONSOLE_GET_TEXT_RESOLUTION GetTextResolution
;
118 PCONSOLE_SET_TEXT_RESOLUTION SetTextResolution
;
119 PCONSOLE_CLEAR_TEXT ClearText
;
120 PCONSOLE_WRITE_TEXT WriteText
;
121 } BL_TEXT_CONSOLE_VTABLE
, *PBL_TEXT_CONSOLE_VTABLE
;
123 typedef struct _BL_TEXT_CONSOLE
125 PBL_TEXT_CONSOLE_VTABLE Callbacks
;
126 BL_DISPLAY_STATE State
;
127 BL_DISPLAY_MODE DisplayMode
;
129 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
* Protocol
;
131 EFI_SIMPLE_TEXT_OUTPUT_MODE OldMode
;
132 } BL_TEXT_CONSOLE
, *PBL_TEXT_CONSOLE
;
134 PVOID BfiCachedStrikeData
;
135 LIST_ENTRY BfiDeferredListHead
;
136 LIST_ENTRY BfiFontFileListHead
;
138 PVOID BfiGraphicsRectangle
;
140 ULONG ConsoleGraphicalResolutionListFlags
;
141 BL_DISPLAY_MODE ConsoleGraphicalResolutionList
[3] =
148 BL_DISPLAY_MODE ConsoleTextResolutionList
[1] =
154 ConsoleTextLocalDestruct (
155 _In_
struct _BL_TEXT_CONSOLE
* Console
159 ConsoleTextLocalReinitialize (
160 _In_
struct _BL_TEXT_CONSOLE
* Console
164 ConsoleTextBaseGetTextState (
165 _In_
struct _BL_TEXT_CONSOLE
* Console
,
166 _Out_ PBL_DISPLAY_STATE TextState
170 ConsoleTextLocalSetTextState (
171 _In_
struct _BL_TEXT_CONSOLE
* Console
,
173 _In_ PBL_DISPLAY_STATE TextState
177 ConsoleTextBaseGetTextResolution (
178 _In_
struct _BL_TEXT_CONSOLE
* Console
,
179 _Out_ PULONG TextResolution
183 ConsoleTextLocalSetTextResolution (
184 _In_
struct _BL_TEXT_CONSOLE
* Console
,
185 _In_ ULONG NewTextResolution
,
186 _Out_ PULONG OldTextResolution
190 ConsoleTextLocalClearText (
191 _In_
struct _BL_TEXT_CONSOLE
* Console
,
196 ConsoleTextLocalWriteText (
197 _In_
struct _BL_TEXT_CONSOLE
* Console
,
202 BL_TEXT_CONSOLE_VTABLE ConsoleTextLocalVtbl
=
204 ConsoleTextLocalDestruct
,
205 ConsoleTextLocalReinitialize
,
206 ConsoleTextBaseGetTextState
,
207 ConsoleTextLocalSetTextState
,
208 ConsoleTextBaseGetTextResolution
,
209 ConsoleTextLocalSetTextResolution
,
210 ConsoleTextLocalClearText
,
211 ConsoleTextLocalWriteText
214 PVOID DspRemoteInputConsole
;
215 PVOID DspTextConsole
;
216 PVOID DspGraphicalConsole
;
218 /* FUNCTIONS *****************************************************************/
221 ConsolepFindResolution (
222 _In_ PBL_DISPLAY_MODE Mode
,
223 _In_ PBL_DISPLAY_MODE List
,
227 PBL_DISPLAY_MODE ListEnd
;
229 /* Loop until we hit the maximum supported list index */
230 ListEnd
= &List
[MaxIndex
];
231 while (List
!= ListEnd
)
233 /* Does this resolution match? */
234 if ((Mode
->HRes
!= List
->HRes
) || (Mode
->VRes
!= List
->VRes
))
240 /* Yep -- we got a match */
244 /* No matches were found */
249 ConsoleEfiTextGetColorForeground (
250 _In_ UINT32 Attributes
253 switch (Attributes
& 0x0F)
281 case EFI_LIGHTMAGENTA
:
292 ConsoleEfiTextGetColorBackground (
293 _In_ UINT32 Attributes
296 switch (Attributes
& 0xF0)
298 case EFI_BACKGROUND_MAGENTA
:
300 case EFI_BACKGROUND_BROWN
:
302 case EFI_BACKGROUND_LIGHTGRAY
:
305 case EFI_BACKGROUND_BLACK
:
307 case EFI_BACKGROUND_RED
:
309 case EFI_BACKGROUND_GREEN
:
311 case EFI_BACKGROUND_CYAN
:
313 case EFI_BACKGROUND_BLUE
:
319 ConsoleEfiTextGetEfiColorBackground (
327 return EFI_BACKGROUND_BLUE
;
330 return EFI_BACKGROUND_GREEN
;
333 return EFI_BACKGROUND_CYAN
;
336 return EFI_BACKGROUND_RED
;
339 return EFI_BACKGROUND_MAGENTA
;
342 return EFI_BACKGROUND_BROWN
;
345 return EFI_BACKGROUND_LIGHTGRAY
;
349 return EFI_BACKGROUND_BLACK
;
354 ConsoleEfiTextGetEfiColorForeground (
375 return EFI_LIGHTGRAY
;
379 return EFI_LIGHTBLUE
;
381 return EFI_LIGHTGREEN
;
383 return EFI_LIGHTCYAN
;
387 return EFI_LIGHTMAGENTA
;
397 ConsoleEfiTextGetAttribute (
402 /* Convert each part and OR into a single attribute */
403 return ConsoleEfiTextGetEfiColorBackground(BgColor
) |
404 ConsoleEfiTextGetEfiColorForeground(FgColor
);
408 ConsoleEfiTextGetStateFromMode (
409 _In_ EFI_SIMPLE_TEXT_OUTPUT_MODE
*Mode
,
410 _Out_ PBL_DISPLAY_STATE State
414 ULONG TextWidth
, TextHeight
;
416 /* Get all the EFI data and convert it into our own structure */
417 BlDisplayGetTextCellResolution(&TextWidth
, &TextHeight
);
418 State
->FgColor
= ConsoleEfiTextGetColorForeground(Mode
->Attribute
);
419 State
->BgColor
= ConsoleEfiTextGetColorBackground(Mode
->Attribute
);
420 State
->XPos
= Mode
->CursorColumn
* TextWidth
;
421 State
->YPos
= Mode
->CursorRow
* TextHeight
;
422 State
->CursorVisible
= Mode
->CursorVisible
!= FALSE
;
426 ConsoleFirmwareTextSetState (
427 _In_ PBL_TEXT_CONSOLE TextConsole
,
429 _In_ PBL_DISPLAY_STATE State
433 ULONG FgColor
, BgColor
, Attribute
, XPos
, YPos
, TextHeight
, TextWidth
;
436 Status
= STATUS_SUCCESS
;
440 FgColor
= State
->FgColor
;
442 if (TextConsole
->State
.FgColor
!= FgColor
)
446 return STATUS_INVALID_PARAMETER
;
449 Attribute
= ConsoleEfiTextGetAttribute(TextConsole
->State
.BgColor
, FgColor
);
450 Status
= EfiConOutSetAttribute(TextConsole
->Protocol
, Attribute
);
453 if (!NT_SUCCESS(Status
))
458 TextConsole
->State
.FgColor
= FgColor
;
464 BgColor
= State
->BgColor
;
465 if (TextConsole
->State
.BgColor
!= BgColor
)
469 return STATUS_INVALID_PARAMETER
;
472 Attribute
= ConsoleEfiTextGetAttribute(BgColor
, TextConsole
->State
.FgColor
);
473 Status
= EfiConOutSetAttribute(TextConsole
->Protocol
, Attribute
);
475 if (!NT_SUCCESS(Status
))
480 TextConsole
->State
.BgColor
= BgColor
;
489 if ((TextConsole
->State
.XPos
!= XPos
) || (TextConsole
->State
.YPos
!= YPos
))
491 BlDisplayGetTextCellResolution(&TextWidth
, &TextHeight
);
492 Status
= EfiConOutSetCursorPosition(TextConsole
->Protocol
,
496 if (!NT_SUCCESS(Status
))
501 TextConsole
->State
.XPos
= XPos
;
502 TextConsole
->State
.YPos
= YPos
;
508 Visible
= State
->CursorVisible
;
509 if (TextConsole
->State
.CursorVisible
!= Visible
)
513 return STATUS_INVALID_PARAMETER
;
516 Status
= EfiConOutEnableCursor(TextConsole
->Protocol
, Visible
);
517 if (!NT_SUCCESS(Status
))
522 TextConsole
->State
.CursorVisible
= Visible
;
530 ConsoleEfiTextFindModeFromAllowed (
531 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE
*TextProtocol
,
532 _In_ PBL_DISPLAY_MODE SupportedModes
,
534 _Out_ PULONG SupportedMode
537 EFI_SIMPLE_TEXT_OUTPUT_MODE ModeInfo
;
538 ULONG MaxMode
, MaxQueriedMode
, Mode
, i
, MatchingMode
;
540 ULONGLONG ModeListSize
;
541 PBL_DISPLAY_MODE ModeEntry
, ModeList
, SupportedModeEntry
;
544 /* Read information on the current mode */
545 EfiConOutReadCurrentMode(TextProtocol
, &ModeInfo
);
547 /* Figure out the max mode, and how many modes we'll have to read */
548 MaxMode
= ModeInfo
.MaxMode
;
549 ModeListSize
= sizeof(*ModeEntry
) * ModeInfo
.MaxMode
;
550 if (ModeListSize
> MAXULONG
)
552 return STATUS_INTEGER_OVERFLOW
;
555 /* Allocate a list for all the supported EFI modes */
556 ModeList
= BlMmAllocateHeap(ModeListSize
);
559 return STATUS_INSUFFICIENT_RESOURCES
;
562 /* Scan all the EFI modes */
563 for (MaxQueriedMode
= 0, Mode
= 0; Mode
< MaxMode
; Mode
++)
565 /* Query information on this mode */
566 ModeEntry
= &ModeList
[MaxQueriedMode
];
567 if (NT_SUCCESS(EfiConOutQueryMode(TextProtocol
,
572 /* This mode was succesfully queried. Save the data */
573 ModeEntry
->HRes
= HRes
;
574 ModeEntry
->VRes
= VRes
;
575 ModeEntry
->HRes2
= HRes
;
576 MaxQueriedMode
= Mode
;
580 /* Loop all the supported mode entries */
581 for (i
= 0; i
< MaxIndex
; i
++)
583 /* Loop all the UEFI queried modes */
584 SupportedModeEntry
= &SupportedModes
[i
];
585 for (MatchingMode
= 0; MatchingMode
< MaxQueriedMode
; MatchingMode
)
587 /* Check if the UEFI mode is compatible with our supported mode */
588 ModeEntry
= &ModeList
[MatchingMode
];
589 if ((ModeEntry
->HRes
== SupportedModeEntry
->HRes
) &&
590 (ModeEntry
->VRes
== SupportedModeEntry
->VRes
))
592 /* Yep -- free the mode list and return this mode */
593 BlMmFreeHeap(ModeList
);
594 *SupportedMode
= MatchingMode
;
595 return STATUS_SUCCESS
;
600 /* We can't do anything -- there are no matching modes */
601 Status
= STATUS_UNSUCCESSFUL
;
602 BlMmFreeHeap(ModeList
);
607 ConsoleFirmwareTextClose (
608 _In_ PBL_TEXT_CONSOLE TextConsole
612 BL_DISPLAY_STATE DisplayState
;
614 /* Read the original mode, and see if it's different than the one now */
615 Mode
= TextConsole
->OldMode
.Mode
;
616 if (Mode
!= TextConsole
->Mode
)
618 /* Restore to the original mode */
619 EfiConOutSetMode(TextConsole
->Protocol
, Mode
);
622 /* Read the EFI settings for the original mode */
623 ConsoleEfiTextGetStateFromMode(&TextConsole
->OldMode
, &DisplayState
);
625 /* Set the original settings */
626 ConsoleFirmwareTextSetState(TextConsole
, 0xF, &DisplayState
);
630 ConsoleFirmwareTextOpen (
631 _In_ PBL_TEXT_CONSOLE TextConsole
634 BL_DISPLAY_MODE DisplayMode
;
635 EFI_SIMPLE_TEXT_OUTPUT_MODE CurrentMode
, NewMode
;
640 /* Read the current mode and its settings */
641 EfiConOutReadCurrentMode(EfiConOut
, &CurrentMode
);
642 Status
= EfiConOutQueryMode(EfiConOut
, CurrentMode
.Mode
, &HRes
, &VRes
);
643 if (!NT_SUCCESS(Status
))
648 /* Save the current mode and its settings */
649 NewMode
= CurrentMode
;
650 DisplayMode
.VRes
= VRes
;
651 DisplayMode
.HRes
= HRes
;
652 DisplayMode
.HRes2
= HRes
;
654 /* Check if the current mode is compatible with one of our modes */
655 if (!ConsolepFindResolution(&DisplayMode
, ConsoleTextResolutionList
, 1))
657 /* It isn't -- find a matching EFI mode for what we need */
658 Status
= ConsoleEfiTextFindModeFromAllowed(EfiConOut
,
659 ConsoleTextResolutionList
,
662 if (!NT_SUCCESS(Status
))
667 /* Set the new EFI mode */
668 Status
= EfiConOutSetMode(EfiConOut
, Mode
);
669 if (!NT_SUCCESS(Status
))
674 /* Read the current mode and its settings */
675 EfiConOutReadCurrentMode(EfiConOut
, &NewMode
);
676 Status
= EfiConOutQueryMode(EfiConOut
, Mode
, &HRes
, &VRes
);
677 if (!NT_SUCCESS(Status
))
679 EfiConOutSetMode(EfiConOut
, CurrentMode
.Mode
);
683 /* Save the current mode and its settings */
684 DisplayMode
.HRes
= HRes
;
685 DisplayMode
.VRes
= VRes
;
686 DisplayMode
.HRes2
= HRes
;
689 /* Capture all the current settings */
690 ConsoleEfiTextGetStateFromMode(&NewMode
, &TextConsole
->State
);
691 TextConsole
->Mode
= NewMode
.Mode
;
692 TextConsole
->DisplayMode
= DisplayMode
;
693 TextConsole
->Protocol
= EfiConOut
;
694 TextConsole
->OldMode
= CurrentMode
;
695 return STATUS_SUCCESS
;
699 ConsoleTextLocalDestruct (
700 _In_
struct _BL_TEXT_CONSOLE
* Console
703 return STATUS_NOT_IMPLEMENTED
;
707 ConsoleTextLocalReinitialize (
708 _In_
struct _BL_TEXT_CONSOLE
* Console
711 return STATUS_NOT_IMPLEMENTED
;
715 ConsoleTextBaseGetTextState (
716 _In_
struct _BL_TEXT_CONSOLE
* Console
,
717 _Out_ PBL_DISPLAY_STATE TextState
720 return STATUS_NOT_IMPLEMENTED
;
724 ConsoleTextLocalSetTextState (
725 _In_
struct _BL_TEXT_CONSOLE
* Console
,
727 _In_ PBL_DISPLAY_STATE TextState
730 return STATUS_NOT_IMPLEMENTED
;
734 ConsoleTextBaseGetTextResolution (
735 _In_
struct _BL_TEXT_CONSOLE
* Console
,
736 _Out_ PULONG TextResolution
739 return STATUS_NOT_IMPLEMENTED
;
743 ConsoleTextLocalSetTextResolution (
744 _In_
struct _BL_TEXT_CONSOLE
* Console
,
745 _In_ ULONG NewTextResolution
,
746 _Out_ PULONG OldTextResolution
749 return STATUS_NOT_IMPLEMENTED
;
753 ConsoleTextLocalClearText (
754 _In_
struct _BL_TEXT_CONSOLE
* Console
,
758 return STATUS_NOT_IMPLEMENTED
;
762 ConsoleTextLocalWriteText (
763 _In_
struct _BL_TEXT_CONSOLE
* Console
,
768 return STATUS_NOT_IMPLEMENTED
;
772 DsppGraphicsDisabledByBcd (
776 EarlyPrint(L
"Disabling graphics\n");
781 ConsoleTextLocalConstruct (
782 _In_ PBL_TEXT_CONSOLE TextConsole
,
783 _In_ BOOLEAN Activate
787 BL_DISPLAY_STATE TextState
;
789 /* Set our callbacks */
790 TextConsole
->Callbacks
= &ConsoleTextLocalVtbl
;
792 /* Are we activating this console? */
795 /* Call firmware to activate it */
796 Status
= ConsoleFirmwareTextOpen(TextConsole
);
797 if (!NT_SUCCESS(Status
))
803 /* Set default text state */
804 TextState
.BgColor
= 0;
807 TextState
.CursorVisible
= FALSE
;
808 TextState
.FgColor
= White
;
810 /* Are we activating? */
813 /* Call firmware to set it */
814 Status
= ConsoleFirmwareTextSetState(TextConsole
, 0xF, &TextState
);
815 if (!NT_SUCCESS(Status
))
817 /* We failed, back down */
818 ConsoleFirmwareTextClose(TextConsole
);
824 /* Just save the state for now, someone else can activate later */
825 TextConsole
->State
= TextState
;
828 /* Remember if we activated it */
829 TextConsole
->Active
= Activate
;
830 return STATUS_SUCCESS
;
838 BL_LIBRARY_PARAMETERS LibraryParameters
= BlpLibraryParameters
;
839 BOOLEAN NoGraphics
;// , HighestMode;
841 PBL_DISPLAY_MODE DisplayMode
;
842 //ULONG GraphicsResolution;
843 PVOID GraphicsConsole
;
844 // PVOID RemoteConsole;
845 PBL_TEXT_CONSOLE TextConsole
;
847 /* Initialize font data */
848 BfiCachedStrikeData
= 0;
849 InitializeListHead(&BfiDeferredListHead
);
850 InitializeListHead(&BfiFontFileListHead
);
852 /* Allocate the font rectangle */
853 BfiGraphicsRectangle
= BlMmAllocateHeap(0x5A);
854 if (!BfiGraphicsRectangle
)
856 return STATUS_NO_MEMORY
;
859 /* Display re-initialization not yet handled */
860 if (LibraryParameters
.LibraryFlags
& BL_LIBRARY_FLAG_REINITIALIZE_ALL
)
862 EarlyPrint(L
"Display path not handled\n");
863 return STATUS_NOT_SUPPORTED
;
866 /* Check if no graphics console is needed */
867 if ((Flags
& BL_LIBRARY_FLAG_NO_GRAPHICS_CONSOLE
) ||
868 (DsppGraphicsDisabledByBcd()))
875 /* No graphics -- remember this */
879 /* On first load, we always initialize a graphics display */
880 GraphicsConsole
= NULL
;
881 if (!(Flags
& BL_LIBRARY_FLAG_REINITIALIZE_ALL
) || !(NoGraphics
))
883 /* Default to mode 0 (1024x768) */
884 DisplayMode
= &ConsoleGraphicalResolutionList
[0];
886 /* Check what resolution to use*/
888 Status
= BlGetBootOptionInteger(BlpApplicationEntry
.BcdData
,
889 BcdLibraryInteger_GraphicsResolution
,
890 &GraphicsResolution
);
892 //GraphicsResolution = 0;
893 Status
= STATUS_NOT_FOUND
;
895 if (NT_SUCCESS(Status
))
897 EarlyPrint(L
"Display selection not yet handled\n");
898 return STATUS_NOT_IMPLEMENTED
;
901 /* Check if the highest mode should be forced */
903 Status
= BlGetBootOptionBoolean(BlpApplicationEntry
.BcdData
,
904 BcdLibraryBoolean_GraphicsForceHighestMode
,
908 Status
= STATUS_NOT_FOUND
;
910 if (NT_SUCCESS(Status
))
912 ConsoleGraphicalResolutionListFlags
|= 2;
915 /* Do we need graphics mode after all? */
918 EarlyPrint(L
"Display path not handled\n");
919 return STATUS_NOT_SUPPORTED
;
922 /* Are we using something else than the default mode? */
923 if (DisplayMode
!= &ConsoleGraphicalResolutionList
[0])
925 EarlyPrint(L
"Display path not handled\n");
926 return STATUS_NOT_SUPPORTED
;
929 /* Mask out all the flags now */
930 ConsoleGraphicalResolutionListFlags
&= ~3;
933 /* Do we have a graphics console? */
935 if (!GraphicsConsole
)
937 /* Nope -- go allocate a text console */
938 TextConsole
= BlMmAllocateHeap(sizeof(*TextConsole
));
942 Status
= ConsoleTextLocalConstruct(TextConsole
, TRUE
);
943 if (!NT_SUCCESS(Status
))
945 BlMmFreeHeap(TextConsole
);
951 /* Initialize all globals to NULL */
952 DspRemoteInputConsole
= NULL
;
953 DspTextConsole
= NULL
;
954 DspGraphicalConsole
= NULL
;
956 /* If we don't have a text console, go get a remote console */
957 //RemoteConsole = NULL;
960 EarlyPrint(L
"Display path not handled\n");
961 return STATUS_NOT_SUPPORTED
;
964 /* Do we have a remote console? */
965 if (!DspRemoteInputConsole
)
967 /* Nope -- what about a graphical one? */
970 /* Yes, use it for both graphics and text */
971 DspGraphicalConsole
= GraphicsConsole
;
972 DspTextConsole
= GraphicsConsole
;
974 else if (TextConsole
)
976 /* Nope, but we have a text console */
977 DspTextConsole
= TextConsole
;
980 /* Console has been setup */
981 return STATUS_SUCCESS
;
984 /* We have a remote console -- have to figure out how to use it*/
985 EarlyPrint(L
"Display path not handled\n");
986 return STATUS_NOT_SUPPORTED
;
990 BlpDisplayInitialize (
996 /* Are we resetting or initializing? */
997 if (Flags
& BL_LIBRARY_FLAG_REINITIALIZE
)
999 /* This is a reset */
1000 Status
= STATUS_NOT_IMPLEMENTED
;
1002 Status
= DsppReinitialize(Flags
);
1003 if (NT_SUCCESS(Status
))
1005 Status
= BlpDisplayReinitialize();
1011 /* Initialize the display */
1012 Status
= DsppInitialize(Flags
);
1015 /* Return display initailziation state */
1020 BlDisplayGetTextCellResolution (
1021 _Out_ PULONG TextWidth
,
1022 _Out_ PULONG TextHeight
1027 /* If the caller doesn't want anything, bail out */
1028 if (!(TextWidth
) || !(TextHeight
))
1033 /* Do we have a text console? */
1034 Status
= STATUS_UNSUCCESSFUL
;
1037 /* Do we have a graphics console? */
1038 if (DspGraphicalConsole
)
1040 /* Yep -- query it */
1041 EarlyPrint(L
"Not supported\n");
1042 Status
= STATUS_NOT_IMPLEMENTED
;
1046 /* Check if we failed to get it from the graphics console */
1047 if (!NT_SUCCESS(Status
))
1049 /* Set default text size */