[PATCH 2/2] add SERVER_SUPPORTS_NON_PCI_PLATFORM_DEVS

Rob Clark robdclark at gmail.com
Mon Jun 16 11:13:17 PDT 2014


Give the DDX a way to know whether non-pci platform devices are
completely broken or not.  For xserver prior to the fix, the
DDX should not claim a platform device in platformProbe(), as
the server will fallback to old ->Probe(), which will fail if
the device is already claimed.  Meaning that a user could not
make things work even with a .conf file to explicitly specify
the driver to use.

Idea suggested by Hans de Goede.

Signed-off-by: Rob Clark <robdclark at gmail.com>
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
---
 hw/xfree86/common/xf86Init.c | 10 +++++++++-
 hw/xfree86/common/xf86str.h  |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 5a45004..9b6a8b5 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -546,10 +546,18 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
             if (xf86DriverList[i]->Identify != NULL)
                 xf86DriverList[i]->Identify(0);
 
-            if (xf86DriverList[i]->driverFunc)
+            if (xf86DriverList[i]->driverFunc) {
                 xf86DriverList[i]->driverFunc(NULL,
                                               GET_REQUIRED_HW_INTERFACES,
                                               &flags);
+                /* also let the driver know that it is safe to
+                 * allow platformProbe() to claim the device
+                 * if it is a non-pci platform device:
+                 */
+                xf86DriverList[i]->driverFunc(NULL,
+                                              SERVER_SUPPORTS_NON_PCI_PLATFORM_DEVS,
+                                              NULL);
+            }
 
             if (NEED_IO_ENABLED(flags))
                 want_hw_access = TRUE;
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index a81e886..6f27f18 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -258,6 +258,7 @@ typedef enum {
     RR_GET_MODE_MM,
     GET_REQUIRED_HW_INTERFACES = 10,
     SUPPORTS_SERVER_FDS = 11,
+    SERVER_SUPPORTS_NON_PCI_PLATFORM_DEVS = 12,
 } xorgDriverFuncOp;
 
 typedef Bool xorgDriverFuncProc(ScrnInfoPtr, xorgDriverFuncOp, void *);
-- 
1.9.3



More information about the xorg-devel mailing list