2 Implementation for a generic GOP driver.
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 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.
16 #include "GraphicsOutput.h"
17 CONST ACPI_ADR_DEVICE_PATH mGraphicsOutputAdrNode
= {
21 { sizeof (ACPI_ADR_DEVICE_PATH
), 0 },
23 ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA
, 0, 0)
26 EFI_PEI_GRAPHICS_DEVICE_INFO_HOB mDefaultGraphicsDeviceInfo
= {
27 MAX_UINT16
, MAX_UINT16
, MAX_UINT16
, MAX_UINT16
, MAX_UINT8
, MAX_UINT8
31 // The driver should only start on one graphics controller.
32 // So a global flag is used to remember that the driver is already started.
34 BOOLEAN mDriverStarted
= FALSE
;
37 Returns information for an available graphics mode that the graphics device
38 and the set of active video output devices supports.
40 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
41 @param ModeNumber The mode number to return information on.
42 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
43 @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
45 @retval EFI_SUCCESS Valid mode information was returned.
46 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
47 @retval EFI_INVALID_PARAMETER ModeNumber is not valid.
52 GraphicsOutputQueryMode (
53 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
55 OUT UINTN
*SizeOfInfo
,
56 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
**Info
59 if (This
== NULL
|| Info
== NULL
|| SizeOfInfo
== NULL
|| ModeNumber
>= This
->Mode
->MaxMode
) {
60 return EFI_INVALID_PARAMETER
;
63 *SizeOfInfo
= This
->Mode
->SizeOfInfo
;
64 *Info
= AllocateCopyPool (*SizeOfInfo
, This
->Mode
->Info
);
69 Set the video device into the specified mode and clears the visible portions of
70 the output display to black.
72 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
73 @param ModeNumber Abstraction that defines the current video mode.
75 @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
76 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
77 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
82 GraphicsOutputSetMode (
83 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
88 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black
;
89 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
91 if (ModeNumber
>= This
->Mode
->MaxMode
) {
92 return EFI_UNSUPPORTED
;
95 Private
= GRAPHICS_OUTPUT_PRIVATE_FROM_THIS (This
);
102 Status
= FrameBufferBlt (
103 Private
->FrameBufferBltLibConfigure
,
108 This
->Mode
->Info
->HorizontalResolution
,
109 This
->Mode
->Info
->VerticalResolution
,
112 return RETURN_ERROR (Status
) ? EFI_DEVICE_ERROR
: EFI_SUCCESS
;
116 Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
118 @param This Protocol instance pointer.
119 @param BltBuffer The data to transfer to the graphics screen.
120 Size is at least Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
121 @param BltOperation The operation to perform when copying BltBuffer on to the graphics screen.
122 @param SourceX The X coordinate of source for the BltOperation.
123 @param SourceY The Y coordinate of source for the BltOperation.
124 @param DestinationX The X coordinate of destination for the BltOperation.
125 @param DestinationY The Y coordinate of destination for the BltOperation.
126 @param Width The width of a rectangle in the blt rectangle in pixels.
127 @param Height The height of a rectangle in the blt rectangle in pixels.
128 @param Delta Not used for EfiBltVideoFill or the EfiBltVideoToVideo operation.
129 If a Delta of zero is used, the entire BltBuffer is being operated on.
130 If a subrectangle of the BltBuffer is being used then Delta
131 represents the number of bytes in a row of the BltBuffer.
133 @retval EFI_SUCCESS BltBuffer was drawn to the graphics screen.
134 @retval EFI_INVALID_PARAMETER BltOperation is not valid.
135 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
141 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
142 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BltBuffer
, OPTIONAL
143 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation
,
146 IN UINTN DestinationX
,
147 IN UINTN DestinationY
,
150 IN UINTN Delta OPTIONAL
153 RETURN_STATUS Status
;
155 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
157 Private
= GRAPHICS_OUTPUT_PRIVATE_FROM_THIS (This
);
159 // We have to raise to TPL_NOTIFY, so we make an atomic write to the frame buffer.
160 // We would not want a timer based event (Cursor, ...) to come in while we are
161 // doing this operation.
163 Tpl
= gBS
->RaiseTPL (TPL_NOTIFY
);
164 Status
= FrameBufferBlt (
165 Private
->FrameBufferBltLibConfigure
,
169 DestinationX
, DestinationY
, Width
, Height
,
172 gBS
->RestoreTPL (Tpl
);
174 return RETURN_ERROR (Status
) ? EFI_INVALID_PARAMETER
: EFI_SUCCESS
;
177 CONST GRAPHICS_OUTPUT_PRIVATE_DATA mGraphicsOutputInstanceTemplate
= {
178 GRAPHICS_OUTPUT_PRIVATE_DATA_SIGNATURE
, // Signature
179 NULL
, // GraphicsOutputHandle
181 GraphicsOutputQueryMode
,
182 GraphicsOutputSetMode
,
190 sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
), // SizeOfInfo
191 0, // FrameBufferBase
197 NULL
, // FrameBufferBltLibConfigure
198 0 // FrameBufferBltLibConfigureSize
202 Test whether the Controller can be managed by the driver.
204 @param This Driver Binding protocol instance pointer.
205 @param Controller The PCI controller.
206 @param RemainingDevicePath Optional parameter use to pick a specific child
209 @retval EFI_SUCCESS The driver can manage the video device.
210 @retval other The driver cannot manage the video device.
214 GraphicsOutputDriverBindingSupported (
215 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
216 IN EFI_HANDLE Controller
,
217 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
221 EFI_PCI_IO_PROTOCOL
*PciIo
;
222 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
225 // Since there is only one GraphicsInfo HOB, the driver only manages one video device.
227 if (mDriverStarted
) {
228 return EFI_ALREADY_STARTED
;
232 // Test the PCI I/O Protocol
234 Status
= gBS
->OpenProtocol (
236 &gEfiPciIoProtocolGuid
,
238 This
->DriverBindingHandle
,
240 EFI_OPEN_PROTOCOL_BY_DRIVER
242 if (Status
== EFI_ALREADY_STARTED
) {
243 Status
= EFI_SUCCESS
;
245 if (EFI_ERROR (Status
)) {
250 &gEfiPciIoProtocolGuid
,
251 This
->DriverBindingHandle
,
256 // Test the DevicePath protocol
258 Status
= gBS
->OpenProtocol (
260 &gEfiDevicePathProtocolGuid
,
261 (VOID
**) &DevicePath
,
262 This
->DriverBindingHandle
,
264 EFI_OPEN_PROTOCOL_BY_DRIVER
266 if (Status
== EFI_ALREADY_STARTED
) {
267 Status
= EFI_SUCCESS
;
269 if (EFI_ERROR (Status
)) {
274 &gEfiDevicePathProtocolGuid
,
275 This
->DriverBindingHandle
,
279 if ((RemainingDevicePath
== NULL
) ||
280 IsDevicePathEnd (RemainingDevicePath
) ||
281 CompareMem (RemainingDevicePath
, &mGraphicsOutputAdrNode
, sizeof (mGraphicsOutputAdrNode
)) == 0) {
284 return EFI_INVALID_PARAMETER
;
289 Start the video controller.
291 @param This Driver Binding protocol instance pointer.
292 @param ControllerHandle The PCI controller.
293 @param RemainingDevicePath Optional parameter use to pick a specific child
296 @retval EFI_SUCCESS The driver starts to manage the video device.
297 @retval other The driver cannot manage the video device.
301 GraphicsOutputDriverBindingStart (
302 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
303 IN EFI_HANDLE Controller
,
304 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
308 RETURN_STATUS ReturnStatus
;
309 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
310 EFI_PCI_IO_PROTOCOL
*PciIo
;
311 EFI_DEVICE_PATH
*PciDevicePath
;
314 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*Resources
;
316 EFI_PEI_GRAPHICS_INFO_HOB
*GraphicsInfo
;
317 EFI_PEI_GRAPHICS_DEVICE_INFO_HOB
*DeviceInfo
;
318 EFI_PHYSICAL_ADDRESS FrameBufferBase
;
322 HobStart
= GetFirstGuidHob (&gEfiGraphicsInfoHobGuid
);
323 ASSERT ((HobStart
!= NULL
) && (GET_GUID_HOB_DATA_SIZE (HobStart
) == sizeof (EFI_PEI_GRAPHICS_INFO_HOB
)));
324 GraphicsInfo
= (EFI_PEI_GRAPHICS_INFO_HOB
*) (GET_GUID_HOB_DATA (HobStart
));
326 HobStart
= GetFirstGuidHob (&gEfiGraphicsDeviceInfoHobGuid
);
327 if ((HobStart
== NULL
) || (GET_GUID_HOB_DATA_SIZE (HobStart
) < sizeof (*DeviceInfo
))) {
329 // Use default device infomation when the device info HOB doesn't exist
331 DeviceInfo
= &mDefaultGraphicsDeviceInfo
;
332 DEBUG ((EFI_D_INFO
, "[%a]: GraphicsDeviceInfo HOB doesn't exist!\n", gEfiCallerBaseName
));
334 DeviceInfo
= (EFI_PEI_GRAPHICS_DEVICE_INFO_HOB
*) (GET_GUID_HOB_DATA (HobStart
));
335 DEBUG ((EFI_D_INFO
, "[%a]: GraphicsDeviceInfo HOB:\n"
336 " VendorId = %04x, DeviceId = %04x,\n"
337 " RevisionId = %02x, BarIndex = %x,\n"
338 " SubsystemVendorId = %04x, SubsystemId = %04x\n",
340 DeviceInfo
->VendorId
, DeviceInfo
->DeviceId
,
341 DeviceInfo
->RevisionId
, DeviceInfo
->BarIndex
,
342 DeviceInfo
->SubsystemVendorId
, DeviceInfo
->SubsystemId
));
346 // Open the PCI I/O Protocol
348 Status
= gBS
->OpenProtocol (
350 &gEfiPciIoProtocolGuid
,
352 This
->DriverBindingHandle
,
354 EFI_OPEN_PROTOCOL_BY_DRIVER
356 if (Status
== EFI_ALREADY_STARTED
) {
357 Status
= EFI_SUCCESS
;
359 ASSERT_EFI_ERROR (Status
);
361 Status
= gBS
->OpenProtocol (
363 &gEfiDevicePathProtocolGuid
,
364 (VOID
**) &PciDevicePath
,
365 This
->DriverBindingHandle
,
367 EFI_OPEN_PROTOCOL_BY_DRIVER
369 if (Status
== EFI_ALREADY_STARTED
) {
370 Status
= EFI_SUCCESS
;
372 ASSERT_EFI_ERROR (Status
);
375 // Read the PCI Class Code from the PCI Device
377 Status
= PciIo
->Pci
.Read (PciIo
, EfiPciIoWidthUint8
, 0, sizeof (Pci
), &Pci
);
378 if (!EFI_ERROR (Status
)) {
379 if (!IS_PCI_DISPLAY (&Pci
) || (
380 ((DeviceInfo
->VendorId
!= MAX_UINT16
) && (DeviceInfo
->VendorId
!= Pci
.Hdr
.VendorId
)) ||
381 ((DeviceInfo
->DeviceId
!= MAX_UINT16
) && (DeviceInfo
->DeviceId
!= Pci
.Hdr
.DeviceId
)) ||
382 ((DeviceInfo
->RevisionId
!= MAX_UINT8
) && (DeviceInfo
->RevisionId
!= Pci
.Hdr
.RevisionID
)) ||
383 ((DeviceInfo
->SubsystemVendorId
!= MAX_UINT16
) && (DeviceInfo
->SubsystemVendorId
!= Pci
.Device
.SubsystemVendorID
)) ||
384 ((DeviceInfo
->SubsystemId
!= MAX_UINT16
) && (DeviceInfo
->SubsystemId
!= Pci
.Device
.SubsystemID
))
388 // It's not a video device, or device infomation doesn't match.
390 Status
= EFI_UNSUPPORTED
;
393 // If it's a video device and device information matches, use the BarIndex
394 // from device information, or any BAR if BarIndex is not specified
395 // whose size >= the frame buffer size from GraphicsInfo HOB.
396 // Store the new frame buffer base.
398 for (Index
= 0; Index
< MAX_PCI_BAR
; Index
++) {
399 if ((DeviceInfo
->BarIndex
!= MAX_UINT8
) && (DeviceInfo
->BarIndex
!= Index
)) {
402 Status
= PciIo
->GetBarAttributes (PciIo
, Index
, NULL
, (VOID
**) &Resources
);
403 if (!EFI_ERROR (Status
)) {
404 DEBUG ((EFI_D_INFO
, "[%a]: BAR[%d]: Base = %lx, Length = %lx\n",
405 gEfiCallerBaseName
, Index
, Resources
->AddrRangeMin
, Resources
->AddrLen
));
406 if ((Resources
->Desc
== ACPI_ADDRESS_SPACE_DESCRIPTOR
) &&
407 (Resources
->Len
== (UINT16
) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
) - 3)) &&
408 (Resources
->ResType
== ACPI_ADDRESS_SPACE_TYPE_MEM
) &&
409 (Resources
->AddrLen
>= GraphicsInfo
->FrameBufferSize
)
411 FrameBufferBase
= Resources
->AddrRangeMin
;
412 DEBUG ((EFI_D_INFO
, "[%a]: ... matched!\n", gEfiCallerBaseName
));
417 if (Index
== MAX_PCI_BAR
) {
418 Status
= EFI_UNSUPPORTED
;
423 if (EFI_ERROR (Status
)) {
427 if ((RemainingDevicePath
!= NULL
) && IsDevicePathEnd (RemainingDevicePath
)) {
431 Private
= AllocateCopyPool (sizeof (mGraphicsOutputInstanceTemplate
), &mGraphicsOutputInstanceTemplate
);
432 if (Private
== NULL
) {
433 Status
= EFI_OUT_OF_RESOURCES
;
437 Private
->GraphicsOutputMode
.FrameBufferBase
= FrameBufferBase
;
438 Private
->GraphicsOutputMode
.FrameBufferSize
= GraphicsInfo
->FrameBufferSize
;
439 Private
->GraphicsOutputMode
.Info
= &GraphicsInfo
->GraphicsMode
;
442 // Fix up Mode pointer in GraphicsOutput
444 Private
->GraphicsOutput
.Mode
= &Private
->GraphicsOutputMode
;
449 Status
= PciIo
->Attributes (
451 EfiPciIoAttributeOperationGet
,
453 &Private
->PciAttributes
455 if (!EFI_ERROR (Status
)) {
456 Status
= PciIo
->Attributes (
458 EfiPciIoAttributeOperationEnable
,
459 EFI_PCI_DEVICE_ENABLE
,
464 if (EFI_ERROR (Status
)) {
469 // Create the FrameBufferBltLib configuration.
471 ReturnStatus
= FrameBufferBltConfigure (
472 (VOID
*) (UINTN
) Private
->GraphicsOutput
.Mode
->FrameBufferBase
,
473 Private
->GraphicsOutput
.Mode
->Info
,
474 Private
->FrameBufferBltLibConfigure
,
475 &Private
->FrameBufferBltLibConfigureSize
477 if (ReturnStatus
== RETURN_BUFFER_TOO_SMALL
) {
478 Private
->FrameBufferBltLibConfigure
= AllocatePool (Private
->FrameBufferBltLibConfigureSize
);
479 if (Private
->FrameBufferBltLibConfigure
!= NULL
) {
480 ReturnStatus
= FrameBufferBltConfigure (
481 (VOID
*) (UINTN
) Private
->GraphicsOutput
.Mode
->FrameBufferBase
,
482 Private
->GraphicsOutput
.Mode
->Info
,
483 Private
->FrameBufferBltLibConfigure
,
484 &Private
->FrameBufferBltLibConfigureSize
488 if (RETURN_ERROR (ReturnStatus
)) {
489 Status
= EFI_OUT_OF_RESOURCES
;
490 goto RestorePciAttributes
;
493 Private
->DevicePath
= AppendDevicePathNode (PciDevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*) &mGraphicsOutputAdrNode
);
494 if (Private
->DevicePath
== NULL
) {
495 Status
= EFI_OUT_OF_RESOURCES
;
496 goto RestorePciAttributes
;
499 Status
= gBS
->InstallMultipleProtocolInterfaces (
500 &Private
->GraphicsOutputHandle
,
501 &gEfiGraphicsOutputProtocolGuid
, &Private
->GraphicsOutput
,
502 &gEfiDevicePathProtocolGuid
, Private
->DevicePath
,
506 if (!EFI_ERROR (Status
)) {
507 Status
= gBS
->OpenProtocol (
509 &gEfiPciIoProtocolGuid
,
510 (VOID
**) &Private
->PciIo
,
511 This
->DriverBindingHandle
,
512 Private
->GraphicsOutputHandle
,
513 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
515 if (!EFI_ERROR (Status
)) {
516 mDriverStarted
= TRUE
;
518 gBS
->UninstallMultipleProtocolInterfaces (
519 Private
->GraphicsOutputHandle
,
520 &gEfiGraphicsOutputProtocolGuid
, &Private
->GraphicsOutput
,
521 &gEfiDevicePathProtocolGuid
, Private
->DevicePath
,
527 RestorePciAttributes
:
528 if (EFI_ERROR (Status
)) {
530 // Restore original PCI attributes
534 EfiPciIoAttributeOperationSet
,
535 Private
->PciAttributes
,
541 if (EFI_ERROR (Status
)) {
542 if (Private
!= NULL
) {
543 if (Private
->DevicePath
!= NULL
) {
544 FreePool (Private
->DevicePath
);
546 if (Private
->FrameBufferBltLibConfigure
!= NULL
) {
547 FreePool (Private
->FrameBufferBltLibConfigure
);
554 if (EFI_ERROR (Status
)) {
556 // Close the PCI I/O Protocol
560 &gEfiDevicePathProtocolGuid
,
561 This
->DriverBindingHandle
,
566 // Close the PCI I/O Protocol
570 &gEfiPciIoProtocolGuid
,
571 This
->DriverBindingHandle
,
579 Stop the video controller.
581 @param This Driver Binding protocol instance pointer.
582 @param Controller The PCI controller.
583 @param NumberOfChildren The number of child device handles in ChildHandleBuffer.
584 @param ChildHandleBuffer An array of child handles to be freed. May be NULL
585 if NumberOfChildren is 0.
587 @retval EFI_SUCCESS The device was stopped.
588 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
592 GraphicsOutputDriverBindingStop (
593 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
594 IN EFI_HANDLE Controller
,
595 IN UINTN NumberOfChildren
,
596 IN EFI_HANDLE
*ChildHandleBuffer
600 EFI_GRAPHICS_OUTPUT_PROTOCOL
*Gop
;
601 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
603 if (NumberOfChildren
== 0) {
606 // Close the PCI I/O Protocol
608 Status
= gBS
->CloseProtocol (
610 &gEfiPciIoProtocolGuid
,
611 This
->DriverBindingHandle
,
614 ASSERT_EFI_ERROR (Status
);
616 Status
= gBS
->CloseProtocol (
618 &gEfiDevicePathProtocolGuid
,
619 This
->DriverBindingHandle
,
622 ASSERT_EFI_ERROR (Status
);
626 ASSERT (NumberOfChildren
== 1);
627 Status
= gBS
->OpenProtocol (
628 ChildHandleBuffer
[0],
629 &gEfiGraphicsOutputProtocolGuid
,
631 This
->DriverBindingHandle
,
632 ChildHandleBuffer
[0],
633 EFI_OPEN_PROTOCOL_GET_PROTOCOL
635 if (EFI_ERROR (Status
)) {
639 Private
= GRAPHICS_OUTPUT_PRIVATE_FROM_THIS (Gop
);
641 Status
= gBS
->CloseProtocol (
643 &gEfiPciIoProtocolGuid
,
644 This
->DriverBindingHandle
,
645 Private
->GraphicsOutputHandle
647 ASSERT_EFI_ERROR (Status
);
649 // Remove the GOP protocol interface from the system
651 Status
= gBS
->UninstallMultipleProtocolInterfaces (
652 Private
->GraphicsOutputHandle
,
653 &gEfiGraphicsOutputProtocolGuid
, &Private
->GraphicsOutput
,
654 &gEfiDevicePathProtocolGuid
, Private
->DevicePath
,
657 if (!EFI_ERROR (Status
)) {
659 // Restore original PCI attributes
661 Status
= Private
->PciIo
->Attributes (
663 EfiPciIoAttributeOperationSet
,
664 Private
->PciAttributes
,
667 ASSERT_EFI_ERROR (Status
);
669 FreePool (Private
->DevicePath
);
670 FreePool (Private
->FrameBufferBltLibConfigure
);
671 mDriverStarted
= FALSE
;
673 Status
= gBS
->OpenProtocol (
675 &gEfiPciIoProtocolGuid
,
676 (VOID
**) &Private
->PciIo
,
677 This
->DriverBindingHandle
,
678 Private
->GraphicsOutputHandle
,
679 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
681 ASSERT_EFI_ERROR (Status
);
686 EFI_DRIVER_BINDING_PROTOCOL mGraphicsOutputDriverBinding
= {
687 GraphicsOutputDriverBindingSupported
,
688 GraphicsOutputDriverBindingStart
,
689 GraphicsOutputDriverBindingStop
,
696 The Entry Point for GraphicsOutput driver.
698 It installs DriverBinding, ComponentName and ComponentName2 protocol if there is
699 GraphicsInfo HOB passed from Graphics PEIM.
701 @param[in] ImageHandle The firmware allocated handle for the EFI image.
702 @param[in] SystemTable A pointer to the EFI System Table.
704 @retval EFI_SUCCESS The entry point is executed successfully.
705 @retval other Some error occurs when executing this entry point.
710 InitializeGraphicsOutput (
711 IN EFI_HANDLE ImageHandle
,
712 IN EFI_SYSTEM_TABLE
*SystemTable
718 HobStart
= GetFirstGuidHob (&gEfiGraphicsInfoHobGuid
);
720 if ((HobStart
== NULL
) || (GET_GUID_HOB_DATA_SIZE (HobStart
) < sizeof (EFI_PEI_GRAPHICS_INFO_HOB
))) {
721 return EFI_NOT_FOUND
;
724 Status
= EfiLibInstallDriverBindingComponentName2 (
727 &mGraphicsOutputDriverBinding
,
729 &mGraphicsOutputComponentName
,
730 &mGraphicsOutputComponentName2
732 ASSERT_EFI_ERROR (Status
);