forked from pool/xorg-x11-server
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
Index: linuxPci.c
|
|
===================================================================
|
|
--- linuxPci.c.orig
|
|
+++ linuxPci.c
|
|
@@ -274,7 +274,7 @@ get_parent_bridge(struct pci_device *dev
|
|
struct pci_id_match bridge_match = {
|
|
PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
|
|
(PCI_CLASS_BRIDGE << 16) | (PCI_SUBCLASS_BRIDGE_PCI << 8),
|
|
- 0
|
|
+ (PCI_CLASS_BRIDGE << 16) | (PCI_SUBCLASS_BRIDGE_PCI << 8)
|
|
};
|
|
struct pci_device *bridge;
|
|
struct pci_device_iterator *iter;
|
|
@@ -512,7 +512,6 @@ IOADDRESS
|
|
xf86MapLegacyIO(struct pci_device *dev)
|
|
{
|
|
const int domain = dev->domain;
|
|
- struct pci_device *bridge = get_parent_bridge(dev);
|
|
int fd;
|
|
|
|
if (domain >= MAX_DOMAINS)
|
|
@@ -520,9 +519,11 @@ xf86MapLegacyIO(struct pci_device *dev)
|
|
|
|
if (DomainMmappedIO[domain] == NULL) {
|
|
/* Permanently map all of I/O space */
|
|
- fd = linuxOpenLegacy(bridge, "legacy_io");
|
|
+ fd = linuxOpenLegacy(dev, "legacy_io");
|
|
if (fd < 0) {
|
|
- DomainMmappedIO[domain] = linuxMapPci(-1, VIDMEM_MMIO, bridge,
|
|
+ struct pci_device *bridge = get_parent_bridge(dev);
|
|
+ if (bridge != NULL)
|
|
+ DomainMmappedIO[domain] = linuxMapPci(-1, VIDMEM_MMIO, bridge,
|
|
0, linuxGetIOSize(bridge),
|
|
PCIIOC_MMAP_IS_IO);
|
|
}
|