EFI_STATUS Status;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
PCI_TYPE00 Pci;\r
- EFI_DEV_PATH *Node;\r
QEMU_VIDEO_CARD *Card;\r
\r
//\r
}\r
\r
Status = EFI_UNSUPPORTED;\r
- //\r
- // See if the I/O enable is on. Most systems only allow one VGA device to be turned on\r
- // at a time, so see if this is one that is turned on.\r
- //\r
- // if (((Pci.Hdr.Command & 0x01) == 0x01)) {\r
- //\r
- // See if this is a Cirrus Logic PCI controller\r
- //\r
Card = QemuVideoDetect(Pci.Hdr.VendorId, Pci.Hdr.DeviceId);\r
if (Card != NULL) {\r
DEBUG ((EFI_D_INFO, "QemuVideo: %s detected\n", Card->Name));\r
Status = EFI_SUCCESS;\r
- //\r
- // If this is an Intel 945 graphics controller,\r
- // go further check RemainingDevicePath validation\r
- //\r
- if (RemainingDevicePath != NULL) {\r
- Node = (EFI_DEV_PATH *) RemainingDevicePath;\r
- //\r
- // Check if RemainingDevicePath is the End of Device Path Node, \r
- // if yes, return EFI_SUCCESS\r
- //\r
- if (!IsDevicePathEnd (Node)) {\r
- //\r
- // If RemainingDevicePath isn't the End of Device Path Node,\r
- // check its validation\r
- //\r
- if (Node->DevPath.Type != ACPI_DEVICE_PATH ||\r
- Node->DevPath.SubType != ACPI_ADR_DP ||\r
- DevicePathNodeLength(&Node->DevPath) != sizeof(ACPI_ADR_DEVICE_PATH)) {\r
- Status = EFI_UNSUPPORTED;\r
- }\r
- }\r
- }\r
}\r
\r
Done:\r
EFI_STATUS Status;\r
QEMU_VIDEO_PRIVATE_DATA *Private;\r
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r
+ ACPI_ADR_DEVICE_PATH AcpiDeviceNode;\r
PCI_TYPE00 Pci;\r
QEMU_VIDEO_CARD *Card;\r
EFI_PCI_IO_PROTOCOL *ChildPciIo;\r
//\r
// Set Gop Device Path\r
//\r
- if (RemainingDevicePath == NULL) {\r
- ACPI_ADR_DEVICE_PATH AcpiDeviceNode;\r
-\r
- ZeroMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH));\r
- AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH;\r
- AcpiDeviceNode.Header.SubType = ACPI_ADR_DP;\r
- AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0);\r
- SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DEVICE_PATH));\r
-\r
- Private->GopDevicePath = AppendDevicePathNode (\r
- ParentDevicePath,\r
- (EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode\r
- );\r
- if (Private->GopDevicePath == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto RestoreAttributes;\r
- }\r
- } else if (!IsDevicePathEnd (RemainingDevicePath)) {\r
- //\r
- // If RemainingDevicePath isn't the End of Device Path Node, \r
- // only scan the specified device by RemainingDevicePath\r
- //\r
- Private->GopDevicePath = AppendDevicePathNode (ParentDevicePath, RemainingDevicePath);\r
- if (Private->GopDevicePath == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto RestoreAttributes;\r
- }\r
+ ZeroMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH));\r
+ AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH;\r
+ AcpiDeviceNode.Header.SubType = ACPI_ADR_DP;\r
+ AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0);\r
+ SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DEVICE_PATH));\r
+\r
+ Private->GopDevicePath = AppendDevicePathNode (\r
+ ParentDevicePath,\r
+ (EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode\r
+ );\r
+ if (Private->GopDevicePath == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto RestoreAttributes;\r
}\r
\r
//\r
- // Create new child handle and install the device path protocol on it only if\r
- // RemainingDevicePath equals NULL, or doesn't point to the End of Device\r
- // Path Node.\r
+ // Create new child handle and install the device path protocol on it.\r
//\r
- if (Private->GopDevicePath != NULL) {\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &Private->Handle,\r
- &gEfiDevicePathProtocolGuid,\r
- Private->GopDevicePath,\r
- NULL\r
- );\r
- if (EFI_ERROR (Status)) {\r
- goto FreeGopDevicePath;\r
- }\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &Private->Handle,\r
+ &gEfiDevicePathProtocolGuid,\r
+ Private->GopDevicePath,\r
+ NULL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto FreeGopDevicePath;\r
}\r
\r
//\r
goto UninstallGopDevicePath;\r
}\r
\r
- //\r
- // If RemainingDevicePath points to the End of Device Path Node, then we\r
- // haven't created a child handle, and we're done.\r
- //\r
- if (Private->GopDevicePath == NULL) {\r
- return EFI_SUCCESS;\r
- }\r
-\r
//\r
// Start the GOP software stack.\r
//\r
FreePool (Private->ModeData);\r
\r
UninstallGopDevicePath:\r
- //\r
- // Handles the case transparently when Private->Handle and\r
- // Private->GopDevicePath are NULL.\r
- //\r
gBS->UninstallProtocolInterface (Private->Handle,\r
&gEfiDevicePathProtocolGuid, Private->GopDevicePath);\r
\r
FreeGopDevicePath:\r
- if (Private->GopDevicePath != NULL) {\r
- FreePool (Private->GopDevicePath);\r
- }\r
+ FreePool (Private->GopDevicePath);\r
\r
RestoreAttributes:\r
Private->PciIo->Attributes (Private->PciIo, EfiPciIoAttributeOperationSet,\r