This driver is a sample implementation of the Graphics Output Protocol for\r
the QEMU (Cirrus Logic 5446) video controller.\r
\r
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
PCI_TYPE00 Pci;\r
QEMU_VIDEO_CARD *Card;\r
EFI_PCI_IO_PROTOCOL *ChildPciIo;\r
+ UINT64 SupportedVgaIo;\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
goto ClosePciIo;\r
}\r
\r
+ //\r
+ // Get supported PCI attributes\r
+ //\r
+ Status = Private->PciIo->Attributes (\r
+ Private->PciIo,\r
+ EfiPciIoAttributeOperationSupported,\r
+ 0,\r
+ &SupportedVgaIo\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto ClosePciIo;\r
+ }\r
+\r
+ SupportedVgaIo &= (UINT64)(EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16);\r
+ if (SupportedVgaIo == 0) {\r
+ Status = EFI_UNSUPPORTED;\r
+ goto ClosePciIo;\r
+ }\r
+\r
//\r
// Set new PCI attributes\r
//\r
Status = Private->PciIo->Attributes (\r
Private->PciIo,\r
EfiPciIoAttributeOperationEnable,\r
- EFI_PCI_DEVICE_ENABLE | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO,\r
+ EFI_PCI_DEVICE_ENABLE | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | SupportedVgaIo,\r
NULL\r
);\r
if (EFI_ERROR (Status)) {\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- //\r
- // Install EFI Driver Supported EFI Version Protocol required for\r
- // EFI drivers that are on PCI and other plug in cards.\r
- //\r
- gQemuVideoDriverSupportedEfiVersion.FirmwareVersion = PcdGet32 (PcdDriverSupportedEfiVersion);\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &ImageHandle,\r
- &gEfiDriverSupportedEfiVersionProtocolGuid,\r
- &gQemuVideoDriverSupportedEfiVersion,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
return Status;\r
}\r