TianoCore EDK2 master
|
#include "GraphicsConsole.h"
Go to the source code of this file.
Variables | |
GRAPHICS_CONSOLE_DEV | mGraphicsConsoleDevTemplate |
GRAPHICS_CONSOLE_MODE_DATA | mGraphicsConsoleModeData [] |
EFI_HII_DATABASE_PROTOCOL * | mHiiDatabase |
EFI_HII_FONT_PROTOCOL * | mHiiFont |
EFI_HII_HANDLE | mHiiHandle |
VOID * | mHiiRegistration |
EFI_GUID | mFontPackageListGuid |
CHAR16 | mCrLfString [3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL } |
EFI_GRAPHICS_OUTPUT_BLT_PIXEL | mGraphicsEfiColors [16] |
EFI_NARROW_GLYPH | mCursorGlyph |
CHAR16 | SpaceStr [] = { NARROW_CHAR, ' ', 0 } |
EFI_DRIVER_BINDING_PROTOCOL | gGraphicsConsoleDriverBinding |
This is the main routine for initializing the Graphics Console support routines.
Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file GraphicsConsole.c.
EFI_STATUS CheckModeSupported | ( | EFI_GRAPHICS_OUTPUT_PROTOCOL * | GraphicsOutput, |
IN UINT32 | HorizontalResolution, | ||
IN UINT32 | VerticalResolution, | ||
OUT UINT32 * | CurrentModeNumber | ||
) |
Check if the current specific mode supported the user defined resolution for the Graphics Console device based on Graphics Output Protocol.
If yes, set the graphic device's current mode to this specific mode.
GraphicsOutput | Graphics Output Protocol instance pointer. |
HorizontalResolution | User defined horizontal resolution |
VerticalResolution | User defined vertical resolution. |
CurrentModeNumber | Current specific mode to be check. |
EFI_SUCCESS | The mode is supported. |
EFI_UNSUPPORTED | The specific mode is out of range of graphics device supported. |
other | The specific mode does not support user defined resolution or failed to set the current mode to the specific mode on graphics device. |
Definition at line 784 of file GraphicsConsole.c.
EFI_STATUS DrawUnicodeWeightAtCursorN | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN CHAR16 * | UnicodeWeight, | ||
IN UINTN | Count | ||
) |
Draw Unicode string on the Graphics Console device's screen.
This | Protocol instance pointer. |
UnicodeWeight | One Unicode string to be displayed. |
Count | The count of Unicode string. |
EFI_OUT_OF_RESOURCES | If no memory resource to use. |
EFI_UNSUPPORTED | If no Graphics Output protocol and UGA Draw protocol exist. |
EFI_SUCCESS | Drawing Unicode string implemented successfully. |
Definition at line 1773 of file GraphicsConsole.c.
EFI_STATUS EfiLocateHiiProtocol | ( | VOID | ) |
Locate HII Database protocol and HII Font protocol.
EFI_SUCCESS | HII Database protocol and HII Font protocol are located successfully. |
Definition at line 850 of file GraphicsConsole.c.
EFI_STATUS FlushCursor | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This | ) |
Flush the cursor on the screen.
If CursorVisible is FALSE, nothing to do and return directly. If CursorVisible is TRUE, i) If the cursor shows on screen, it will be erased. ii) If the cursor does not show on screen, it will be shown.
This | Protocol instance pointer. |
EFI_SUCCESS | The cursor is erased successfully. |
Definition at line 1928 of file GraphicsConsole.c.
EFI_STATUS GetTextColors | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL * | Foreground, | ||
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL * | Background | ||
) |
Gets Graphics Console device's foreground color and background color.
This | Protocol instance pointer. |
Foreground | Returned text foreground color. |
Background | Returned text background color. |
EFI_SUCCESS | It returned always. |
Definition at line 1743 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutClearScreen | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This | ) |
Clears the output device(s) display to the currently selected background color.
Implements SIMPLE_TEXT_OUTPUT.ClearScreen().
This | Protocol instance pointer. |
EFI_SUCCESS | The operation completed successfully. |
EFI_DEVICE_ERROR | The device had an error and could not complete the request. |
EFI_UNSUPPORTED | The output device is not in a valid text mode. |
Definition at line 1553 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutEnableCursor | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN BOOLEAN | Visible | ||
) |
Makes the cursor visible or invisible.
Implements SIMPLE_TEXT_OUTPUT.EnableCursor().
This | Protocol instance pointer. |
Visible | If TRUE, the cursor is set to be visible, If FALSE, the cursor is set to be invisible. |
EFI_SUCCESS | The operation completed successfully. |
EFI_UNSUPPORTED | The output device's mode is not currently in a defined text mode. |
Definition at line 1706 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutOutputString | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN CHAR16 * | WString | ||
) |
Write a Unicode string to the output device.
Implements SIMPLE_TEXT_OUTPUT.OutputString(). The Unicode string will be converted to Glyphs and will be sent to the Graphics Console.
This | Protocol instance pointer. |
WString | The NULL-terminated Unicode string to be displayed on the output device(s). All output devices must also support the Unicode drawing defined in this file. |
EFI_SUCCESS | The string was output to the device. |
EFI_DEVICE_ERROR | The device reported an error while attempting to output the text. |
EFI_UNSUPPORTED | The output device's mode is not currently in a defined text mode. |
EFI_WARN_UNKNOWN_GLYPH | This warning code indicates that some of the characters in the Unicode string could not be rendered and were skipped. |
Definition at line 929 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutQueryMode | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | ModeNumber, | ||
OUT UINTN * | Columns, | ||
OUT UINTN * | Rows | ||
) |
Returns information for an available text mode that the output device(s) supports
Implements SIMPLE_TEXT_OUTPUT.QueryMode(). It returnes information for an available text mode that the Graphics Console supports. In this driver,we only support text mode 80x25, which is defined as mode 0.
This | Protocol instance pointer. |
ModeNumber | The mode number to return information on. |
Columns | The returned columns of the requested mode. |
Rows | The returned rows of the requested mode. |
EFI_SUCCESS | The requested mode information is returned. |
EFI_UNSUPPORTED | The mode number is not valid. |
Definition at line 1264 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutReset | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification | ||
) |
Reset the text output device hardware and optionally run diagnostics.
Implements SIMPLE_TEXT_OUTPUT.Reset(). If ExtendedVerification is TRUE, then perform dependent Graphics Console device reset, and set display mode to mode 0. If ExtendedVerification is FALSE, only set display mode to mode 0.
This | Protocol instance pointer. |
ExtendedVerification | Indicates that the driver may perform a more exhaustive verification operation of the device during reset. |
EFI_SUCCESS | The text output device was reset. |
EFI_DEVICE_ERROR | The text output device is not functioning correctly and could not be reset. |
Definition at line 889 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutSetAttribute | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | Attribute | ||
) |
Sets the background and foreground colors for the OutputString () and ClearScreen () functions.
Implements SIMPLE_TEXT_OUTPUT.SetAttribute().
This | Protocol instance pointer. |
Attribute | The attribute to set. Bits 0..3 are the foreground color, and bits 4..6 are the background color. All other bits are undefined and must be zero. |
EFI_SUCCESS | The requested attribute is set. |
EFI_DEVICE_ERROR | The requested attribute cannot be set due to Graphics Console port error. |
EFI_UNSUPPORTED | The attribute requested is not defined. |
Definition at line 1510 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutSetCursorPosition | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | Column, | ||
IN UINTN | Row | ||
) |
Sets the current coordinates of the cursor position.
Implements SIMPLE_TEXT_OUTPUT.SetCursorPosition().
This | Protocol instance pointer. |
Column | The position to set the cursor to. Must be greater than or equal to zero and less than the number of columns and rows by QueryMode (). |
Row | The position to set the cursor to. Must be greater than or equal to zero and less than the number of columns and rows by QueryMode (). |
EFI_SUCCESS | The operation completed successfully. |
EFI_DEVICE_ERROR | The device had an error and could not complete the request. |
EFI_UNSUPPORTED | The output device is not in a valid text mode, or the cursor position is invalid for the current mode. |
Definition at line 1642 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutSetMode | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN UINTN | ModeNumber | ||
) |
Sets the output device(s) to a specified mode.
Implements SIMPLE_TEXT_OUTPUT.SetMode(). Set the Graphics Console to a specified mode. In this driver, we only support mode 0.
This | Protocol instance pointer. |
ModeNumber | The text mode to set. |
EFI_SUCCESS | The requested text mode is set. |
EFI_DEVICE_ERROR | The requested text mode cannot be set because of Graphics Console device error. |
EFI_UNSUPPORTED | The text mode number is not valid. |
Definition at line 1314 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleConOutTestString | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | This, |
IN CHAR16 * | WString | ||
) |
Verifies that all characters in a Unicode string can be output to the target device.
Implements SIMPLE_TEXT_OUTPUT.TestString(). If one of the characters in the *Wstring is neither valid valid Unicode drawing characters, not ASCII code, then this function will return EFI_UNSUPPORTED
This | Protocol instance pointer. |
WString | The NULL-terminated Unicode string to be examined for the output device(s). |
EFI_SUCCESS | The device(s) are capable of rendering the output string. |
EFI_UNSUPPORTED | Some of the characters in the Unicode string cannot be rendered by one or more of the output devices mapped by the EFI handle. |
Definition at line 1209 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleControllerDriverStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Start this driver on Controller by opening Graphics Output protocol or UGA Draw protocol, and installing Simple Text Out protocol on Controller. (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
This | Protocol instance pointer. |
Controller | Handle of device to bind driver to |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver is added to Controller. |
other | This driver does not support this device. |
Definition at line 387 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleControllerDriverStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop this driver on Controller by removing Simple Text Out protocol and closing the Graphics Output Protocol or UGA Draw protocol on Controller. (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
This | Protocol instance pointer. |
Controller | Handle of device to stop driver on |
NumberOfChildren | Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver. |
ChildHandleBuffer | List of Child Handles to Stop. |
EFI_SUCCESS | This driver is removed Controller. |
EFI_NOT_STARTED | Simple Text Out protocol could not be found the Controller. |
other | This driver was not removed from this device. |
Definition at line 696 of file GraphicsConsole.c.
EFI_STATUS EFIAPI GraphicsConsoleControllerDriverSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Test to see if Graphics Console could be supported on the Controller.
Graphics Console could be supported if Graphics Output Protocol or UGA Draw Protocol exists on the Controller. (UGA Draw Protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
This | Protocol instance pointer. |
Controller | Handle of device to test. |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver supports this device. |
other | This driver does not support this device. |
Definition at line 122 of file GraphicsConsole.c.
EFI_STATUS EFIAPI InitializeGraphicsConsole | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The user Entry Point for module GraphicsConsole. The user code starts with this function.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
Definition at line 2123 of file GraphicsConsole.c.
EFI_STATUS InitializeGraphicsConsoleTextMode | ( | IN UINT32 | HorizontalResolution, |
IN UINT32 | VerticalResolution, | ||
IN UINT32 | GopModeNumber, | ||
OUT UINTN * | TextModeCount, | ||
OUT GRAPHICS_CONSOLE_MODE_DATA ** | TextModeData | ||
) |
Initialize all the text modes which the graphics console supports.
It returns information for available text modes that the graphics can support.
[in] | HorizontalResolution | The size of video screen in pixels in the X dimension. |
[in] | VerticalResolution | The size of video screen in pixels in the Y dimension. |
[in] | GopModeNumber | The graphics mode number which graphics console is based on. |
[out] | TextModeCount | The total number of text modes that graphics console supports. |
[out] | TextModeData | The buffer to the text modes column and row information. Caller is responsible to free it when it's non-NULL. |
EFI_SUCCESS | The supporting mode information is returned. |
EFI_INVALID_PARAMETER | The parameters are invalid. |
Definition at line 234 of file GraphicsConsole.c.
HII Database Protocol notification event handler.
Register font package when HII Database Protocol has been installed.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 2044 of file GraphicsConsole.c.
EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding |
Definition at line 95 of file GraphicsConsole.c.
CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL } |
Definition at line 63 of file GraphicsConsole.c.
EFI_NARROW_GLYPH mCursorGlyph |
Definition at line 87 of file GraphicsConsole.c.
EFI_GUID mFontPackageListGuid |
Definition at line 59 of file GraphicsConsole.c.
GRAPHICS_CONSOLE_DEV mGraphicsConsoleDevTemplate |
Definition at line 14 of file GraphicsConsole.c.
GRAPHICS_CONSOLE_MODE_DATA mGraphicsConsoleModeData[] |
Definition at line 42 of file GraphicsConsole.c.
EFI_GRAPHICS_OUTPUT_BLT_PIXEL mGraphicsEfiColors[16] |
Definition at line 65 of file GraphicsConsole.c.
EFI_HII_DATABASE_PROTOCOL* mHiiDatabase |
Definition at line 54 of file GraphicsConsole.c.
EFI_HII_FONT_PROTOCOL* mHiiFont |
Definition at line 55 of file GraphicsConsole.c.
EFI_HII_HANDLE mHiiHandle |
Definition at line 56 of file GraphicsConsole.c.
VOID* mHiiRegistration |
Definition at line 57 of file GraphicsConsole.c.
CHAR16 SpaceStr[] = { NARROW_CHAR, ' ', 0 } |
Definition at line 93 of file GraphicsConsole.c.