documentation on UGA for details on how to write a UGA driver that is able\r
to function both in the EFI pre-boot environment and from the OS runtime.\r
\r
- Copyright (c) 2006 - 2009, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
+ Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
BOOLEAN PciAttributesSaved;\r
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r
ACPI_ADR_DEVICE_PATH AcpiDeviceNode;\r
+ UINT64 Supports;\r
\r
PciAttributesSaved = FALSE;\r
//\r
goto Error;\r
}\r
\r
+ //\r
+ // Get supported PCI attributes\r
+ //\r
+ Status = Private->PciIo->Attributes (\r
+ Private->PciIo,\r
+ EfiPciIoAttributeOperationSupported,\r
+ 0,\r
+ &Supports\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto Error;\r
+ }\r
+\r
+ Supports &= (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16);\r
+ if (Supports == 0 || Supports == (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) {\r
+ Status = EFI_UNSUPPORTED;\r
+ goto Error;\r
+ } \r
+\r
//\r
// Save original PCI attributes\r
//\r
PciAttributesSaved = TRUE;\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
- NULL\r
- );\r
+ Private->PciIo,\r
+ EfiPciIoAttributeOperationEnable,\r
+ EFI_PCI_DEVICE_ENABLE | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | Supports,\r
+ NULL\r
+ );\r
if (EFI_ERROR (Status)) {\r
goto Error;\r
}\r