From 0af7dba78559ce82b4c3eed0862415efcde51863 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 17 May 2012 10:19:21 +0100 Subject: 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 --- src/mga_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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, -- cgit v1.2.3