summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2013-01-07 23:04:36 +0100
committerJulien Cristau <jcristau@debian.org>2013-01-12 23:01:04 +0100
commit49381ff2c3aa98be5bb84494b2ad3f81a0d31bcc (patch)
treef86512d9fc85b08cdbafc2cb1ad44f8c1b1fd8ae
parentfcd27b2b4ab2a181d5263296e71cda2d8772ba2d (diff)
Restrict kernel driver matching to g200 server chips
Otherwise we might catch devices handled by matroxfb, not the mgag200 kms driver. Debian bug#697532 Reported-by: olafBuddenhagen@gmx.net Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--src/mga_driver.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 8c4bb9c..5cce7ac 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -676,12 +676,22 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev,
#endif
if (pci_device_has_kernel_driver(dev)) {
- xf86DrvMsg(0, X_ERROR,
- "mga: The PCI device 0x%x at %2.2d@%2.2d:%2.2d:%1.1d has a kernel module claiming it.\n",
- dev->device_id, dev->bus, dev->domain, dev->dev, dev->func);
- xf86DrvMsg(0, X_ERROR,
- "mga: This driver cannot operate until it has been unloaded.\n");
- return FALSE;
+ /* If it's a G200 server chip, it's probably on KMS, so bail; if not,
+ * it might be using matroxfb, which is ok. */
+ switch (dev->device_id) {
+ case PCI_CHIP_MGAG200_SE_A_PCI:
+ case PCI_CHIP_MGAG200_SE_B_PCI:
+ case PCI_CHIP_MGAG200_EV_PCI:
+ case PCI_CHIP_MGAG200_ER_PCI:
+ case PCI_CHIP_MGAG200_WINBOND_PCI:
+ case PCI_CHIP_MGAG200_EH_PCI:
+ xf86DrvMsg(0, X_ERROR,
+ "mga: The PCI device 0x%x at %2.2d@%2.2d:%2.2d:%1.1d has a kernel module claiming it.\n",
+ dev->device_id, dev->bus, dev->domain, dev->dev, dev->func);
+ xf86DrvMsg(0, X_ERROR,
+ "mga: This driver cannot operate until it has been unloaded.\n");
+ return FALSE;
+ }
}
/* Allocate a ScrnInfoRec and claim the slot */