summaryrefslogtreecommitdiff
authorDave Airlie <airlied@redhat.com>2012-05-17 09:19:21 (GMT)
committer Dave Airlie <airlied@redhat.com>2012-05-17 09:19:21 (GMT)
commit0af7dba78559ce82b4c3eed0862415efcde51863 (patch) (side-by-side diff)
treea8f6a4a247eab845f59aea58433c35aa44307b79
parent3991971c23ebe596742c004b1e583dfb1aa14ec4 (diff)
downloadxf86-video-mga-0af7dba78559ce82b4c3eed0862415efcde51863.zip
xf86-video-mga-0af7dba78559ce82b4c3eed0862415efcde51863.tar.gz
mga: don't bind to device if there is a kernel driver
this should only pick up KMS drivers and not old drm drivers. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/mga_driver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mga_driver.c b/src/mga_driver.c
index af005f1..61eb96c 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -682,6 +682,15 @@ MGAPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev,
smga->pvp = 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;
+ }
+
/* Allocate a ScrnInfoRec and claim the slot */
pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, MGAPciChipsets,
NULL,