]>
Commit | Line | Data |
---|---|---|
b522c77b HW |
1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r | |
4 | \r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | **/\r | |
8 | \r | |
9 | #ifndef _BIOS_GRAPHICS_OUTPUT_H_\r | |
10 | #define _BIOS_GRAPHICS_OUTPUT_H_\r | |
11 | \r | |
12 | #include <FrameworkDxe.h>\r | |
13 | \r | |
14 | #include <Protocol/PciIo.h>\r | |
15 | #include <Protocol/EdidActive.h>\r | |
16 | #include <Protocol/DevicePath.h>\r | |
17 | #include <Protocol/EdidDiscovered.h>\r | |
18 | #include <Protocol/LegacyBios.h>\r | |
19 | #include <Protocol/VgaMiniPort.h>\r | |
20 | #include <Protocol/GraphicsOutput.h>\r | |
21 | #include <Protocol/EdidOverride.h>\r | |
22 | \r | |
23 | #include <Guid/StatusCodeDataTypeId.h>\r | |
24 | #include <Guid/LegacyBios.h>\r | |
25 | #include <Guid/EventGroup.h>\r | |
26 | \r | |
27 | #include <Library/PcdLib.h>\r | |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/ReportStatusCodeLib.h>\r | |
30 | #include <Library/BaseMemoryLib.h>\r | |
31 | #include <Library/UefiDriverEntryPoint.h>\r | |
32 | #include <Library/UefiBootServicesTableLib.h>\r | |
33 | #include <Library/UefiLib.h>\r | |
34 | #include <Library/DevicePathLib.h>\r | |
35 | #include <Library/MemoryAllocationLib.h>\r | |
36 | \r | |
37 | #include <IndustryStandard/Pci.h>\r | |
38 | #include "VesaBiosExtensions.h"\r | |
39 | \r | |
40 | //\r | |
41 | // Packed format support: The number of bits reserved for each of the colors and the actual\r | |
42 | // position of RGB in the frame buffer is specified in the VBE Mode information\r | |
43 | //\r | |
44 | typedef struct {\r | |
ac0a286f MK |
45 | UINT8 Position; // Position of the color\r |
46 | UINT8 Mask; // The number of bits expressed as a mask\r | |
b522c77b HW |
47 | } BIOS_VIDEO_COLOR_PLACEMENT;\r |
48 | \r | |
49 | //\r | |
50 | // BIOS Graphics Output Graphical Mode Data\r | |
51 | //\r | |
52 | typedef struct {\r | |
ac0a286f MK |
53 | UINT16 VbeModeNumber;\r |
54 | UINT16 BytesPerScanLine;\r | |
55 | VOID *LinearFrameBuffer;\r | |
56 | UINTN FrameBufferSize;\r | |
57 | UINT32 HorizontalResolution;\r | |
58 | UINT32 VerticalResolution;\r | |
59 | UINT32 ColorDepth;\r | |
60 | UINT32 RefreshRate;\r | |
61 | UINT32 BitsPerPixel;\r | |
62 | BIOS_VIDEO_COLOR_PLACEMENT Red;\r | |
63 | BIOS_VIDEO_COLOR_PLACEMENT Green;\r | |
64 | BIOS_VIDEO_COLOR_PLACEMENT Blue;\r | |
65 | BIOS_VIDEO_COLOR_PLACEMENT Reserved;\r | |
66 | EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;\r | |
67 | EFI_PIXEL_BITMASK PixelBitMask;\r | |
b522c77b HW |
68 | } BIOS_VIDEO_MODE_DATA;\r |
69 | \r | |
70 | //\r | |
71 | // BIOS video child handle private data Structure\r | |
72 | //\r | |
ac0a286f | 73 | #define BIOS_VIDEO_DEV_SIGNATURE SIGNATURE_32 ('B', 'V', 'M', 'p')\r |
b522c77b HW |
74 | \r |
75 | typedef struct {\r | |
ac0a286f MK |
76 | UINTN Signature;\r |
77 | EFI_HANDLE Handle;\r | |
b522c77b HW |
78 | \r |
79 | //\r | |
80 | // Consumed Protocols\r | |
81 | //\r | |
ac0a286f MK |
82 | EFI_PCI_IO_PROTOCOL *PciIo;\r |
83 | EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;\r | |
b522c77b HW |
84 | \r |
85 | //\r | |
86 | // Produced Protocols\r | |
87 | //\r | |
ac0a286f MK |
88 | EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;\r |
89 | EFI_EDID_DISCOVERED_PROTOCOL EdidDiscovered;\r | |
90 | EFI_EDID_ACTIVE_PROTOCOL EdidActive;\r | |
91 | EFI_VGA_MINI_PORT_PROTOCOL VgaMiniPort;\r | |
b522c77b HW |
92 | \r |
93 | //\r | |
94 | // General fields\r | |
95 | //\r | |
ac0a286f MK |
96 | BOOLEAN VgaCompatible;\r |
97 | BOOLEAN ProduceGraphicsOutput;\r | |
b522c77b HW |
98 | \r |
99 | //\r | |
100 | // Graphics Output Protocol related fields\r | |
101 | //\r | |
ac0a286f MK |
102 | BOOLEAN HardwareNeedsStarting;\r |
103 | UINTN CurrentMode;\r | |
104 | UINTN MaxMode;\r | |
105 | BIOS_VIDEO_MODE_DATA *ModeData;\r | |
106 | UINT8 *LineBuffer;\r | |
107 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL *VbeFrameBuffer;\r | |
108 | UINT8 *VgaFrameBuffer;\r | |
b522c77b HW |
109 | \r |
110 | //\r | |
111 | // VESA Bios Extensions related fields\r | |
112 | //\r | |
ac0a286f MK |
113 | UINTN NumberOfPagesBelow1MB; // Number of 4KB pages in PagesBelow1MB\r |
114 | EFI_PHYSICAL_ADDRESS PagesBelow1MB; // Buffer for all VBE Information Blocks\r | |
115 | VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK *VbeInformationBlock; // 0x200 bytes. Must be allocated below 1MB\r | |
116 | VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK *VbeModeInformationBlock; // 0x100 bytes. Must be allocated below 1MB\r | |
117 | VESA_BIOS_EXTENSIONS_EDID_DATA_BLOCK *VbeEdidDataBlock; // 0x80 bytes. Must be allocated below 1MB\r | |
118 | VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK *VbeCrtcInformationBlock; // 59 bytes. Must be allocated below 1MB\r | |
119 | UINTN VbeSaveRestorePages; // Number of 4KB pages in VbeSaveRestoreBuffer\r | |
120 | EFI_PHYSICAL_ADDRESS VbeSaveRestoreBuffer; // Must be allocated below 1MB\r | |
b522c77b HW |
121 | //\r |
122 | // Status code\r | |
123 | //\r | |
ac0a286f | 124 | EFI_DEVICE_PATH_PROTOCOL *GopDevicePath;\r |
b522c77b | 125 | \r |
ac0a286f | 126 | EFI_EVENT ExitBootServicesEvent;\r |
b522c77b HW |
127 | } BIOS_VIDEO_DEV;\r |
128 | \r | |
129 | #define BIOS_VIDEO_DEV_FROM_PCI_IO_THIS(a) CR (a, BIOS_VIDEO_DEV, PciIo, BIOS_VIDEO_DEV_SIGNATURE)\r | |
130 | #define BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS(a) CR (a, BIOS_VIDEO_DEV, GraphicsOutput, BIOS_VIDEO_DEV_SIGNATURE)\r | |
131 | #define BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS(a) CR (a, BIOS_VIDEO_DEV, VgaMiniPort, BIOS_VIDEO_DEV_SIGNATURE)\r | |
132 | \r | |
133 | #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff\r | |
134 | \r | |
135 | //\r | |
136 | // Global Variables\r | |
137 | //\r | |
138 | extern EFI_DRIVER_BINDING_PROTOCOL gBiosVideoDriverBinding;\r | |
139 | extern EFI_COMPONENT_NAME_PROTOCOL gBiosVideoComponentName;\r | |
140 | extern EFI_COMPONENT_NAME2_PROTOCOL gBiosVideoComponentName2;\r | |
141 | \r | |
142 | //\r | |
143 | // Driver Binding Protocol functions\r | |
144 | //\r | |
145 | \r | |
146 | /**\r | |
147 | Supported.\r | |
148 | \r | |
149 | @param This Pointer to driver binding protocol\r | |
150 | @param Controller Controller handle to connect\r | |
151 | @param RemainingDevicePath A pointer to the remaining portion of a device\r | |
152 | path\r | |
153 | \r | |
154 | @retval EFI_STATUS EFI_SUCCESS:This controller can be managed by this\r | |
155 | driver, Otherwise, this controller cannot be\r | |
156 | managed by this driver\r | |
157 | \r | |
158 | **/\r | |
159 | EFI_STATUS\r | |
160 | EFIAPI\r | |
161 | BiosVideoDriverBindingSupported (\r | |
162 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
163 | IN EFI_HANDLE Controller,\r | |
164 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
165 | );\r | |
166 | \r | |
b522c77b HW |
167 | /**\r |
168 | Install Graphics Output Protocol onto VGA device handles.\r | |
169 | \r | |
170 | @param This Pointer to driver binding protocol\r | |
171 | @param Controller Controller handle to connect\r | |
172 | @param RemainingDevicePath A pointer to the remaining portion of a device\r | |
173 | path\r | |
174 | \r | |
175 | @return EFI_STATUS\r | |
176 | \r | |
177 | **/\r | |
178 | EFI_STATUS\r | |
179 | EFIAPI\r | |
180 | BiosVideoDriverBindingStart (\r | |
181 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
182 | IN EFI_HANDLE Controller,\r | |
183 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
184 | );\r | |
185 | \r | |
b522c77b HW |
186 | /**\r |
187 | Stop.\r | |
188 | \r | |
189 | @param This Pointer to driver binding protocol\r | |
190 | @param Controller Controller handle to connect\r | |
191 | @param NumberOfChildren Number of children handle created by this driver\r | |
192 | @param ChildHandleBuffer Buffer containing child handle created\r | |
193 | \r | |
194 | @retval EFI_SUCCESS Driver disconnected successfully from controller\r | |
195 | @retval EFI_UNSUPPORTED Cannot find BIOS_VIDEO_DEV structure\r | |
196 | \r | |
197 | **/\r | |
198 | EFI_STATUS\r | |
199 | EFIAPI\r | |
200 | BiosVideoDriverBindingStop (\r | |
201 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
202 | IN EFI_HANDLE Controller,\r | |
203 | IN UINTN NumberOfChildren,\r | |
204 | IN EFI_HANDLE *ChildHandleBuffer\r | |
205 | );\r | |
206 | \r | |
207 | //\r | |
208 | // Private worker functions\r | |
209 | //\r | |
210 | \r | |
211 | /**\r | |
212 | Check for VBE device.\r | |
213 | \r | |
214 | @param BiosVideoPrivate Pointer to BIOS_VIDEO_DEV structure\r | |
215 | \r | |
216 | @retval EFI_SUCCESS VBE device found\r | |
217 | \r | |
218 | **/\r | |
219 | EFI_STATUS\r | |
220 | BiosVideoCheckForVbe (\r | |
221 | IN OUT BIOS_VIDEO_DEV *BiosVideoPrivate\r | |
222 | );\r | |
223 | \r | |
b522c77b HW |
224 | /**\r |
225 | Check for VGA device.\r | |
226 | \r | |
227 | @param BiosVideoPrivate Pointer to BIOS_VIDEO_DEV structure\r | |
228 | \r | |
229 | @retval EFI_SUCCESS Standard VGA device found\r | |
230 | \r | |
231 | **/\r | |
232 | EFI_STATUS\r | |
233 | BiosVideoCheckForVga (\r | |
234 | IN OUT BIOS_VIDEO_DEV *BiosVideoPrivate\r | |
235 | );\r | |
236 | \r | |
b522c77b | 237 | /**\r |
48cf40b8 | 238 | Release resource for BIOS video instance.\r |
b522c77b HW |
239 | \r |
240 | @param BiosVideoPrivate Video child device private data structure\r | |
241 | \r | |
242 | **/\r | |
243 | VOID\r | |
244 | BiosVideoDeviceReleaseResource (\r | |
245 | BIOS_VIDEO_DEV *BiosVideoPrivate\r | |
246 | );\r | |
247 | \r | |
248 | //\r | |
249 | // BIOS Graphics Output Protocol functions\r | |
250 | //\r | |
251 | \r | |
252 | /**\r | |
253 | Graphics Output protocol interface to get video mode.\r | |
254 | \r | |
255 | @param This Protocol instance pointer.\r | |
256 | @param ModeNumber The mode number to return information on.\r | |
257 | @param SizeOfInfo A pointer to the size, in bytes, of the Info\r | |
258 | buffer.\r | |
259 | @param Info Caller allocated buffer that returns information\r | |
260 | about ModeNumber.\r | |
261 | \r | |
262 | @retval EFI_SUCCESS Mode information returned.\r | |
263 | @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.\r | |
264 | @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the\r | |
265 | video mode.\r | |
266 | @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r | |
267 | @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r | |
268 | \r | |
269 | **/\r | |
270 | EFI_STATUS\r | |
271 | EFIAPI\r | |
272 | BiosVideoGraphicsOutputQueryMode (\r | |
273 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r | |
274 | IN UINT32 ModeNumber,\r | |
275 | OUT UINTN *SizeOfInfo,\r | |
276 | OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r | |
277 | );\r | |
278 | \r | |
b522c77b HW |
279 | /**\r |
280 | Graphics Output protocol interface to set video mode.\r | |
281 | \r | |
282 | @param This Protocol instance pointer.\r | |
283 | @param ModeNumber The mode number to be set.\r | |
284 | \r | |
285 | @retval EFI_SUCCESS Graphics mode was changed.\r | |
286 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the\r | |
287 | request.\r | |
288 | @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.\r | |
289 | \r | |
290 | **/\r | |
291 | EFI_STATUS\r | |
292 | EFIAPI\r | |
293 | BiosVideoGraphicsOutputSetMode (\r | |
ac0a286f MK |
294 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r |
295 | IN UINT32 ModeNumber\r | |
b522c77b HW |
296 | );\r |
297 | \r | |
b522c77b HW |
298 | /**\r |
299 | Graphics Output protocol instance to block transfer for VBE device.\r | |
300 | \r | |
301 | @param This Pointer to Graphics Output protocol instance\r | |
302 | @param BltBuffer The data to transfer to screen\r | |
303 | @param BltOperation The operation to perform\r | |
304 | @param SourceX The X coordinate of the source for BltOperation\r | |
305 | @param SourceY The Y coordinate of the source for BltOperation\r | |
306 | @param DestinationX The X coordinate of the destination for\r | |
307 | BltOperation\r | |
308 | @param DestinationY The Y coordinate of the destination for\r | |
309 | BltOperation\r | |
310 | @param Width The width of a rectangle in the blt rectangle in\r | |
311 | pixels\r | |
312 | @param Height The height of a rectangle in the blt rectangle in\r | |
313 | pixels\r | |
314 | @param Delta Not used for EfiBltVideoFill and\r | |
315 | EfiBltVideoToVideo operation. If a Delta of 0 is\r | |
316 | used, the entire BltBuffer will be operated on. If\r | |
317 | a subrectangle of the BltBuffer is used, then\r | |
318 | Delta represents the number of bytes in a row of\r | |
319 | the BltBuffer.\r | |
320 | \r | |
321 | @retval EFI_INVALID_PARAMETER Invalid parameter passed in\r | |
322 | @retval EFI_SUCCESS Blt operation success\r | |
323 | \r | |
324 | **/\r | |
325 | EFI_STATUS\r | |
326 | EFIAPI\r | |
327 | BiosVideoGraphicsOutputVbeBlt (\r | |
328 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r | |
79d49e16 | 329 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,\r |
b522c77b HW |
330 | IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r |
331 | IN UINTN SourceX,\r | |
332 | IN UINTN SourceY,\r | |
333 | IN UINTN DestinationX,\r | |
334 | IN UINTN DestinationY,\r | |
335 | IN UINTN Width,\r | |
336 | IN UINTN Height,\r | |
337 | IN UINTN Delta\r | |
338 | );\r | |
339 | \r | |
b522c77b | 340 | /**\r |
48cf40b8 | 341 | Graphics Output protocol instance to block transfer for VGA device.\r |
b522c77b | 342 | \r |
48cf40b8 | 343 | @param This Pointer to Graphics Output protocol instance\r |
b522c77b HW |
344 | @param BltBuffer The data to transfer to screen\r |
345 | @param BltOperation The operation to perform\r | |
346 | @param SourceX The X coordinate of the source for BltOperation\r | |
347 | @param SourceY The Y coordinate of the source for BltOperation\r | |
348 | @param DestinationX The X coordinate of the destination for\r | |
349 | BltOperation\r | |
350 | @param DestinationY The Y coordinate of the destination for\r | |
351 | BltOperation\r | |
352 | @param Width The width of a rectangle in the blt rectangle in\r | |
353 | pixels\r | |
354 | @param Height The height of a rectangle in the blt rectangle in\r | |
355 | pixels\r | |
356 | @param Delta Not used for EfiBltVideoFill and\r | |
357 | EfiBltVideoToVideo operation. If a Delta of 0 is\r | |
358 | used, the entire BltBuffer will be operated on. If\r | |
359 | a subrectangle of the BltBuffer is used, then\r | |
360 | Delta represents the number of bytes in a row of\r | |
361 | the BltBuffer.\r | |
362 | \r | |
363 | @retval EFI_INVALID_PARAMETER Invalid parameter passed in\r | |
364 | @retval EFI_SUCCESS Blt operation success\r | |
365 | \r | |
366 | **/\r | |
367 | EFI_STATUS\r | |
368 | EFIAPI\r | |
369 | BiosVideoGraphicsOutputVgaBlt (\r | |
370 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r | |
79d49e16 | 371 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,\r |
b522c77b HW |
372 | IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r |
373 | IN UINTN SourceX,\r | |
374 | IN UINTN SourceY,\r | |
375 | IN UINTN DestinationX,\r | |
376 | IN UINTN DestinationY,\r | |
377 | IN UINTN Width,\r | |
378 | IN UINTN Height,\r | |
379 | IN UINTN Delta\r | |
380 | );\r | |
381 | \r | |
382 | //\r | |
383 | // BIOS VGA Mini Port Protocol functions\r | |
384 | //\r | |
385 | \r | |
386 | /**\r | |
387 | VgaMiniPort protocol interface to set mode.\r | |
388 | \r | |
389 | @param This Pointer to VgaMiniPort protocol instance\r | |
390 | @param ModeNumber The index of the mode\r | |
391 | \r | |
392 | @retval EFI_UNSUPPORTED The requested mode is not supported\r | |
393 | @retval EFI_SUCCESS The requested mode is set successfully\r | |
394 | \r | |
395 | **/\r | |
396 | EFI_STATUS\r | |
397 | EFIAPI\r | |
398 | BiosVideoVgaMiniPortSetMode (\r | |
399 | IN EFI_VGA_MINI_PORT_PROTOCOL *This,\r | |
400 | IN UINTN ModeNumber\r | |
401 | );\r | |
402 | \r | |
403 | /**\r | |
404 | Event handler for Exit Boot Service.\r | |
405 | \r | |
48cf40b8 | 406 | @param Event The event that be signalled when exiting boot service.\r |
b522c77b HW |
407 | @param Context Pointer to instance of BIOS_VIDEO_DEV.\r |
408 | \r | |
409 | **/\r | |
410 | VOID\r | |
411 | EFIAPI\r | |
412 | BiosVideoNotifyExitBootServices (\r | |
ac0a286f MK |
413 | IN EFI_EVENT Event,\r |
414 | IN VOID *Context\r | |
b522c77b HW |
415 | );\r |
416 | \r | |
417 | //\r | |
418 | // Standard VGA Definitions\r | |
419 | //\r | |
ac0a286f MK |
420 | #define VGA_HORIZONTAL_RESOLUTION 640\r |
421 | #define VGA_VERTICAL_RESOLUTION 480\r | |
422 | #define VGA_NUMBER_OF_BIT_PLANES 4\r | |
423 | #define VGA_PIXELS_PER_BYTE 8\r | |
424 | #define VGA_BYTES_PER_SCAN_LINE (VGA_HORIZONTAL_RESOLUTION / VGA_PIXELS_PER_BYTE)\r | |
425 | #define VGA_BYTES_PER_BIT_PLANE (VGA_VERTICAL_RESOLUTION * VGA_BYTES_PER_SCAN_LINE)\r | |
b522c77b | 426 | \r |
ac0a286f MK |
427 | #define VGA_GRAPHICS_CONTROLLER_ADDRESS_REGISTER 0x3ce\r |
428 | #define VGA_GRAPHICS_CONTROLLER_DATA_REGISTER 0x3cf\r | |
b522c77b | 429 | \r |
ac0a286f | 430 | #define VGA_GRAPHICS_CONTROLLER_SET_RESET_REGISTER 0x00\r |
b522c77b | 431 | \r |
ac0a286f | 432 | #define VGA_GRAPHICS_CONTROLLER_ENABLE_SET_RESET_REGISTER 0x01\r |
b522c77b | 433 | \r |
ac0a286f | 434 | #define VGA_GRAPHICS_CONTROLLER_COLOR_COMPARE_REGISTER 0x02\r |
b522c77b | 435 | \r |
ac0a286f MK |
436 | #define VGA_GRAPHICS_CONTROLLER_DATA_ROTATE_REGISTER 0x03\r |
437 | #define VGA_GRAPHICS_CONTROLLER_FUNCTION_REPLACE 0x00\r | |
438 | #define VGA_GRAPHICS_CONTROLLER_FUNCTION_AND 0x08\r | |
439 | #define VGA_GRAPHICS_CONTROLLER_FUNCTION_OR 0x10\r | |
440 | #define VGA_GRAPHICS_CONTROLLER_FUNCTION_XOR 0x18\r | |
b522c77b HW |
441 | \r |
442 | #define VGA_GRAPHICS_CONTROLLER_READ_MAP_SELECT_REGISTER 0x04\r | |
443 | \r | |
ac0a286f MK |
444 | #define VGA_GRAPHICS_CONTROLLER_MODE_REGISTER 0x05\r |
445 | #define VGA_GRAPHICS_CONTROLLER_READ_MODE_0 0x00\r | |
446 | #define VGA_GRAPHICS_CONTROLLER_READ_MODE_1 0x08\r | |
447 | #define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_0 0x00\r | |
448 | #define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_1 0x01\r | |
449 | #define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_2 0x02\r | |
450 | #define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_3 0x03\r | |
b522c77b | 451 | \r |
ac0a286f | 452 | #define VGA_GRAPHICS_CONTROLLER_MISCELLANEOUS_REGISTER 0x06\r |
b522c77b HW |
453 | \r |
454 | #define VGA_GRAPHICS_CONTROLLER_COLOR_DONT_CARE_REGISTER 0x07\r | |
455 | \r | |
ac0a286f | 456 | #define VGA_GRAPHICS_CONTROLLER_BIT_MASK_REGISTER 0x08\r |
b522c77b HW |
457 | \r |
458 | /**\r | |
459 | Install child handles if the Handle supports MBR format.\r | |
460 | \r | |
461 | @param This Calling context.\r | |
462 | @param ParentHandle Parent Handle\r | |
463 | @param ParentPciIo Parent PciIo interface\r | |
464 | @param ParentLegacyBios Parent LegacyBios interface\r | |
465 | @param ParentDevicePath Parent Device Path\r | |
466 | @param RemainingDevicePath Remaining Device Path\r | |
467 | \r | |
468 | @retval EFI_SUCCESS If a child handle was added\r | |
469 | @retval other A child handle was not added\r | |
470 | \r | |
471 | **/\r | |
472 | EFI_STATUS\r | |
473 | BiosVideoChildHandleInstall (\r | |
474 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
475 | IN EFI_HANDLE ParentHandle,\r | |
476 | IN EFI_PCI_IO_PROTOCOL *ParentPciIo,\r | |
477 | IN EFI_LEGACY_BIOS_PROTOCOL *ParentLegacyBios,\r | |
478 | IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r | |
479 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
480 | );\r | |
481 | \r | |
482 | /**\r | |
483 | Deregister an video child handle and free resources.\r | |
484 | \r | |
485 | @param This Protocol instance pointer.\r | |
486 | @param Controller Video controller handle\r | |
487 | @param Handle Video child handle\r | |
488 | \r | |
489 | @return EFI_STATUS\r | |
490 | \r | |
491 | **/\r | |
492 | EFI_STATUS\r | |
493 | BiosVideoChildHandleUninstall (\r | |
ac0a286f MK |
494 | EFI_DRIVER_BINDING_PROTOCOL *This,\r |
495 | EFI_HANDLE Controller,\r | |
496 | EFI_HANDLE Handle\r | |
b522c77b HW |
497 | );\r |
498 | \r | |
499 | /**\r | |
48cf40b8 | 500 | Release resource for BIOS video instance.\r |
b522c77b HW |
501 | \r |
502 | @param BiosVideoPrivate Video child device private data structure\r | |
503 | \r | |
504 | **/\r | |
505 | VOID\r | |
506 | BiosVideoDeviceReleaseResource (\r | |
507 | BIOS_VIDEO_DEV *BiosVideoPrivate\r | |
508 | );\r | |
509 | \r | |
510 | /**\r | |
511 | Check if all video child handles have been uninstalled.\r | |
512 | \r | |
513 | @param Controller Video controller handle\r | |
514 | \r | |
515 | @return TRUE Child handles exist.\r | |
516 | @return FALSE All video child handles have been uninstalled.\r | |
517 | \r | |
518 | **/\r | |
519 | BOOLEAN\r | |
520 | HasChildHandle (\r | |
521 | IN EFI_HANDLE Controller\r | |
522 | );\r | |
ac0a286f | 523 | \r |
b522c77b | 524 | #endif\r |