From 82d51e6df2bf677bdf24376092bcaa79b534f6e5 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 1 Aug 2008 13:17:55 -0400 Subject: [PATCH] Silence the "No matching Device section" warning in some harmless cases. If the device doesn't have any BARs then it's just a stub for some lame operating systems that need one PCI device per output for multihead. No point in warning about it. --- hw/xfree86/common/xf86Helper.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index fedd7a3f7..c983b9ad9 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1550,6 +1550,21 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist) return i; } +static Bool +pciDeviceHasBars(struct pci_device *pci) +{ + int i; + + for (i = 0; i < 6; i++) + if (pci->regions[0].size) + return TRUE; + + if (pci->rom_size) + return TRUE; + + return FALSE; +} + struct Inst { struct pci_device * pci; GDevPtr dev; @@ -1804,7 +1819,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, } if (devBus) dev = devBus; /* busID preferred */ if (!dev) { - if ( xf86CheckPciSlot( pPci ) ) { + if (xf86CheckPciSlot(pPci) && pciDeviceHasBars(pPci)) { xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " "for instance (BusID PCI:%u@%u:%u:%u) found\n", driverName, pPci->domain, pPci->bus, pPci->dev,