diff options
author | Dave Airlie <airlied@redhat.com> | 2012-05-17 10:27:50 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-17 10:27:50 +0100 |
commit | f981caeb7ebf53fea9d8f852edea6605d44d975e (patch) | |
tree | 1feae66b40a5d16fb8fa00978bd252b7bb3cae18 | |
parent | c954c0874b8f776fae7a38cb2ac7f4a311f90980 (diff) |
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 <airlied@redhat.com>
-rw-r--r-- | src/ast_driver.c | 15 |
1 files changed, 15 insertions, 0 deletions
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))) |