[PATCH] kms: Use libdrm function to preload module before checking for KMS.

Pauli Nieminen suokkos at gmail.com
Mon Feb 22 17:47:18 PST 2010


This prevents ddx from selecting UMS if KMS is enabled but
kernel module is not loaded before X.

Signed-off-by: Pauli Nieminen <suokkos at gmail.com>
---
 configure.ac       |    3 +++
 src/radeon_probe.c |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index a9e5b76..61360a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,9 @@ if test "$DRI" != no; then
                       [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
 	AC_CHECK_HEADER([damage.h],
                       [have_damage_h="yes"], [have_damage_h="no"],[-])
+
+        CPPFLAGS="$CPPFLAGS $DRI_LIBS"
+        AC_CHECK_FUNCS([drmCheckModuleAndModesettingSupported])
 	CPPFLAGS="$save_CPPFLAGS"
 fi
 
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index 42e7259..e169ee4 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -99,7 +99,13 @@ static Bool radeon_kernel_mode_enabled(ScrnInfoPtr pScrn, struct pci_device *pci
     }
 
     busIdString = DRICreatePCIBusID(pci_dev);
+
+#ifdef HAVE_DRMCHECKMODULEANDMODESETTINGSUPPORTED
+    ret = drmCheckModuleAndModesettingSupported(RADEON_DRIVER_NAME, busIdString);
+#else
+#warning "libdrm doesn't support module loading in KMS check. You should upgrade libdrm to 2.4.19."
     ret = drmCheckModesettingSupported(busIdString);
+#endif
     xfree(busIdString);
     if (ret) {
       xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
-- 
1.6.3.3



More information about the xorg-driver-ati mailing list