if we find a kernel driver the code leave the pci slot claimed which
stops us falling back. unclaim the pci slot. patch inspired by
correspondant patch for cirrus driver by Dave Airlie.

Signed-off-by: Stefan Dirsch <sndir...@suse.de>
---
 src/ast_driver.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/ast_driver.c b/src/ast_driver.c
index e0dd4fa..677c170 100644
--- a/src/ast_driver.c
+++ b/src/ast_driver.c
@@ -291,7 +291,10 @@ ASTProbe(DriverPtr drv, int flags)
                                   devSections, numDevSections,
                                   drv, &usedChips);
 
-    free(devSections);
+    if (numUsed <= 0) {
+       free(devSections);
+       return FALSE;
+    }
 
     if (flags & PROBE_DETECT) {
         if (numUsed > 0)
@@ -310,6 +313,8 @@ ASTProbe(DriverPtr drv, int flags)
                                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");
+                    xf86UnclaimPciSlot(pPci, devSections[0]);
+                    free(devSections);
                     return FALSE;
                 }
             }
@@ -343,6 +348,7 @@ ASTProbe(DriverPtr drv, int flags)
         }  /* end of for-loop */
     } /* end of if flags */
 
+    free(devSections);
     free(usedChips);
 
     return foundScreen;
-- 
1.8.4.5

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to