From f981caeb7ebf53fea9d8f852edea6605d44d975e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 17 May 2012 10:27:50 +0100 Subject: ast: don't bind to device if there is a loaded PCI driver. This stops this driver being used on top of the kernel modesetting driver, so fallback works correctly. Signed-off-by: Dave Airlie --- src/ast_driver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ast_driver.c b/src/ast_driver.c index 67d6f78..7c0095f 100644 --- a/src/ast_driver.c +++ b/src/ast_driver.c @@ -295,6 +295,21 @@ ASTProbe(DriverPtr drv, int flags) for (i = 0; i < numUsed; i++) { ScrnInfoPtr pScrn = NULL; +#ifdef XSERVER_LIBPCIACCESS + { + struct pci_device *pPci = xf86GetPciInfoForEntity(usedChips[i]); + + if (pci_device_has_kernel_driver(pPci)) { + xf86DrvMsg(0, X_ERROR, + "ast: The PCI device 0x%x at %2.2d@%2.2d:%2.2d:%1.1d has a kernel module claiming it.\n", + pPci->device_id, pPci->bus, pPci->domain, pPci->dev, pPci->func); + xf86DrvMsg(0, X_ERROR, + "cirrus: This driver cannot operate until it has been unloaded.\n"); + return FALSE; + } + } +#endif + /* Allocate new ScrnInfoRec and claim the slot */ if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], ASTPciChipsets, 0, 0, 0, 0, 0))) -- cgit v1.2.3