kms: Use libdrm function to preload module before checking for KMS.
diff mbox

Message ID 1266889639-23239-1-git-send-email-suokkos@gmail.com
State New, archived
Headers show

Commit Message

Pauli Nieminen Feb. 23, 2010, 1:47 a.m. UTC
None

Patch
diff mbox

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,