From 808aa999ad78ccc3384d08d501d43688795bee5e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 16 Jul 2012 03:29:55 +0100 Subject: neomagic: fix build when XAA is unavailable. Signed-off-by: Dave Airlie --- configure.ac | 17 +++++++++++++++++ src/neo.h | 5 +++++ src/neo_2070.c | 14 +++++++++----- src/neo_2090.c | 12 ++++++++---- src/neo_2097.c | 9 ++++++++- src/neo_2200.c | 8 ++++++++ src/neo_dga.c | 18 ++++++++++++++---- src/neo_driver.c | 2 ++ src/neo_video.c | 2 -- 9 files changed, 71 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index ded0912..48bce17 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,23 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [#include "xorg-server.h"]) CPPFLAGS="$SAVE_CPPFLAGS" +AC_ARG_ENABLE(xaa, + AS_HELP_STRING([--enable-xaa], + [Enable legacy X Acceleration Architecture (XAA) [default=auto]]), + [XAA="$enableval"], + [XAA=auto]) +if test "x$XAA" != xno; then + save_CFLAGS=$CFLAGS + save_CPPFLAGS=$CPPFLAGS + CFLAGS=$XORG_CFLAGS + CPPFLAGS="$XORG_CFLAGS" + AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no) + CFLAGS=$save_CFLAGS + CPPFLAGS=$save_CPPFLAGS +fi +AC_MSG_CHECKING([whether to include XAA support]) +AM_CONDITIONAL(XAA, test "x$XAA" = xyes) +AC_MSG_RESULT([$XAA]) if test "x$XSERVER_LIBPCIACCESS" = xyes; then PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) diff --git a/src/neo.h b/src/neo.h index 7c7beb1..6aecc33 100644 --- a/src/neo.h +++ b/src/neo.h @@ -46,8 +46,11 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* Everything using inb/outb, etc needs "compiler.h" */ #include "compiler.h" +#ifdef HAVE_XAA_H #include "xaa.h" #include "xaalocal.h" /* XAA internals as we replace some of XAA */ +#endif +#include "xf86fbman.h" #include "xf86Cursor.h" #include "shadowfb.h" @@ -202,7 +205,9 @@ typedef struct neoRec PCITAG PciTag; #endif EntityInfoPtr pEnt; +#ifdef HAVE_XAA_H XAAInfoRecPtr AccelInfoRec; +#endif NEOACLRec Accel; unsigned long NeoMMIOAddr; unsigned long NeoLinearAddr; diff --git a/src/neo_2070.c b/src/neo_2070.c index fab01ab..4767b7d 100644 --- a/src/neo_2070.c +++ b/src/neo_2070.c @@ -52,6 +52,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H /* Memory Mapped I/O for BitBlt */ #define NEO2070_BLTSTAT 0x00 #define NEO2070_BLTCNTL 0x04 @@ -99,9 +100,12 @@ static void Neo2070SetupForSolidFillRect(ScrnInfoPtr pScrn, int color, int rop, static void Neo2070SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h); +#endif + Bool Neo2070AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -160,9 +164,12 @@ Neo2070AccelInit(ScreenPtr pScreen) } return(XAAInit(pScreen, infoPtr)); - +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2070Sync(ScrnInfoPtr pScrn) { @@ -260,8 +267,5 @@ Neo2070SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h) OUTREG(NEO2070_XYEXT, ((h-1)<<16) | ((w-1) & 0xffff)); OUTREG(NEO2070_DSTSTART, (y * nAcl->Pitch) + (x * nAcl->PixelWidth)); } - - - - +#endif diff --git a/src/neo_2090.c b/src/neo_2090.c index f7b407a..5049ab4 100644 --- a/src/neo_2090.c +++ b/src/neo_2090.c @@ -53,6 +53,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H static unsigned int neo2090Rop[16] = { 0x000000, /* 0x0000 - GXclear */ 0x080000, /* 0x1000 - GXand */ @@ -95,10 +96,11 @@ static void Neo2093SubsequentScanlineCPUToScreenColorExpandFill( int w, int h, int skipleft); static void Neo2093SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno); - +#endif Bool Neo2090AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -198,8 +200,12 @@ Neo2090AccelInit(ScreenPtr pScreen) nAcl->BltCntlFlags |= NEO_BC3_FIFO_EN; return(XAAInit(pScreen, infoPtr)); +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2090Sync(ScrnInfoPtr pScrn) { @@ -363,6 +369,4 @@ Neo2093SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) OUTREG(NEOREG_XYEXT, (1<<16) | (nAcl->CPUToScreenColorExpandFill_w & 0xffff)); } - - - +#endif diff --git a/src/neo_2097.c b/src/neo_2097.c index d1e2389..399ace0 100644 --- a/src/neo_2097.c +++ b/src/neo_2097.c @@ -56,6 +56,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H static void Neo2097Sync(ScrnInfoPtr pScrn); static void Neo2097SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, @@ -118,11 +119,12 @@ static unsigned int neo2097Rop[16] = { 0x070000, /* 0x0111 - GXnand */ 0x0f0000 /* 0x1111 - GXset */ }; - +#endif Bool Neo2097AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -249,8 +251,12 @@ Neo2097AccelInit(ScreenPtr pScreen) } return(XAAInit(pScreen, infoPtr)); +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2097Sync(ScrnInfoPtr pScrn) { @@ -544,3 +550,4 @@ Neo2097SubsequentImageWriteScanline( ){ /* should I be checking for fifo slots here ? */ } +#endif diff --git a/src/neo_2200.c b/src/neo_2200.c index 72864a5..5694ae4 100644 --- a/src/neo_2200.c +++ b/src/neo_2200.c @@ -51,6 +51,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H static void Neo2200Sync(ScrnInfoPtr pScrn); static void Neo2200SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, @@ -115,9 +116,11 @@ static unsigned int neo2200Rop[16] = { 0x0f0000 /* 0x1111 - GXset */ }; +#endif Bool Neo2200AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -254,8 +257,12 @@ Neo2200AccelInit(ScreenPtr pScreen) } return(XAAInit(pScreen, infoPtr)); +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2200Sync(ScrnInfoPtr pScrn) { @@ -647,3 +654,4 @@ Neo2200SubsequentMono8x8PatternFill(ScrnInfoPtr pScrn, OUTREG(NEOREG_XYEXT, (h<<16) | (w & 0xffff)); } #endif +#endif diff --git a/src/neo_dga.c b/src/neo_dga.c index 799150c..b6346c5 100644 --- a/src/neo_dga.c +++ b/src/neo_dga.c @@ -30,8 +30,6 @@ #include "xf86_OSproc.h" #include "xf86Pci.h" #include "xf86PciInfo.h" -#include "xaa.h" -#include "xaalocal.h" #include "neo.h" #include "neo_reg.h" #include "dgaproc.h" @@ -43,12 +41,14 @@ static Bool NEO_SetMode(ScrnInfoPtr, DGAModePtr); static void NEO_Sync(ScrnInfoPtr); static int NEO_GetViewport(ScrnInfoPtr); static void NEO_SetViewport(ScrnInfoPtr, int, int, int); +#ifdef HAVE_XAA_H static void NEO_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void NEO_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); #if 0 static void NEO_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long); #endif +#endif static DGAFunctionRec NEODGAFuncs = { @@ -58,6 +58,7 @@ DGAFunctionRec NEODGAFuncs = { NEO_SetViewport, NEO_GetViewport, NEO_Sync, +#ifdef HAVE_XAA_H NEO_FillRect, NEO_BlitRect, #if 0 @@ -65,6 +66,9 @@ DGAFunctionRec NEODGAFuncs = { #else NULL #endif +#else + NULL, NULL, NULL +#endif }; Bool @@ -99,8 +103,10 @@ NEODGAInit(ScreenPtr pScreen) currentMode->mode = pMode; currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE; +#ifdef HAVE_XAA_H if (!pNEO->noAccel) currentMode->flags |= (DGA_FILL_RECT | DGA_BLIT_RECT); +#endif if(pMode->Flags & V_DBLSCAN) currentMode->flags |= DGA_DOUBLESCAN; if(pMode->Flags & V_INTERLACE) @@ -197,6 +203,7 @@ NEO_SetViewport( pNEO->DGAViewportStatus = 0; } +#ifdef HAVE_XAA_H static void NEO_FillRect ( ScrnInfoPtr pScrn, @@ -212,15 +219,17 @@ NEO_FillRect ( } } + static void NEO_Sync( ScrnInfoPtr pScrn ){ NEOPtr pNEO = NEOPTR(pScrn); - +#ifdef HAVE_XAA_H if(pNEO->AccelInfoRec) { (*pNEO->AccelInfoRec->Sync)(pScrn); } +#endif } static void @@ -257,7 +266,7 @@ NEO_BlitTransRect( prohibit usage of ~0 as the key */ } #endif - +#endif static Bool NEO_OpenFramebuffer( ScrnInfoPtr pScrn, @@ -277,3 +286,4 @@ NEO_OpenFramebuffer( return TRUE; } + diff --git a/src/neo_driver.c b/src/neo_driver.c index 124bd6f..d7369e2 100644 --- a/src/neo_driver.c +++ b/src/neo_driver.c @@ -1788,8 +1788,10 @@ NEOCloseScreen(CLOSE_SCREEN_ARGS_DECL) neoLock(pScrn); neoUnmapMem(pScrn); } +#ifdef HAVE_XAA_H if (nPtr->AccelInfoRec) XAADestroyInfoRec(nPtr->AccelInfoRec); +#endif if (nPtr->CursorInfo) xf86DestroyCursorInfoRec(nPtr->CursorInfo); if (nPtr->ShadowPtr) diff --git a/src/neo_video.c b/src/neo_video.c index 8e63947..be60421 100644 --- a/src/neo_video.c +++ b/src/neo_video.c @@ -38,8 +38,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) #include "dixstruct.h" -#include "xaa.h" -#include "xaalocal.h" static XF86VideoAdaptorPtr NEOSetupVideo(ScreenPtr); -- cgit v1.2.3