From patchwork Mon Jul 9 23:32:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 1175191 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 97741E0038 for ; Mon, 9 Jul 2012 23:32:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C84DA08C6 for ; Mon, 9 Jul 2012 16:32:34 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 629109E8DC for ; Mon, 9 Jul 2012 16:32:19 -0700 (PDT) Received: by wibhm11 with SMTP id hm11so2579667wib.12 for ; Mon, 09 Jul 2012 16:32:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:x-gm-message-state; bh=YJKFLRdvTzJfMKr+9oRgmp0he3kvQWSAxIhGCnpUqwk=; b=XjcHvsjqIM01YHpNdi3giBsQhurK6A/5PKbCoMUu2HHeooEqTKL2ELRxnINV5z7FRn c2zmnduqZPcu7hcNOsx43iuNWELs8RXK1VOOe2TMOwHgGfMI73t3UaTWEEnwDcXcq1XI DA+XcwQmcVs2G95TeJ63LwE4FFu81y42uTiDKPkwf0Hzbnrhamh7681vTZEfjQ5nzi9V 8I7b2DydkRly6uwPydoHQSNTE/zPDcSU6eAcqnkPx86AQbDZnfrSCFXwfysMFbgqrgO3 rNNBlECs0JJGgqGEFcB3QapGJDgd8Z8l2VpTBQLEsm45ZfiRe9G57s+NUgTVA0QB2hF7 rnsg== Received: by 10.216.136.95 with SMTP id v73mr9757781wei.2.1341876735953; Mon, 09 Jul 2012 16:32:15 -0700 (PDT) Received: from swamp81.fooishbar.org (93-97-16-184.zone5.bethere.co.uk. [93.97.16.184]) by mx.google.com with ESMTPS id eu4sm25911234wib.2.2012.07.09.16.32.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 16:32:15 -0700 (PDT) Received: by swamp81.fooishbar.org (Postfix, from userid 1000) id 6AA521FBA; Tue, 10 Jul 2012 00:32:13 +0100 (BST) From: Daniel Stone To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Jul 2012 00:32:13 +0100 Message-Id: <1341876733-5564-1-git-send-email-daniel@fooishbar.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlv1FOZlXfbQsxK1diCIGqjKq+9L+ZVHK2c6P5MIznFwINdzMsUrRu+Xj33bJcN0qGxO9vG Subject: [Intel-gfx] [PATCH] i810: Make XAA optional X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Don't build XAA when it's not available, or when we don't want it. Signed-off-by: Daniel Stone --- configure.ac | 24 +++++++++++++++++++++++- src/legacy/i810/Makefile.am | 6 +++++- src/legacy/i810/i810.h | 4 ++++ src/legacy/i810/i810_dga.c | 15 ++++++++++++--- src/legacy/i810/i810_dri.c | 4 ++++ src/legacy/i810/i810_driver.c | 11 +++++++++++ src/legacy/i810/i810_video.c | 2 -- 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 7ab7ab8..b6e8b34 100644 --- a/configure.ac +++ b/configure.ac @@ -158,6 +158,29 @@ if test "x$GLAMOR" != "xno"; then AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration]) fi + +PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_xserver_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES]) + + +AC_MSG_CHECKING([whether to include XAA support]) +AC_ARG_ENABLE(uxa, + AS_HELP_STRING([--enable-xaa], + [Enable legacy X Acceleration Architecture (XAA) [default=auto]]), + [XAA="$enableval"], + [XAA=auto]) +AC_MSG_RESULT([$XAA]) +AM_CONDITIONAL(XAA, test "x$XAA" != xno) +if test "x$XAA" != xno; then + save_CFLAGS=$CFLAGS + CFLAGS=$XSERVER_CFLAGS + AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no) + CFLAGS=$save_CFLAGS +fi +if test "x$XAA" = xyes; then + AC_DEFINE(USE_XAA, 1, [Enable XAA support]) +fi +AM_CONDITIONAL(XAA, test "x$XAA" = xyes) + AC_ARG_WITH(default-accel, AS_HELP_STRING([--with-default-accel], [Select the default acceleration method [default=uxa if enabled, otherwise sna]]), @@ -247,7 +270,6 @@ XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11) XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Obtain compiler/linker options for the driver dependencies -PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_xserver_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES]) PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.24]) # libdrm_intel is checked separately PKG_CHECK_MODULES(DRI, [xf86driproto], , DRI=no) PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6],, DRI2=no) diff --git a/src/legacy/i810/Makefile.am b/src/legacy/i810/Makefile.am index e7fa04f..01cc218 100644 --- a/src/legacy/i810/Makefile.am +++ b/src/legacy/i810/Makefile.am @@ -8,7 +8,6 @@ AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ @PCIACCESS_CFLA $(NULL) liblegacy_i810_la_SOURCES = \ - i810_accel.c \ i810_common.h \ i810_cursor.c \ i810_dga.c \ @@ -20,6 +19,11 @@ liblegacy_i810_la_SOURCES = \ i810_video.c \ i810_wmark.c +if XAA +liblegacy_i810_la_SOURCES += \ + i810_accel.c +endif + if DRI liblegacy_i810_la_SOURCES +=\ i810_dri.c \ diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h index 874551b..512d07e 100644 --- a/src/legacy/i810/i810.h +++ b/src/legacy/i810/i810.h @@ -42,7 +42,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "compiler.h" #include "xf86Pci.h" #include "i810_reg.h" +#ifdef HAVE_XAA #include "xaa.h" +#endif #include "xf86Cursor.h" #include "xf86xv.h" #include "vbe.h" @@ -202,7 +204,9 @@ typedef struct _I810Rec { I810RegRec SavedReg; I810RegRec ModeReg; +#ifdef XAA XAAInfoRecPtr AccelInfoRec; +#endif xf86CursorInfoPtr CursorInfoRec; CloseScreenProcPtr CloseScreen; ScreenBlockHandlerProcPtr BlockHandler; diff --git a/src/legacy/i810/i810_dga.c b/src/legacy/i810/i810_dga.c index 336588c..e258360 100644 --- a/src/legacy/i810/i810_dga.c +++ b/src/legacy/i810/i810_dga.c @@ -29,8 +29,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" -#include "xaa.h" -#include "xaalocal.h" #include "i810.h" #include "i810_reg.h" #include "dgaproc.h" @@ -39,11 +37,14 @@ static Bool I810_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, int *, int *, int *); static Bool I810_SetMode(ScrnInfoPtr, DGAModePtr); -static void I810_Sync(ScrnInfoPtr); static int I810_GetViewport(ScrnInfoPtr); static void I810_SetViewport(ScrnInfoPtr, int, int, int); + +#ifdef HAVE_XAA +static void I810_Sync(ScrnInfoPtr); static void I810_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void I810_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); +#endif #if 0 static void I810_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, @@ -57,9 +58,15 @@ DGAFunctionRec I810DGAFuncs = { I810_SetMode, I810_SetViewport, I810_GetViewport, +#ifdef HAVE_XAA I810_Sync, I810_FillRect, I810_BlitRect, +#else + NULL, + NULL, + NULL, +#endif #if 0 I810_BlitTransRect #else @@ -186,6 +193,7 @@ I810_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags) pI810->DGAViewportStatus = 0; } +#ifdef HAVE_XAA static void I810_FillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color) @@ -226,6 +234,7 @@ I810_BlitRect(ScrnInfoPtr pScrn, SET_SYNC_FLAG(pI810->AccelInfoRec); } } +#endif #if 0 static void diff --git a/src/legacy/i810/i810_dri.c b/src/legacy/i810/i810_dri.c index ba11245..0910919 100644 --- a/src/legacy/i810/i810_dri.c +++ b/src/legacy/i810/i810_dri.c @@ -1041,8 +1041,10 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) } I810SelectBuffer(pScrn, I810_SELECT_FRONT); +#ifdef HAVE_XAA if (pI810->AccelInfoRec) pI810->AccelInfoRec->NeedToSync = TRUE; +#endif } /* This routine is a modified form of XAADoBitBlt with the calls to @@ -1201,8 +1203,10 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, free(pboxNew1); } +#ifdef HAVE_XAA if (pI810->AccelInfoRec) pI810->AccelInfoRec->NeedToSync = TRUE; +#endif } diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c index 141c19c..0354a4a 100644 --- a/src/legacy/i810/i810_driver.c +++ b/src/legacy/i810/i810_driver.c @@ -68,6 +68,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86xv.h" #include #include "vbe.h" +#include "xf86fbman.h" #include "i810.h" @@ -1700,6 +1701,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL) return FALSE; } +#ifdef HAVE_XAA if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) { if (pI810->LpRing->mem.Size != 0) { I810SetRingRegs(scrn); @@ -1711,6 +1713,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL) I810EmitFlush(scrn); } } +#endif miInitializeBackingStore(screen); xf86SetBackingStore(screen); @@ -1938,11 +1941,13 @@ I810LeaveVT(VT_FUNC_ARGS_DECL) } #endif +#ifdef HAVE_XAA if (pI810->AccelInfoRec != NULL) { I810RefreshRing(scrn); I810Sync(scrn); pI810->AccelInfoRec->NeedToSync = FALSE; } +#endif I810Restore(scrn); if (!I810UnbindGARTMemory(scrn)) @@ -1961,14 +1966,18 @@ I810CloseScreen(CLOSE_SCREEN_ARGS_DECL) ScrnInfoPtr scrn = xf86ScreenToScrn(screen); vgaHWPtr hwp = VGAHWPTR(scrn); I810Ptr pI810 = I810PTR(scrn); +#ifdef HAVE_XAA XAAInfoRecPtr infoPtr = pI810->AccelInfoRec; +#endif if (scrn->vtSema == TRUE) { +#ifdef HAVE_XAA if (pI810->AccelInfoRec != NULL) { I810RefreshRing(scrn); I810Sync(scrn); pI810->AccelInfoRec->NeedToSync = FALSE; } +#endif I810Restore(scrn); vgaHWLock(hwp); } @@ -1993,12 +2002,14 @@ I810CloseScreen(CLOSE_SCREEN_ARGS_DECL) pI810->ScanlineColorExpandBuffers = NULL; } +#ifdef HAVE_XAA if (infoPtr) { if (infoPtr->ScanlineColorExpandBuffers) free(infoPtr->ScanlineColorExpandBuffers); XAADestroyInfoRec(infoPtr); pI810->AccelInfoRec = NULL; } +#endif if (pI810->CursorInfoRec) { xf86DestroyCursorInfoRec(pI810->CursorInfoRec); diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c index 56d04a4..4ebad66 100644 --- a/src/legacy/i810/i810_video.c +++ b/src/legacy/i810/i810_video.c @@ -49,8 +49,6 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i810.h" #include "xf86xv.h" #include -#include "xaa.h" -#include "xaalocal.h" #include "dixstruct.h" #include "fourcc.h"