2 Implementation for a generic GOP driver.
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "GraphicsOutput.h"
11 CONST ACPI_ADR_DEVICE_PATH mGraphicsOutputAdrNode
= {
15 { sizeof (ACPI_ADR_DEVICE_PATH
), 0 },
17 ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA
, 0, 0)
20 EFI_PEI_GRAPHICS_DEVICE_INFO_HOB mDefaultGraphicsDeviceInfo
= {
21 MAX_UINT16
, MAX_UINT16
, MAX_UINT16
, MAX_UINT16
, MAX_UINT8
, MAX_UINT8
25 // The driver should only start on one graphics controller.
26 // So a global flag is used to remember that the driver is already started.
28 BOOLEAN mDriverStarted
= FALSE
;
31 Returns information for an available graphics mode that the graphics device
32 and the set of active video output devices supports.
34 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
35 @param ModeNumber The mode number to return information on.
36 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
37 @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
39 @retval EFI_SUCCESS Valid mode information was returned.
40 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
41 @retval EFI_INVALID_PARAMETER ModeNumber is not valid.
46 GraphicsOutputQueryMode (
47 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
49 OUT UINTN
*SizeOfInfo
,
50 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
**Info
53 if (This
== NULL
|| Info
== NULL
|| SizeOfInfo
== NULL
|| ModeNumber
>= This
->Mode
->MaxMode
) {
54 return EFI_INVALID_PARAMETER
;
57 *SizeOfInfo
= This
->Mode
->SizeOfInfo
;
58 *Info
= AllocateCopyPool (*SizeOfInfo
, This
->Mode
->Info
);
63 Set the video device into the specified mode and clears the visible portions of
64 the output display to black.
66 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
67 @param ModeNumber Abstraction that defines the current video mode.
69 @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
70 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
71 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
76 GraphicsOutputSetMode (
77 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
82 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black
;
83 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
85 if (ModeNumber
>= This
->Mode
->MaxMode
) {
86 return EFI_UNSUPPORTED
;
89 Private
= GRAPHICS_OUTPUT_PRIVATE_FROM_THIS (This
);
96 Status
= FrameBufferBlt (
97 Private
->FrameBufferBltLibConfigure
,
102 This
->Mode
->Info
->HorizontalResolution
,
103 This
->Mode
->Info
->VerticalResolution
,
106 return RETURN_ERROR (Status
) ? EFI_DEVICE_ERROR
: EFI_SUCCESS
;
110 Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
112 @param This Protocol instance pointer.
113 @param BltBuffer The data to transfer to the graphics screen.
114 Size is at least Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
115 @param BltOperation The operation to perform when copying BltBuffer on to the graphics screen.
116 @param SourceX The X coordinate of source for the BltOperation.
117 @param SourceY The Y coordinate of source for the BltOperation.
118 @param DestinationX The X coordinate of destination for the BltOperation.
119 @param DestinationY The Y coordinate of destination for the BltOperation.
120 @param Width The width of a rectangle in the blt rectangle in pixels.
121 @param Height The height of a rectangle in the blt rectangle in pixels.
122 @param Delta Not used for EfiBltVideoFill or the EfiBltVideoToVideo operation.
123 If a Delta of zero is used, the entire BltBuffer is being operated on.
124 If a subrectangle of the BltBuffer is being used then Delta
125 represents the number of bytes in a row of the BltBuffer.
127 @retval EFI_SUCCESS BltBuffer was drawn to the graphics screen.
128 @retval EFI_INVALID_PARAMETER BltOperation is not valid.
129 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
135 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
136 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BltBuffer
, OPTIONAL
137 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation
,
140 IN UINTN DestinationX
,
141 IN UINTN DestinationY
,
144 IN UINTN Delta OPTIONAL
147 RETURN_STATUS Status
;
149 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
151 Private
= GRAPHICS_OUTPUT_PRIVATE_FROM_THIS (This
);
153 // We have to raise to TPL_NOTIFY, so we make an atomic write to the frame buffer.
154 // We would not want a timer based event (Cursor, ...) to come in while we are
155 // doing this operation.
157 Tpl
= gBS
->RaiseTPL (TPL_NOTIFY
);
158 Status
= FrameBufferBlt (
159 Private
->FrameBufferBltLibConfigure
,
163 DestinationX
, DestinationY
, Width
, Height
,
166 gBS
->RestoreTPL (Tpl
);
168 return RETURN_ERROR (Status
) ? EFI_INVALID_PARAMETER
: EFI_SUCCESS
;
171 CONST GRAPHICS_OUTPUT_PRIVATE_DATA mGraphicsOutputInstanceTemplate
= {
172 GRAPHICS_OUTPUT_PRIVATE_DATA_SIGNATURE
, // Signature
173 NULL
, // GraphicsOutputHandle
175 GraphicsOutputQueryMode
,
176 GraphicsOutputSetMode
,
184 sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
), // SizeOfInfo
185 0, // FrameBufferBase
191 NULL
, // FrameBufferBltLibConfigure
192 0 // FrameBufferBltLibConfigureSize
196 Test whether the Controller can be managed by the driver.
198 @param This Driver Binding protocol instance pointer.
199 @param Controller The PCI controller.
200 @param RemainingDevicePath Optional parameter use to pick a specific child
203 @retval EFI_SUCCESS The driver can manage the video device.
204 @retval other The driver cannot manage the video device.
208 GraphicsOutputDriverBindingSupported (
209 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
210 IN EFI_HANDLE Controller
,
211 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
215 EFI_PCI_IO_PROTOCOL
*PciIo
;
216 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
219 // Since there is only one GraphicsInfo HOB, the driver only manages one video device.
221 if (mDriverStarted
) {
222 return EFI_ALREADY_STARTED
;
226 // Test the PCI I/O Protocol
228 Status
= gBS
->OpenProtocol (
230 &gEfiPciIoProtocolGuid
,
232 This
->DriverBindingHandle
,
234 EFI_OPEN_PROTOCOL_BY_DRIVER
236 if (Status
== EFI_ALREADY_STARTED
) {
237 Status
= EFI_SUCCESS
;
239 if (EFI_ERROR (Status
)) {
244 &gEfiPciIoProtocolGuid
,
245 This
->DriverBindingHandle
,
250 // Test the DevicePath protocol
252 Status
= gBS
->OpenProtocol (
254 &gEfiDevicePathProtocolGuid
,
255 (VOID
**) &DevicePath
,
256 This
->DriverBindingHandle
,
258 EFI_OPEN_PROTOCOL_BY_DRIVER
260 if (Status
== EFI_ALREADY_STARTED
) {
261 Status
= EFI_SUCCESS
;
263 if (EFI_ERROR (Status
)) {
268 &gEfiDevicePathProtocolGuid
,
269 This
->DriverBindingHandle
,
273 if ((RemainingDevicePath
== NULL
) ||
274 IsDevicePathEnd (RemainingDevicePath
) ||
275 CompareMem (RemainingDevicePath
, &mGraphicsOutputAdrNode
, sizeof (mGraphicsOutputAdrNode
)) == 0) {
278 return EFI_INVALID_PARAMETER
;
283 Start the video controller.
285 @param This Driver Binding protocol instance pointer.
286 @param ControllerHandle The PCI controller.
287 @param RemainingDevicePath Optional parameter use to pick a specific child
290 @retval EFI_SUCCESS The driver starts to manage the video device.
291 @retval other The driver cannot manage the video device.
295 GraphicsOutputDriverBindingStart (
296 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
297 IN EFI_HANDLE Controller
,
298 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
302 RETURN_STATUS ReturnStatus
;
303 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
304 EFI_PCI_IO_PROTOCOL
*PciIo
;
305 EFI_DEVICE_PATH
*PciDevicePath
;
308 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*Resources
;
310 EFI_PEI_GRAPHICS_INFO_HOB
*GraphicsInfo
;
311 EFI_PEI_GRAPHICS_DEVICE_INFO_HOB
*DeviceInfo
;
312 EFI_PHYSICAL_ADDRESS FrameBufferBase
;
316 HobStart
= GetFirstGuidHob (&gEfiGraphicsInfoHobGuid
);
317 ASSERT ((HobStart
!= NULL
) && (GET_GUID_HOB_DATA_SIZE (HobStart
) == sizeof (EFI_PEI_GRAPHICS_INFO_HOB
)));
318 GraphicsInfo
= (EFI_PEI_GRAPHICS_INFO_HOB
*) (GET_GUID_HOB_DATA (HobStart
));
320 HobStart
= GetFirstGuidHob (&gEfiGraphicsDeviceInfoHobGuid
);
321 if ((HobStart
== NULL
) || (GET_GUID_HOB_DATA_SIZE (HobStart
) < sizeof (*DeviceInfo
))) {
323 // Use default device infomation when the device info HOB doesn't exist
325 DeviceInfo
= &mDefaultGraphicsDeviceInfo
;
326 DEBUG ((DEBUG_INFO
, "[%a]: GraphicsDeviceInfo HOB doesn't exist!\n", gEfiCallerBaseName
));
328 DeviceInfo
= (EFI_PEI_GRAPHICS_DEVICE_INFO_HOB
*) (GET_GUID_HOB_DATA (HobStart
));
329 DEBUG ((DEBUG_INFO
, "[%a]: GraphicsDeviceInfo HOB:\n"
330 " VendorId = %04x, DeviceId = %04x,\n"
331 " RevisionId = %02x, BarIndex = %x,\n"
332 " SubsystemVendorId = %04x, SubsystemId = %04x\n",
334 DeviceInfo
->VendorId
, DeviceInfo
->DeviceId
,
335 DeviceInfo
->RevisionId
, DeviceInfo
->BarIndex
,
336 DeviceInfo
->SubsystemVendorId
, DeviceInfo
->SubsystemId
));
340 // Open the PCI I/O Protocol
342 Status
= gBS
->OpenProtocol (
344 &gEfiPciIoProtocolGuid
,
346 This
->DriverBindingHandle
,
348 EFI_OPEN_PROTOCOL_BY_DRIVER
350 if (Status
== EFI_ALREADY_STARTED
) {
351 Status
= EFI_SUCCESS
;
353 ASSERT_EFI_ERROR (Status
);
355 Status
= gBS
->OpenProtocol (
357 &gEfiDevicePathProtocolGuid
,
358 (VOID
**) &PciDevicePath
,
359 This
->DriverBindingHandle
,
361 EFI_OPEN_PROTOCOL_BY_DRIVER
363 if (Status
== EFI_ALREADY_STARTED
) {
364 Status
= EFI_SUCCESS
;
366 ASSERT_EFI_ERROR (Status
);
369 // Read the PCI Class Code from the PCI Device
371 Status
= PciIo
->Pci
.Read (PciIo
, EfiPciIoWidthUint8
, 0, sizeof (Pci
), &Pci
);
372 if (!EFI_ERROR (Status
)) {
373 if (!IS_PCI_DISPLAY (&Pci
) || (
374 ((DeviceInfo
->VendorId
!= MAX_UINT16
) && (DeviceInfo
->VendorId
!= Pci
.Hdr
.VendorId
)) ||
375 ((DeviceInfo
->DeviceId
!= MAX_UINT16
) && (DeviceInfo
->DeviceId
!= Pci
.Hdr
.DeviceId
)) ||
376 ((DeviceInfo
->RevisionId
!= MAX_UINT8
) && (DeviceInfo
->RevisionId
!= Pci
.Hdr
.RevisionID
)) ||
377 ((DeviceInfo
->SubsystemVendorId
!= MAX_UINT16
) && (DeviceInfo
->SubsystemVendorId
!= Pci
.Device
.SubsystemVendorID
)) ||
378 ((DeviceInfo
->SubsystemId
!= MAX_UINT16
) && (DeviceInfo
->SubsystemId
!= Pci
.Device
.SubsystemID
))
382 // It's not a video device, or device infomation doesn't match.
384 Status
= EFI_UNSUPPORTED
;
387 // If it's a video device and device information matches, use the BarIndex
388 // from device information, or any BAR if BarIndex is not specified
389 // whose size >= the frame buffer size from GraphicsInfo HOB.
390 // Store the new frame buffer base.
392 for (Index
= 0; Index
< MAX_PCI_BAR
; Index
++) {
393 if ((DeviceInfo
->BarIndex
!= MAX_UINT8
) && (DeviceInfo
->BarIndex
!= Index
)) {
396 Status
= PciIo
->GetBarAttributes (PciIo
, Index
, NULL
, (VOID
**) &Resources
);
397 if (!EFI_ERROR (Status
)) {
398 DEBUG ((DEBUG_INFO
, "[%a]: BAR[%d]: Base = %lx, Length = %lx\n",
399 gEfiCallerBaseName
, Index
, Resources
->AddrRangeMin
, Resources
->AddrLen
));
400 if ((Resources
->Desc
== ACPI_ADDRESS_SPACE_DESCRIPTOR
) &&
401 (Resources
->Len
== (UINT16
) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
) - 3)) &&
402 (Resources
->ResType
== ACPI_ADDRESS_SPACE_TYPE_MEM
) &&
403 (Resources
->AddrLen
>= GraphicsInfo
->FrameBufferSize
)
405 if (FrameBufferBase
== 0) {
406 FrameBufferBase
= Resources
->AddrRangeMin
;
408 if (DeviceInfo
->BarIndex
== MAX_UINT8
) {
409 if (Resources
->AddrRangeMin
== GraphicsInfo
->FrameBufferBase
) {
410 FrameBufferBase
= Resources
->AddrRangeMin
;
419 if (Index
== MAX_PCI_BAR
) {
420 Status
= EFI_UNSUPPORTED
;
422 DEBUG ((DEBUG_INFO
, "[%a]: ... matched!\n", gEfiCallerBaseName
));
427 if (EFI_ERROR (Status
)) {
431 if ((RemainingDevicePath
!= NULL
) && IsDevicePathEnd (RemainingDevicePath
)) {
435 Private
= AllocateCopyPool (sizeof (mGraphicsOutputInstanceTemplate
), &mGraphicsOutputInstanceTemplate
);
436 if (Private
== NULL
) {
437 Status
= EFI_OUT_OF_RESOURCES
;
441 Private
->GraphicsOutputMode
.FrameBufferBase
= FrameBufferBase
;
442 Private
->GraphicsOutputMode
.FrameBufferSize
= GraphicsInfo
->FrameBufferSize
;
443 Private
->GraphicsOutputMode
.Info
= &GraphicsInfo
->GraphicsMode
;
446 // Fix up Mode pointer in GraphicsOutput
448 Private
->GraphicsOutput
.Mode
= &Private
->GraphicsOutputMode
;
453 Status
= PciIo
->Attributes (
455 EfiPciIoAttributeOperationGet
,
457 &Private
->PciAttributes
459 if (!EFI_ERROR (Status
)) {
460 Status
= PciIo
->Attributes (
462 EfiPciIoAttributeOperationEnable
,
463 EFI_PCI_DEVICE_ENABLE
,
468 if (EFI_ERROR (Status
)) {
473 // Create the FrameBufferBltLib configuration.
475 ReturnStatus
= FrameBufferBltConfigure (
476 (VOID
*) (UINTN
) Private
->GraphicsOutput
.Mode
->FrameBufferBase
,
477 Private
->GraphicsOutput
.Mode
->Info
,
478 Private
->FrameBufferBltLibConfigure
,
479 &Private
->FrameBufferBltLibConfigureSize
481 if (ReturnStatus
== RETURN_BUFFER_TOO_SMALL
) {
482 Private
->FrameBufferBltLibConfigure
= AllocatePool (Private
->FrameBufferBltLibConfigureSize
);
483 if (Private
->FrameBufferBltLibConfigure
!= NULL
) {
484 ReturnStatus
= FrameBufferBltConfigure (
485 (VOID
*) (UINTN
) Private
->GraphicsOutput
.Mode
->FrameBufferBase
,
486 Private
->GraphicsOutput
.Mode
->Info
,
487 Private
->FrameBufferBltLibConfigure
,
488 &Private
->FrameBufferBltLibConfigureSize
492 if (RETURN_ERROR (ReturnStatus
)) {
493 Status
= EFI_OUT_OF_RESOURCES
;
494 goto RestorePciAttributes
;
497 Private
->DevicePath
= AppendDevicePathNode (PciDevicePath
, (EFI_DEVICE_PATH_PROTOCOL
*) &mGraphicsOutputAdrNode
);
498 if (Private
->DevicePath
== NULL
) {
499 Status
= EFI_OUT_OF_RESOURCES
;
500 goto RestorePciAttributes
;
503 Status
= gBS
->InstallMultipleProtocolInterfaces (
504 &Private
->GraphicsOutputHandle
,
505 &gEfiGraphicsOutputProtocolGuid
, &Private
->GraphicsOutput
,
506 &gEfiDevicePathProtocolGuid
, Private
->DevicePath
,
510 if (!EFI_ERROR (Status
)) {
511 Status
= gBS
->OpenProtocol (
513 &gEfiPciIoProtocolGuid
,
514 (VOID
**) &Private
->PciIo
,
515 This
->DriverBindingHandle
,
516 Private
->GraphicsOutputHandle
,
517 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
519 if (!EFI_ERROR (Status
)) {
520 mDriverStarted
= TRUE
;
522 gBS
->UninstallMultipleProtocolInterfaces (
523 Private
->GraphicsOutputHandle
,
524 &gEfiGraphicsOutputProtocolGuid
, &Private
->GraphicsOutput
,
525 &gEfiDevicePathProtocolGuid
, Private
->DevicePath
,
531 RestorePciAttributes
:
532 if (EFI_ERROR (Status
)) {
534 // Restore original PCI attributes
538 EfiPciIoAttributeOperationSet
,
539 Private
->PciAttributes
,
545 if (EFI_ERROR (Status
)) {
546 if (Private
!= NULL
) {
547 if (Private
->DevicePath
!= NULL
) {
548 FreePool (Private
->DevicePath
);
550 if (Private
->FrameBufferBltLibConfigure
!= NULL
) {
551 FreePool (Private
->FrameBufferBltLibConfigure
);
558 if (EFI_ERROR (Status
)) {
560 // Close the PCI I/O Protocol
564 &gEfiDevicePathProtocolGuid
,
565 This
->DriverBindingHandle
,
570 // Close the PCI I/O Protocol
574 &gEfiPciIoProtocolGuid
,
575 This
->DriverBindingHandle
,
583 Stop the video controller.
585 @param This Driver Binding protocol instance pointer.
586 @param Controller The PCI controller.
587 @param NumberOfChildren The number of child device handles in ChildHandleBuffer.
588 @param ChildHandleBuffer An array of child handles to be freed. May be NULL
589 if NumberOfChildren is 0.
591 @retval EFI_SUCCESS The device was stopped.
592 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
596 GraphicsOutputDriverBindingStop (
597 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
598 IN EFI_HANDLE Controller
,
599 IN UINTN NumberOfChildren
,
600 IN EFI_HANDLE
*ChildHandleBuffer
604 EFI_GRAPHICS_OUTPUT_PROTOCOL
*Gop
;
605 GRAPHICS_OUTPUT_PRIVATE_DATA
*Private
;
607 if (NumberOfChildren
== 0) {
610 // Close the PCI I/O Protocol
612 Status
= gBS
->CloseProtocol (
614 &gEfiPciIoProtocolGuid
,
615 This
->DriverBindingHandle
,
618 ASSERT_EFI_ERROR (Status
);
620 Status
= gBS
->CloseProtocol (
622 &gEfiDevicePathProtocolGuid
,
623 This
->DriverBindingHandle
,
626 ASSERT_EFI_ERROR (Status
);
630 ASSERT (NumberOfChildren
== 1);
631 Status
= gBS
->OpenProtocol (
632 ChildHandleBuffer
[0],
633 &gEfiGraphicsOutputProtocolGuid
,
635 This
->DriverBindingHandle
,
636 ChildHandleBuffer
[0],
637 EFI_OPEN_PROTOCOL_GET_PROTOCOL
639 if (EFI_ERROR (Status
)) {
643 Private
= GRAPHICS_OUTPUT_PRIVATE_FROM_THIS (Gop
);
645 Status
= gBS
->CloseProtocol (
647 &gEfiPciIoProtocolGuid
,
648 This
->DriverBindingHandle
,
649 Private
->GraphicsOutputHandle
651 ASSERT_EFI_ERROR (Status
);
653 // Remove the GOP protocol interface from the system
655 Status
= gBS
->UninstallMultipleProtocolInterfaces (
656 Private
->GraphicsOutputHandle
,
657 &gEfiGraphicsOutputProtocolGuid
, &Private
->GraphicsOutput
,
658 &gEfiDevicePathProtocolGuid
, Private
->DevicePath
,
661 if (!EFI_ERROR (Status
)) {
663 // Restore original PCI attributes
665 Status
= Private
->PciIo
->Attributes (
667 EfiPciIoAttributeOperationSet
,
668 Private
->PciAttributes
,
671 ASSERT_EFI_ERROR (Status
);
673 FreePool (Private
->DevicePath
);
674 FreePool (Private
->FrameBufferBltLibConfigure
);
675 mDriverStarted
= FALSE
;
677 Status
= gBS
->OpenProtocol (
679 &gEfiPciIoProtocolGuid
,
680 (VOID
**) &Private
->PciIo
,
681 This
->DriverBindingHandle
,
682 Private
->GraphicsOutputHandle
,
683 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
685 ASSERT_EFI_ERROR (Status
);
690 EFI_DRIVER_BINDING_PROTOCOL mGraphicsOutputDriverBinding
= {
691 GraphicsOutputDriverBindingSupported
,
692 GraphicsOutputDriverBindingStart
,
693 GraphicsOutputDriverBindingStop
,
700 The Entry Point for GraphicsOutput driver.
702 It installs DriverBinding, ComponentName and ComponentName2 protocol if there is
703 GraphicsInfo HOB passed from Graphics PEIM.
705 @param[in] ImageHandle The firmware allocated handle for the EFI image.
706 @param[in] SystemTable A pointer to the EFI System Table.
708 @retval EFI_SUCCESS The entry point is executed successfully.
709 @retval other Some error occurs when executing this entry point.
714 InitializeGraphicsOutput (
715 IN EFI_HANDLE ImageHandle
,
716 IN EFI_SYSTEM_TABLE
*SystemTable
722 HobStart
= GetFirstGuidHob (&gEfiGraphicsInfoHobGuid
);
724 if ((HobStart
== NULL
) || (GET_GUID_HOB_DATA_SIZE (HobStart
) < sizeof (EFI_PEI_GRAPHICS_INFO_HOB
))) {
725 return EFI_NOT_FOUND
;
728 Status
= EfiLibInstallDriverBindingComponentName2 (
731 &mGraphicsOutputDriverBinding
,
733 &mGraphicsOutputComponentName
,
734 &mGraphicsOutputComponentName2
736 ASSERT_EFI_ERROR (Status
);