From patchwork Tue Aug 18 19:35:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 42410 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7IJZnxs015156 for ; Tue, 18 Aug 2009 19:35:49 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E55A9E8F9; Tue, 18 Aug 2009 12:35:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from outbound-mail-316.bluehost.com (outbound-mail-316.bluehost.com [67.222.54.9]) by gabe.freedesktop.org (Postfix) with SMTP id E6A339E774 for ; Tue, 18 Aug 2009 12:35:46 -0700 (PDT) Received: (qmail 14026 invoked by uid 0); 18 Aug 2009 19:35:46 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by outboundproxy6.bluehost.com with SMTP; 18 Aug 2009 19:35:46 -0000 Received: from [75.111.28.251] (helo=jbarnes-g45) by box514.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MdUTB-00076q-Q2 for intel-gfx@lists.freedesktop.org; Tue, 18 Aug 2009 13:35:46 -0600 Date: Tue, 18 Aug 2009 12:35:42 -0700 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Message-ID: <20090818123542.12aad4a6@jbarnes-g45> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.17.5; i486-pc-linux-gnu) Mime-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 75.111.28.251 authed with jbarnes@virtuousgeek.org} Subject: [Intel-gfx] [PATCH] add kms-only build time option X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To prevent the server from trying to enable I/O ports, we can use the DriverFunc callback and clear the passed in "flags" parameter. However this call happens early, way before we know whether KMS will be available or not. So to enable non-root configs we can add a build time option instead, which assumes KMS support (and therefore indicates to the server that I/O ports are not needed). Any comments? diff --git a/configure.ac b/configure.ac index d5c12a8..54560bc 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,11 @@ AC_ARG_ENABLE(xvmc, AC_HELP_STRING([--disable-xvmc], [XVMC="$enableval"], [XVMC=yes]) +AC_ARG_ENABLE(kms-only, AC_HELP_STRING([--enable-kms-only], + [Assume KMS support [[default=no]]]), + [KMS_ONLY="$enableval"], + [KMS_ONLY=no]) + # Checks for extensions XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto) XORG_DRIVER_CHECK_EXT(RANDR, randrproto) @@ -166,6 +171,11 @@ if test "$XVMC" = yes; then AC_SUBST([XVMCLIB_CFLAGS]) fi +AM_CONDITIONAL(KMS_ONLY, test x$KMS_ONLY = xyes) +if test "$KMS_ONLY" = yes; then + AC_DEFINE(KMS_ONLY,1,[Assume KMS support]) +fi + AC_SUBST([DRI_CFLAGS]) AC_SUBST([XORG_CFLAGS]) AC_SUBST([WARN_CFLAGS]) diff --git a/src/i810_driver.c b/src/i810_driver.c index 0366901..a08a500 100644 --- a/src/i810_driver.c +++ b/src/i810_driver.c @@ -79,7 +79,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* Required Functions: */ static void I810Identify(int flags); - +static Bool I810DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr); static Bool intel_pci_probe (DriverPtr drv, int entity_num, struct pci_device *dev, @@ -150,7 +150,7 @@ _X_EXPORT DriverRec I810 = { I810AvailableOptions, NULL, 0, - NULL, + I810DriverFunc, intel_device_match, intel_pci_probe }; @@ -394,6 +394,26 @@ I810AvailableOptions(int chipid, int busid) #endif } +static Bool +I810DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr) +{ + xorgHWFlags *flag; + + switch (op) { + case GET_REQUIRED_HW_INTERFACES: + flag = (CARD32*)ptr; +#ifdef KMS_ONLY + (*flag) = 0; +#else + (*flag) = HW_IO | HW_MMIO; +#endif + return TRUE; + default: + /* Unknown or deprecated function */ + return FALSE; + } +} + struct pci_device * intel_host_bridge (void) {