From patchwork Tue Feb 23 01:47:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Nieminen X-Patchwork-Id: 81379 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1N35fPM028408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 23 Feb 2010 03:06:17 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Njl4M-0007iZ-6N; Tue, 23 Feb 2010 03:04:18 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Njl4L-0007iT-1d for dri-devel@lists.sourceforge.net; Tue, 23 Feb 2010 03:04:17 +0000 Received-SPF: neutral (sfi-mx-2.v28.ch3.sourceforge.com: 213.243.153.184 is neither permitted nor denied by domain of gmail.com) client-ip=213.243.153.184; envelope-from=suokkos@gmail.com; helo=filtteri1.pp.htv.fi; Received: from filtteri1.pp.htv.fi ([213.243.153.184]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1Njl4J-0002dY-Sv for dri-devel@lists.sourceforge.net; Tue, 23 Feb 2010 03:04:16 +0000 Received: from localhost (localhost [127.0.0.1]) by filtteri1.pp.htv.fi (Postfix) with ESMTP id E15E38BBBA; Tue, 23 Feb 2010 03:47:36 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri1.pp.htv.fi [213.243.153.184]) (amavisd-new, port 10024) with ESMTP id cUl94MuLIqiG; Tue, 23 Feb 2010 03:47:36 +0200 (EET) Received: from localhost.localdomain (cs181130083.pp.htv.fi [82.181.130.83]) by smtp5.welho.com (Postfix) with ESMTP id 51E355BC002; Tue, 23 Feb 2010 03:47:36 +0200 (EET) From: Pauli Nieminen To: xorg-driver-ati@lists.x.org 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> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1266889447-22995-1-git-send-email-suokkos@gmail.com> References: <1266889447-22995-1-git-send-email-suokkos@gmail.com> X-Spam-Score: 0.8 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.2 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) -0.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Njl4J-0002dY-Sv Cc: dri-devel@lists.sourceforge.net X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 23 Feb 2010 03:06:17 +0000 (UTC) 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,