]>
Commit | Line | Data |
---|---|---|
fb0b259e | 1 | /** @file\r |
2 | Header file for GraphicsConsole driver.\r | |
95276127 | 3 | \r |
d1102dba | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
95276127 | 6 | \r |
fb0b259e | 7 | **/\r |
95276127 | 8 | \r |
6dcf9abc | 9 | #ifndef _GRAPHICS_CONSOLE_H_\r |
10 | #define _GRAPHICS_CONSOLE_H_\r | |
95276127 | 11 | \r |
60c93673 | 12 | #include <Uefi.h>\r |
97a079ed A |
13 | #include <Protocol/SimpleTextOut.h>\r |
14 | #include <Protocol/GraphicsOutput.h>\r | |
15 | #include <Protocol/UgaDraw.h>\r | |
16 | #include <Protocol/DevicePath.h>\r | |
17 | #include <Library/DebugLib.h>\r | |
18 | #include <Library/UefiDriverEntryPoint.h>\r | |
19 | #include <Library/UefiLib.h>\r | |
97a079ed A |
20 | #include <Library/BaseMemoryLib.h>\r |
21 | #include <Library/MemoryAllocationLib.h>\r | |
22 | #include <Library/UefiBootServicesTableLib.h>\r | |
93e3992d | 23 | #include <Library/HiiLib.h>\r |
24 | #include <Library/BaseLib.h>\r | |
8541adab | 25 | #include <Library/PcdLib.h>\r |
93e3992d | 26 | \r |
5c526736 | 27 | #include <Guid/MdeModuleHii.h>\r |
93e3992d | 28 | \r |
29 | #include <Protocol/HiiFont.h>\r | |
30 | #include <Protocol/HiiDatabase.h>\r | |
97a079ed | 31 | \r |
5bca971e | 32 | extern EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName;\r |
33 | extern EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2;\r | |
878670ea | 34 | extern EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding;\r |
35 | extern EFI_NARROW_GLYPH gUsStdNarrowGlyphData[];\r | |
36 | \r | |
1436aea4 | 37 | extern UINT32 mNarrowFontSize;\r |
878670ea | 38 | \r |
39 | typedef union {\r | |
1436aea4 MK |
40 | EFI_NARROW_GLYPH NarrowGlyph;\r |
41 | EFI_WIDE_GLYPH WideGlyph;\r | |
878670ea | 42 | } GLYPH_UNION;\r |
43 | \r | |
44 | //\r | |
45 | // Device Structure\r | |
46 | //\r | |
47 | #define GRAPHICS_CONSOLE_DEV_SIGNATURE SIGNATURE_32 ('g', 's', 't', 'o')\r | |
48 | \r | |
49 | typedef struct {\r | |
1436aea4 MK |
50 | UINTN Columns;\r |
51 | UINTN Rows;\r | |
52 | INTN DeltaX;\r | |
53 | INTN DeltaY;\r | |
54 | UINT32 GopWidth;\r | |
55 | UINT32 GopHeight;\r | |
56 | UINT32 GopModeNumber;\r | |
878670ea | 57 | } GRAPHICS_CONSOLE_MODE_DATA;\r |
58 | \r | |
878670ea | 59 | typedef struct {\r |
1436aea4 MK |
60 | UINTN Signature;\r |
61 | EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r | |
62 | EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r | |
63 | EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;\r | |
64 | EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;\r | |
65 | GRAPHICS_CONSOLE_MODE_DATA *ModeData;\r | |
66 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL *LineBuffer;\r | |
878670ea | 67 | } GRAPHICS_CONSOLE_DEV;\r |
68 | \r | |
69 | #define GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS(a) \\r | |
70 | CR (a, GRAPHICS_CONSOLE_DEV, SimpleTextOutput, GRAPHICS_CONSOLE_DEV_SIGNATURE)\r | |
71 | \r | |
95276127 | 72 | //\r |
97a079ed | 73 | // EFI Component Name Functions\r |
95276127 | 74 | //\r |
1436aea4 | 75 | \r |
5bca971e | 76 | /**\r |
77 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
78 | \r | |
79 | This function retrieves the user readable name of a driver in the form of a\r | |
80 | Unicode string. If the driver specified by This has a user readable name in\r | |
81 | the language specified by Language, then a pointer to the driver name is\r | |
82 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
83 | by This does not support the language specified by Language,\r | |
84 | then EFI_UNSUPPORTED is returned.\r | |
85 | \r | |
86 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
87 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
88 | \r | |
89 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
90 | array indicating the language. This is the\r | |
91 | language of the driver name that the caller is\r | |
92 | requesting, and it must match one of the\r | |
93 | languages specified in SupportedLanguages. The\r | |
94 | number of languages supported by a driver is up\r | |
95 | to the driver writer. Language is specified\r | |
0254efc0 | 96 | in RFC 4646 or ISO 639-2 language code format.\r |
5bca971e | 97 | \r |
98 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
99 | This Unicode string is the name of the\r | |
100 | driver specified by This in the language\r | |
101 | specified by Language.\r | |
102 | \r | |
103 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
104 | This and the language specified by Language was\r | |
105 | returned in DriverName.\r | |
106 | \r | |
107 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
108 | \r | |
109 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
110 | \r | |
111 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
112 | the language specified by Language.\r | |
113 | \r | |
114 | **/\r | |
97a079ed A |
115 | EFI_STATUS\r |
116 | EFIAPI\r | |
117 | GraphicsConsoleComponentNameGetDriverName (\r | |
118 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
119 | IN CHAR8 *Language,\r | |
120 | OUT CHAR16 **DriverName\r | |
121 | );\r | |
122 | \r | |
5bca971e | 123 | /**\r |
124 | Retrieves a Unicode string that is the user readable name of the controller\r | |
125 | that is being managed by a driver.\r | |
126 | \r | |
127 | This function retrieves the user readable name of the controller specified by\r | |
128 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
129 | driver specified by This has a user readable name in the language specified by\r | |
130 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
131 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
132 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
133 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
134 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
135 | \r | |
136 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
137 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
138 | \r | |
139 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
140 | specified by This is managing. This handle\r | |
141 | specifies the controller whose name is to be\r | |
142 | returned.\r | |
143 | \r | |
144 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
145 | the name of. This is an optional parameter that\r | |
146 | may be NULL. It will be NULL for device\r | |
147 | drivers. It will also be NULL for a bus drivers\r | |
148 | that wish to retrieve the name of the bus\r | |
149 | controller. It will not be NULL for a bus\r | |
150 | driver that wishes to retrieve the name of a\r | |
151 | child controller.\r | |
152 | \r | |
153 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
154 | array indicating the language. This is the\r | |
155 | language of the driver name that the caller is\r | |
156 | requesting, and it must match one of the\r | |
157 | languages specified in SupportedLanguages. The\r | |
158 | number of languages supported by a driver is up\r | |
159 | to the driver writer. Language is specified in\r | |
0254efc0 | 160 | RFC 4646 or ISO 639-2 language code format.\r |
5bca971e | 161 | \r |
162 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
163 | This Unicode string is the name of the\r | |
164 | controller specified by ControllerHandle and\r | |
165 | ChildHandle in the language specified by\r | |
166 | Language from the point of view of the driver\r | |
167 | specified by This.\r | |
168 | \r | |
169 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
170 | the language specified by Language for the\r | |
171 | driver specified by This was returned in\r | |
172 | DriverName.\r | |
173 | \r | |
284ee2e8 | 174 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
5bca971e | 175 | \r |
176 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
177 | EFI_HANDLE.\r | |
178 | \r | |
179 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
180 | \r | |
181 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
182 | \r | |
183 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
184 | managing the controller specified by\r | |
185 | ControllerHandle and ChildHandle.\r | |
186 | \r | |
187 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
188 | the language specified by Language.\r | |
189 | \r | |
190 | **/\r | |
97a079ed A |
191 | EFI_STATUS\r |
192 | EFIAPI\r | |
193 | GraphicsConsoleComponentNameGetControllerName (\r | |
1436aea4 MK |
194 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r |
195 | IN EFI_HANDLE ControllerHandle,\r | |
196 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
197 | IN CHAR8 *Language,\r | |
198 | OUT CHAR16 **ControllerName\r | |
97a079ed | 199 | );\r |
95276127 | 200 | \r |
6dcf9abc | 201 | /**\r |
7601dbe7 | 202 | Reset the text output device hardware and optionally run diagnostics.\r |
d1102dba | 203 | \r |
6dcf9abc | 204 | Implements SIMPLE_TEXT_OUTPUT.Reset().\r |
e61088c8 | 205 | If ExtendedVerification is TRUE, then perform dependent Graphics Console\r |
6dcf9abc | 206 | device reset, and set display mode to mode 0.\r |
207 | If ExtendedVerification is FALSE, only set display mode to mode 0.\r | |
208 | \r | |
7601dbe7 | 209 | @param This Protocol instance pointer.\r |
6dcf9abc | 210 | @param ExtendedVerification Indicates that the driver may perform a more\r |
211 | exhaustive verification operation of the device\r | |
212 | during reset.\r | |
213 | \r | |
7601dbe7 | 214 | @retval EFI_SUCCESS The text output device was reset.\r |
215 | @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and\r | |
216 | could not be reset.\r | |
95276127 | 217 | \r |
6dcf9abc | 218 | **/\r |
95276127 | 219 | EFI_STATUS\r |
220 | EFIAPI\r | |
221 | GraphicsConsoleConOutReset (\r | |
1436aea4 MK |
222 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
223 | IN BOOLEAN ExtendedVerification\r | |
95276127 | 224 | );\r |
225 | \r | |
6dcf9abc | 226 | /**\r |
24248368 | 227 | Write a Unicode string to the output device.\r |
228 | \r | |
d1102dba | 229 | Implements SIMPLE_TEXT_OUTPUT.OutputString().\r |
6dcf9abc | 230 | The Unicode string will be converted to Glyphs and will be\r |
231 | sent to the Graphics Console.\r | |
232 | \r | |
24248368 | 233 | @param This Protocol instance pointer.\r |
234 | @param WString The NULL-terminated Unicode string to be displayed\r | |
235 | on the output device(s). All output devices must\r | |
236 | also support the Unicode drawing defined in this file.\r | |
6dcf9abc | 237 | \r |
24248368 | 238 | @retval EFI_SUCCESS The string was output to the device.\r |
239 | @retval EFI_DEVICE_ERROR The device reported an error while attempting to output\r | |
240 | the text.\r | |
241 | @retval EFI_UNSUPPORTED The output device's mode is not currently in a\r | |
242 | defined text mode.\r | |
243 | @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the\r | |
244 | characters in the Unicode string could not be\r | |
245 | rendered and were skipped.\r | |
6dcf9abc | 246 | \r |
247 | **/\r | |
95276127 | 248 | EFI_STATUS\r |
249 | EFIAPI\r | |
250 | GraphicsConsoleConOutOutputString (\r | |
251 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
252 | IN CHAR16 *WString\r | |
253 | );\r | |
254 | \r | |
6dcf9abc | 255 | /**\r |
d1102dba | 256 | Verifies that all characters in a Unicode string can be output to the\r |
5c03ed0a | 257 | target device.\r |
258 | \r | |
6dcf9abc | 259 | Implements SIMPLE_TEXT_OUTPUT.TestString().\r |
5c03ed0a | 260 | If one of the characters in the *Wstring is neither valid valid Unicode\r |
261 | drawing characters, not ASCII code, then this function will return\r | |
262 | EFI_UNSUPPORTED\r | |
6dcf9abc | 263 | \r |
5c03ed0a | 264 | @param This Protocol instance pointer.\r |
265 | @param WString The NULL-terminated Unicode string to be examined for the output\r | |
266 | device(s).\r | |
6dcf9abc | 267 | \r |
5c03ed0a | 268 | @retval EFI_SUCCESS The device(s) are capable of rendering the output string.\r |
269 | @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be\r | |
270 | rendered by one or more of the output devices mapped\r | |
271 | by the EFI handle.\r | |
6dcf9abc | 272 | \r |
273 | **/\r | |
95276127 | 274 | EFI_STATUS\r |
275 | EFIAPI\r | |
276 | GraphicsConsoleConOutTestString (\r | |
277 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
278 | IN CHAR16 *WString\r | |
279 | );\r | |
280 | \r | |
6dcf9abc | 281 | /**\r |
24248368 | 282 | Returns information for an available text mode that the output device(s)\r |
283 | supports\r | |
284 | \r | |
6dcf9abc | 285 | Implements SIMPLE_TEXT_OUTPUT.QueryMode().\r |
e61088c8 | 286 | It returns information for an available text mode that the Graphics Console supports.\r |
24248368 | 287 | In this driver,we only support text mode 80x25, which is defined as mode 0.\r |
6dcf9abc | 288 | \r |
24248368 | 289 | @param This Protocol instance pointer.\r |
6dcf9abc | 290 | @param ModeNumber The mode number to return information on.\r |
291 | @param Columns The returned columns of the requested mode.\r | |
292 | @param Rows The returned rows of the requested mode.\r | |
293 | \r | |
24248368 | 294 | @retval EFI_SUCCESS The requested mode information is returned.\r |
295 | @retval EFI_UNSUPPORTED The mode number is not valid.\r | |
6dcf9abc | 296 | \r |
297 | **/\r | |
95276127 | 298 | EFI_STATUS\r |
299 | EFIAPI\r | |
300 | GraphicsConsoleConOutQueryMode (\r | |
301 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
302 | IN UINTN ModeNumber,\r | |
303 | OUT UINTN *Columns,\r | |
304 | OUT UINTN *Rows\r | |
305 | );\r | |
306 | \r | |
6dcf9abc | 307 | /**\r |
24248368 | 308 | Sets the output device(s) to a specified mode.\r |
d1102dba | 309 | \r |
6dcf9abc | 310 | Implements SIMPLE_TEXT_OUTPUT.SetMode().\r |
24248368 | 311 | Set the Graphics Console to a specified mode. In this driver, we only support mode 0.\r |
6dcf9abc | 312 | \r |
24248368 | 313 | @param This Protocol instance pointer.\r |
6dcf9abc | 314 | @param ModeNumber The text mode to set.\r |
315 | \r | |
24248368 | 316 | @retval EFI_SUCCESS The requested text mode is set.\r |
d1102dba | 317 | @retval EFI_DEVICE_ERROR The requested text mode cannot be set because of\r |
24248368 | 318 | Graphics Console device error.\r |
319 | @retval EFI_UNSUPPORTED The text mode number is not valid.\r | |
6dcf9abc | 320 | \r |
321 | **/\r | |
95276127 | 322 | EFI_STATUS\r |
323 | EFIAPI\r | |
324 | GraphicsConsoleConOutSetMode (\r | |
325 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
326 | IN UINTN ModeNumber\r | |
327 | );\r | |
328 | \r | |
6dcf9abc | 329 | /**\r |
5c03ed0a | 330 | Sets the background and foreground colors for the OutputString () and\r |
331 | ClearScreen () functions.\r | |
332 | \r | |
6dcf9abc | 333 | Implements SIMPLE_TEXT_OUTPUT.SetAttribute().\r |
334 | \r | |
5c03ed0a | 335 | @param This Protocol instance pointer.\r |
336 | @param Attribute The attribute to set. Bits 0..3 are the foreground\r | |
d1102dba | 337 | color, and bits 4..6 are the background color.\r |
5c03ed0a | 338 | All other bits are undefined and must be zero.\r |
6dcf9abc | 339 | \r |
5c03ed0a | 340 | @retval EFI_SUCCESS The requested attribute is set.\r |
341 | @retval EFI_DEVICE_ERROR The requested attribute cannot be set due to Graphics Console port error.\r | |
342 | @retval EFI_UNSUPPORTED The attribute requested is not defined.\r | |
6dcf9abc | 343 | \r |
344 | **/\r | |
95276127 | 345 | EFI_STATUS\r |
346 | EFIAPI\r | |
347 | GraphicsConsoleConOutSetAttribute (\r | |
348 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
349 | IN UINTN Attribute\r | |
350 | );\r | |
351 | \r | |
6dcf9abc | 352 | /**\r |
d1102dba | 353 | Clears the output device(s) display to the currently selected background\r |
24248368 | 354 | color.\r |
355 | \r | |
6dcf9abc | 356 | Implements SIMPLE_TEXT_OUTPUT.ClearScreen().\r |
6dcf9abc | 357 | \r |
24248368 | 358 | @param This Protocol instance pointer.\r |
6dcf9abc | 359 | \r |
24248368 | 360 | @retval EFI_SUCCESS The operation completed successfully.\r |
361 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
362 | @retval EFI_UNSUPPORTED The output device is not in a valid text mode.\r | |
6dcf9abc | 363 | \r |
364 | **/\r | |
95276127 | 365 | EFI_STATUS\r |
366 | EFIAPI\r | |
367 | GraphicsConsoleConOutClearScreen (\r | |
368 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r | |
369 | );\r | |
370 | \r | |
6dcf9abc | 371 | /**\r |
5c03ed0a | 372 | Sets the current coordinates of the cursor position.\r |
373 | \r | |
6dcf9abc | 374 | Implements SIMPLE_TEXT_OUTPUT.SetCursorPosition().\r |
375 | \r | |
5c03ed0a | 376 | @param This Protocol instance pointer.\r |
377 | @param Column The position to set the cursor to. Must be greater than or\r | |
378 | equal to zero and less than the number of columns and rows\r | |
379 | by QueryMode ().\r | |
380 | @param Row The position to set the cursor to. Must be greater than or\r | |
381 | equal to zero and less than the number of columns and rows\r | |
382 | by QueryMode ().\r | |
6dcf9abc | 383 | \r |
5c03ed0a | 384 | @retval EFI_SUCCESS The operation completed successfully.\r |
385 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
386 | @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the\r | |
387 | cursor position is invalid for the current mode.\r | |
6dcf9abc | 388 | \r |
389 | **/\r | |
95276127 | 390 | EFI_STATUS\r |
391 | EFIAPI\r | |
392 | GraphicsConsoleConOutSetCursorPosition (\r | |
393 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
394 | IN UINTN Column,\r | |
395 | IN UINTN Row\r | |
396 | );\r | |
397 | \r | |
6dcf9abc | 398 | /**\r |
24248368 | 399 | Makes the cursor visible or invisible.\r |
400 | \r | |
6dcf9abc | 401 | Implements SIMPLE_TEXT_OUTPUT.EnableCursor().\r |
6dcf9abc | 402 | \r |
24248368 | 403 | @param This Protocol instance pointer.\r |
6dcf9abc | 404 | @param Visible If TRUE, the cursor is set to be visible, If FALSE,\r |
405 | the cursor is set to be invisible.\r | |
406 | \r | |
24248368 | 407 | @retval EFI_SUCCESS The operation completed successfully.\r |
6dcf9abc | 408 | \r |
409 | **/\r | |
95276127 | 410 | EFI_STATUS\r |
411 | EFIAPI\r | |
412 | GraphicsConsoleConOutEnableCursor (\r | |
413 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
414 | IN BOOLEAN Visible\r | |
415 | );\r | |
416 | \r | |
24248368 | 417 | /**\r |
8595bdaf | 418 | Test to see if Graphics Console could be supported on the Controller.\r |
24248368 | 419 | \r |
e61088c8 | 420 | Graphics Console could be supported if Graphics Output Protocol or UGADraw\r |
8595bdaf | 421 | Protocol exists on the Controller. (UGA Draw Protocol could be skipped\r |
24248368 | 422 | if PcdUgaConsumeSupport is set to FALSE.)\r |
423 | \r | |
424 | @param This Protocol instance pointer.\r | |
8595bdaf | 425 | @param Controller Handle of device to test.\r |
24248368 | 426 | @param RemainingDevicePath Optional parameter use to pick a specific child\r |
427 | device to start.\r | |
428 | \r | |
8595bdaf | 429 | @retval EFI_SUCCESS This driver supports this device.\r |
430 | @retval other This driver does not support this device.\r | |
24248368 | 431 | \r |
432 | **/\r | |
95276127 | 433 | EFI_STATUS\r |
434 | EFIAPI\r | |
435 | GraphicsConsoleControllerDriverSupported (\r | |
1436aea4 MK |
436 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r |
437 | IN EFI_HANDLE Controller,\r | |
438 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
95276127 | 439 | );\r |
440 | \r | |
24248368 | 441 | /**\r |
d1102dba | 442 | Start this driver on Controller by opening Graphics Output protocol or\r |
8595bdaf | 443 | UGA Draw protocol, and installing Simple Text Out protocol on Controller.\r |
878670ea | 444 | (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)\r |
d1102dba | 445 | \r |
24248368 | 446 | @param This Protocol instance pointer.\r |
8595bdaf | 447 | @param Controller Handle of device to bind driver to\r |
24248368 | 448 | @param RemainingDevicePath Optional parameter use to pick a specific child\r |
449 | device to start.\r | |
450 | \r | |
8595bdaf | 451 | @retval EFI_SUCCESS This driver is added to Controller.\r |
452 | @retval other This driver does not support this device.\r | |
24248368 | 453 | \r |
454 | **/\r | |
95276127 | 455 | EFI_STATUS\r |
456 | EFIAPI\r | |
457 | GraphicsConsoleControllerDriverStart (\r | |
1436aea4 MK |
458 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r |
459 | IN EFI_HANDLE Controller,\r | |
460 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
95276127 | 461 | );\r |
462 | \r | |
24248368 | 463 | /**\r |
d1102dba | 464 | Stop this driver on Controller by removing Simple Text Out protocol\r |
8595bdaf | 465 | and closing the Graphics Output Protocol or UGA Draw protocol on Controller.\r |
878670ea | 466 | (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)\r |
d1102dba | 467 | \r |
24248368 | 468 | \r |
469 | @param This Protocol instance pointer.\r | |
8595bdaf | 470 | @param Controller Handle of device to stop driver on\r |
24248368 | 471 | @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r |
472 | children is zero stop the entire bus driver.\r | |
473 | @param ChildHandleBuffer List of Child Handles to Stop.\r | |
474 | \r | |
8595bdaf | 475 | @retval EFI_SUCCESS This driver is removed Controller.\r |
d1102dba | 476 | @retval EFI_NOT_STARTED Simple Text Out protocol could not be found the\r |
8595bdaf | 477 | Controller.\r |
24248368 | 478 | @retval other This driver was not removed from this device.\r |
479 | \r | |
480 | **/\r | |
95276127 | 481 | EFI_STATUS\r |
482 | EFIAPI\r | |
483 | GraphicsConsoleControllerDriverStop (\r | |
1436aea4 MK |
484 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r |
485 | IN EFI_HANDLE Controller,\r | |
486 | IN UINTN NumberOfChildren,\r | |
487 | IN EFI_HANDLE *ChildHandleBuffer\r | |
95276127 | 488 | );\r |
489 | \r | |
24248368 | 490 | /**\r |
491 | Locate HII Database protocol and HII Font protocol.\r | |
492 | \r | |
d1102dba | 493 | @retval EFI_SUCCESS HII Database protocol and HII Font protocol\r |
24248368 | 494 | are located successfully.\r |
d1102dba | 495 | @return other Failed to locate HII Database protocol or\r |
24248368 | 496 | HII Font protocol.\r |
497 | \r | |
498 | **/\r | |
93e3992d | 499 | EFI_STATUS\r |
500 | EfiLocateHiiProtocol (\r | |
501 | VOID\r | |
ed66e1bc | 502 | );\r |
93e3992d | 503 | \r |
5c03ed0a | 504 | /**\r |
e61088c8 | 505 | Gets Graphics Console device's foreground color and background color.\r |
5c03ed0a | 506 | \r |
507 | @param This Protocol instance pointer.\r | |
508 | @param Foreground Returned text foreground color.\r | |
509 | @param Background Returned text background color.\r | |
510 | \r | |
511 | @retval EFI_SUCCESS It returned always.\r | |
512 | \r | |
513 | **/\r | |
514 | EFI_STATUS\r | |
515 | GetTextColors (\r | |
516 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
517 | OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,\r | |
518 | OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background\r | |
519 | );\r | |
520 | \r | |
521 | /**\r | |
522 | Draw Unicode string on the Graphics Console device's screen.\r | |
523 | \r | |
524 | @param This Protocol instance pointer.\r | |
525 | @param UnicodeWeight One Unicode string to be displayed.\r | |
526 | @param Count The count of Unicode string.\r | |
527 | \r | |
528 | @retval EFI_OUT_OF_RESOURCES If no memory resource to use.\r | |
529 | @retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw\r | |
530 | protocol exist.\r | |
531 | @retval EFI_SUCCESS Drawing Unicode string implemented successfully.\r | |
532 | \r | |
533 | **/\r | |
534 | EFI_STATUS\r | |
535 | DrawUnicodeWeightAtCursorN (\r | |
536 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r | |
537 | IN CHAR16 *UnicodeWeight,\r | |
538 | IN UINTN Count\r | |
539 | );\r | |
540 | \r | |
541 | /**\r | |
f44e8c16 | 542 | Flush the cursor on the screen.\r |
d1102dba | 543 | \r |
f44e8c16 | 544 | If CursorVisible is FALSE, nothing to do and return directly.\r |
d1102dba | 545 | If CursorVisible is TRUE,\r |
f44e8c16 | 546 | i) If the cursor shows on screen, it will be erased.\r |
d1102dba | 547 | ii) If the cursor does not show on screen, it will be shown.\r |
5c03ed0a | 548 | \r |
549 | @param This Protocol instance pointer.\r | |
550 | \r | |
551 | @retval EFI_SUCCESS The cursor is erased successfully.\r | |
552 | \r | |
553 | **/\r | |
554 | EFI_STATUS\r | |
f44e8c16 | 555 | FlushCursor (\r |
5c03ed0a | 556 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r |
557 | );\r | |
558 | \r | |
559 | /**\r | |
560 | Check if the current specific mode supported the user defined resolution\r | |
561 | for the Graphics Console device based on Graphics Output Protocol.\r | |
562 | \r | |
563 | If yes, set the graphic device's current mode to this specific mode.\r | |
d1102dba | 564 | \r |
5c03ed0a | 565 | @param GraphicsOutput Graphics Output Protocol instance pointer.\r |
566 | @param HorizontalResolution User defined horizontal resolution\r | |
567 | @param VerticalResolution User defined vertical resolution.\r | |
568 | @param CurrentModeNumber Current specific mode to be check.\r | |
569 | \r | |
570 | @retval EFI_SUCCESS The mode is supported.\r | |
d1102dba | 571 | @retval EFI_UNSUPPORTED The specific mode is out of range of graphics\r |
5c03ed0a | 572 | device supported.\r |
d1102dba LG |
573 | @retval other The specific mode does not support user defined\r |
574 | resolution or failed to set the current mode to the\r | |
5c03ed0a | 575 | specific mode on graphics device.\r |
576 | \r | |
577 | **/\r | |
578 | EFI_STATUS\r | |
579 | CheckModeSupported (\r | |
580 | EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,\r | |
1436aea4 MK |
581 | IN UINT32 HorizontalResolution,\r |
582 | IN UINT32 VerticalResolution,\r | |
583 | OUT UINT32 *CurrentModeNumber\r | |
5c03ed0a | 584 | );\r |
585 | \r | |
95276127 | 586 | #endif\r |