From 49381ff2c3aa98be5bb84494b2ad3f81a0d31bcc Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 7 Jan 2013 23:04:36 +0100 Subject: 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 Signed-off-by: Julien Cristau --- src/mga_driver.c | 22 ++++++++++++++++------ 1 file 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 */ -- cgit v1.2.3