From: Pauli Nieminen Subject: [PATCH] kms: Use libdrm function to preload module before checking for KMS. Date: Tue, 23 Feb 2010 03:47:18 +0200 Message-ID: <1266889639-23239-1-git-send-email-suokkos@gmail.com> References: <1266889447-22995-1-git-send-email-suokkos@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1266889447-22995-1-git-send-email-suokkos-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: xorg-driver-ati-bounces-go0+a7rfsptAfugRpC6u6w@public.gmane.org Errors-To: xorg-driver-ati-bounces-go0+a7rfsptAfugRpC6u6w@public.gmane.org To: xorg-driver-ati-go0+a7rfsptAfugRpC6u6w@public.gmane.org Cc: dri-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: dri-devel@lists.freedesktop.org This prevents ddx from selecting UMS if KMS is enabled but kernel module is not loaded before X. Signed-off-by: Pauli Nieminen --- 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