From d9a3071242724325d4e3672b3e70d8457f993f78 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 13 Jul 2012 14:54:06 +1000 Subject: apm: handle xaa removal Signed-off-by: Dave Airlie --- configure.ac | 19 +++++++++++++++++++ src/apm.h | 8 ++++++++ src/apm_accel.c | 2 ++ src/apm_dga.c | 12 ++++++++++-- src/apm_driver.c | 9 +++++++++ 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9b0acde..c861812 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,25 @@ if test "x$have_xv" = xyes; then fi AM_CONDITIONAL(XV_NEW_REPUT, test x$XV_NEW_REPUT = xyes) +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]) + + AC_CONFIG_FILES([ Makefile src/Makefile diff --git a/src/apm.h b/src/apm.h index f92aa8d..a3c06f8 100644 --- a/src/apm.h +++ b/src/apm.h @@ -23,8 +23,10 @@ #include "fb.h" /* Drivers using the XAA interface ... */ +#ifdef HAVE_XAA_H #include "xaa.h" #include "xaalocal.h" +#endif #include "xf86Cursor.h" #include "xf86fbman.h" @@ -122,7 +124,9 @@ typedef struct { int MaxClock; /* Max ramdac clock */ ApmFBLayout CurrentLayout, SavedLayout; EntityInfoPtr pEnt; +#ifdef HAVE_XAA_H XAAInfoRecPtr AccelInfoRec, DGAXAAInfo; +#endif xf86CursorInfoPtr CursorInfoRec; int DGAactive, numDGAModes; DGAModePtr DGAModes; @@ -132,11 +136,13 @@ typedef struct { Bool apmTransparency, apmClip, ShadowFB, I2C; int rop, Bg8x8, Fg8x8; I2CBusPtr I2CPtr; +#ifdef HAVE_XAA_H struct ApmStippleCacheRec { XAACacheInfoRec apmStippleCache; FBAreaPtr area; unsigned int apmStippleCached:1; } apmCache[APM_CACHE_NUMBER]; +#endif int apmCachePtr; unsigned char regcurr[0x54]; ScreenPtr pScreen; @@ -218,7 +224,9 @@ extern Bool ApmI2CInit(ScrnInfoPtr pScrn); extern void XFree86RushExtensionInit(ScreenPtr pScreen); extern void ApmInitVideo(ScreenPtr pScreen); extern void ApmInitVideo_IOP(ScreenPtr pScreen); +#ifdef HAVE_XAA_H extern void ApmSetupXAAInfo(ApmPtr pApm, XAAInfoRecPtr pXAAinfo); +#endif extern Bool ApmSwitchMode(SWITCH_MODE_ARGS_DECL); extern void ApmAdjustFrame(ADJUST_FRAME_ARGS_DECL); extern void ApmHWCursorReserveSpace(ApmPtr pApm); diff --git a/src/apm_accel.c b/src/apm_accel.c index ed73d8d..140b44e 100644 --- a/src/apm_accel.c +++ b/src/apm_accel.c @@ -6,6 +6,7 @@ #include "apm.h" #include "miline.h" +#ifdef HAVE_XAA_H /* Defines */ #define MAXLOOP 1000000 @@ -563,3 +564,4 @@ void ApmSetupXAAInfo(ApmPtr pApm, XAAInfoRecPtr pXAAinfo) #undef XAA } } +#endif diff --git a/src/apm_dga.c b/src/apm_dga.c index fa94006..dc95a6f 100644 --- a/src/apm_dga.c +++ b/src/apm_dga.c @@ -11,8 +11,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" -#include "xaa.h" -#include "xaalocal.h" #include "apm.h" #include "dgaproc.h" @@ -22,10 +20,12 @@ static Bool ApmOpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, static Bool ApmSetMode(ScrnInfoPtr, DGAModePtr); static int ApmGetViewport(ScrnInfoPtr); static void ApmSetViewport(ScrnInfoPtr, int, int, int); +#ifdef HAVE_XAA_H static void ApmFillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void ApmBlitRect(ScrnInfoPtr, int, int, int, int, int, int); static void ApmBlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long); +#endif static void ApmSync(ScrnInfoPtr); static @@ -36,9 +36,13 @@ DGAFunctionRec ApmDGAFuncs = { ApmSetViewport, ApmGetViewport, ApmSync, +#ifdef HAVE_XAA_H ApmFillRect, ApmBlitRect, ApmBlitTransRect +#else + NULL, NULL, NULL +#endif }; /* @@ -270,7 +274,9 @@ ApmSetMode(ScrnInfoPtr pScrn, DGAModePtr pMode) pApm->CurrentLayout.mask32 = 32 / pMode->bitsPerPixel - 1; ApmSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode)); +#ifdef HAVE_XAA_H ApmSetupXAAInfo(pApm, NULL); +#endif #if 0 if (pApm->DGAXAAInfo) @@ -334,6 +340,7 @@ ApmSetViewport( } } +#ifdef HAVE_XAA_H static void ApmFillRect ( ScrnInfoPtr pScrn, @@ -403,6 +410,7 @@ ApmBlitTransRect( SET_SYNC_FLAG(pApm->AccelInfoRec); } } +#endif static Bool ApmOpenFramebuffer( diff --git a/src/apm_driver.c b/src/apm_driver.c index 0f20eb6..62389b0 100644 --- a/src/apm_driver.c +++ b/src/apm_driver.c @@ -994,11 +994,16 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags) /* Load XAA if needed */ if (!pApm->NoAccel) { +#ifdef HAVE_XAA_H if (!xf86LoadSubModule(pScrn, "xaa")) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Falling back to shadowfb\n"); pApm->NoAccel = TRUE; pApm->ShadowFB = TRUE; } +#else + pApm->NoAccel = TRUE; + pApm->ShadowFB = TRUE; +#endif } /* Load ramdac if needed */ @@ -1773,9 +1778,11 @@ ApmScreenInit(SCREEN_INIT_ARGS_DECL) /* * Initialize the acceleration interface. */ +#ifdef HAVE_XAA_H if (!pApm->NoAccel) { ApmAccelInit(pScreen); /* set up XAA interface */ } +#endif miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); @@ -2002,11 +2009,13 @@ ApmCloseScreen(CLOSE_SCREEN_ARGS_DECL) vgaHWLock(hwp); ApmUnmapMem(pScrn); } +#ifdef HAVE_XAA_H if(pApm->AccelInfoRec) XAADestroyInfoRec(pApm->AccelInfoRec); if(pApm->DGAXAAInfo) XAADestroyInfoRec(pApm->DGAXAAInfo); pApm->AccelInfoRec = NULL; +#endif if(pApm->CursorInfoRec) xf86DestroyCursorInfoRec(pApm->CursorInfoRec); pApm->CursorInfoRec = NULL; -- cgit v1.2.3