diff options
author | Dave Airlie <airlied@gmail.com> | 2012-07-13 14:47:40 +1000 |
---|---|---|
committer | Dave Airlie <airlied@gmail.com> | 2012-07-13 14:47:40 +1000 |
commit | e443ede15981549ff5f6b01f42c3cb8dc909d778 (patch) | |
tree | 0d9bca6a6f8e4a0250c65b71a4724788ef71a630 | |
parent | 46a9e962c6f33509e89d664115a9a2db51c9b67d (diff) |
cirrus: handle server with no XAA
this fixes cirrus to work with a server with no XAA module.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | src/alp.h | 2 | ||||
-rw-r--r-- | src/alp_driver.c | 12 | ||||
-rw-r--r-- | src/alp_xaa.c | 3 | ||||
-rw-r--r-- | src/alp_xaam.c | 6 | ||||
-rw-r--r-- | src/cir.h | 4 | ||||
-rw-r--r-- | src/cir_dga.c | 15 | ||||
-rw-r--r-- | src/lg.h | 2 | ||||
-rw-r--r-- | src/lg_driver.c | 11 | ||||
-rw-r--r-- | src/lg_xaa.c | 4 |
10 files changed, 65 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac index 1cc4d93..1157ab1 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,24 @@ AC_CHECK_HEADER(xf1bpp.h,[AC_DEFINE(HAVE_XF1BPP, 1, [Have 1bpp support])],[]) AC_CHECK_HEADER(xf4bpp.h,[AC_DEFINE(HAVE_XF4BPP, 1, [Have 4bpp support])],[]) 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]) XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" @@ -40,8 +40,10 @@ typedef struct { } AlpRegRec, *AlpRegPtr; extern Bool AlpHWCursorInit(ScreenPtr pScreen, int size); +#ifdef HAVE_XAA_H extern Bool AlpXAAInit(ScreenPtr pScreen); extern Bool AlpXAAInitMMIO(ScreenPtr pScreen); +#endif extern Bool AlpDGAInit(ScreenPtr pScreen); extern Bool AlpI2CInit(ScrnInfoPtr pScrn); diff --git a/src/alp_driver.c b/src/alp_driver.c index d1300df..e38c613 100644 --- a/src/alp_driver.c +++ b/src/alp_driver.c @@ -1088,7 +1088,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) /* Load XAA if needed */ if (!pCir->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { +#ifdef HAVE_XAA_H + if (!xf86LoadSubModule(pScrn, "xaa")) +#else + if (1) +#endif + { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Falling back to shadowfb\n"); pCir->NoAccel = TRUE; @@ -1096,6 +1101,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) } } + /* Load ramdac if needed */ if (pCir->HWCursor) { if (!xf86LoadSubModule(pScrn, "ramdac")) { @@ -1650,10 +1656,12 @@ AlpScreenInit(SCREEN_INIT_ARGS_DECL) if (!pCir->NoAccel) { /* Initialize XAA functions */ AlpOffscreenAccelInit(pScrn); +#ifdef HAVE_XAA_H if (!(pCir->UseMMIO ? AlpXAAInitMMIO(pScreen) : AlpXAAInit(pScreen))) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not initialize XAA\n"); +#endif } #if 1 @@ -1860,9 +1868,11 @@ AlpCloseScreen(CLOSE_SCREEN_ARGS_DECL) CirUnmapMem(pCir, pScrn->scrnIndex); } +#ifdef HAVE_XAA_H if (pCir->AccelInfoRec) XAADestroyInfoRec(pCir->AccelInfoRec); pCir->AccelInfoRec = NULL; +#endif if (pCir->CursorInfoRec) xf86DestroyCursorInfoRec(pCir->CursorInfoRec); pCir->CursorInfoRec = NULL; diff --git a/src/alp_xaa.c b/src/alp_xaa.c index 5a43357..b3ddd64 100644 --- a/src/alp_xaa.c +++ b/src/alp_xaa.c @@ -16,6 +16,7 @@ #define _ALP_PRIVATE_ #include "alp.h" +#ifdef HAVE_XAA_H #define WAIT outb(pCir->PIOReg, 0x31); \ while(inb(pCir->PIOReg + 1) & pCir->chip.alp->waitMsk){}; #define WAIT_1 outb(pCir->PIOReg, 0x31); \ @@ -683,4 +684,4 @@ AlpXAAInit(ScreenPtr pScreen) return TRUE; } - +#endif diff --git a/src/alp_xaam.c b/src/alp_xaam.c index 79f621d..8e9fd52 100644 --- a/src/alp_xaam.c +++ b/src/alp_xaam.c @@ -17,6 +17,7 @@ #define _ALP_PRIVATE_ #include "alp.h" +#ifdef HAVE_XAA_H #ifdef DEBUG #define minb(p) \ (ErrorF("minb(%X)\n", p),\ @@ -266,7 +267,4 @@ AlpXAAInitMMIO(ScreenPtr pScreen) return TRUE; } - - - - +#endif @@ -4,7 +4,9 @@ #define CIR_H #include "xf86Cursor.h" +#ifdef HAVE_XAA_H #include "xaa.h" +#endif #include "xf86i2c.h" #include <string.h> #include <stdlib.h> @@ -44,7 +46,9 @@ typedef struct { Bool NoAccel; Bool HWCursor; Bool UseMMIO; +#ifdef HAVE_XAA_H XAAInfoRecPtr AccelInfoRec; +#endif xf86CursorInfoPtr CursorInfoRec; int DGAnumModes; DGAModePtr DGAModes; diff --git a/src/cir_dga.c b/src/cir_dga.c index b841be3..bf3a9dd 100644 --- a/src/cir_dga.c +++ b/src/cir_dga.c @@ -30,8 +30,10 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" +#ifdef HAVE_XAA_H #include "xaa.h" #include "xaalocal.h" +#endif #include "vgaHW.h" #include "cir.h" #include "dgaproc.h" @@ -39,15 +41,17 @@ static Bool Cir_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, int *, int *, int *); static Bool Cir_SetMode(ScrnInfoPtr, DGAModePtr); -static void Cir_Sync(ScrnInfoPtr); static int Cir_GetViewport(ScrnInfoPtr); static void Cir_SetViewport(ScrnInfoPtr, int, int, int); +#ifdef HAVE_XAA_H +static void Cir_Sync(ScrnInfoPtr); static void Cir_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void Cir_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); /* static void Cir_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long); */ +#endif static DGAFunctionRec CirDGAFuncs = { @@ -56,9 +60,13 @@ DGAFunctionRec CirDGAFuncs = { Cir_SetMode, Cir_SetViewport, Cir_GetViewport, +#ifdef HAVE_XAA_H Cir_Sync, Cir_FillRect, Cir_BlitRect, +#else + NULL, NULL, NULL, +#endif NULL /* Cir_BlitTransRect */ }; @@ -207,14 +215,12 @@ Cir_GetViewport( return pCir->DGAViewportStatus; } - - +#ifdef HAVE_XAA_H static void Cir_Sync( ScrnInfoPtr pScrn ){ CirPtr pCir = CIRPTR(pScrn); - if(pCir->AccelInfoRec) { (*pCir->AccelInfoRec->Sync)(pScrn); } @@ -255,3 +261,4 @@ Cir_BlitRect( SET_SYNC_FLAG(pCir->AccelInfoRec); } } +#endif @@ -59,8 +59,10 @@ typedef struct { /* lg_driver.c */ extern LgLineDataRec LgLineData[]; +#ifdef HAVE_XAA_H /* lg_xaa.c */ extern Bool LgXAAInit(ScreenPtr pScreen); +#endif /* lg_hwcurs.c */ extern Bool LgHWCursorInit(ScreenPtr pScreen); diff --git a/src/lg_driver.c b/src/lg_driver.c index ab613d8..13f222d 100644 --- a/src/lg_driver.c +++ b/src/lg_driver.c @@ -797,7 +797,12 @@ LgPreInit(ScrnInfoPtr pScrn, int flags) /* Load XAA if needed */ if (!pCir->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { +#ifdef HAVE_XAA_H + if (!xf86LoadSubModule(pScrn, "xaa")) +#else + if (1) +#endif + { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Falling back to shadowfb\n"); pCir->NoAccel = TRUE; @@ -1375,10 +1380,12 @@ LgScreenInit(SCREEN_INIT_ARGS_DECL) */ xf86SetBlackWhitePixels(pScreen); +#ifdef HAVE_XAA_H if (!pCir->NoAccel) { /* Initialize XAA functions */ if (!LgXAAInit(pScreen)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not initialize XAA\n"); } +#endif #if 1 pCir->DGAModeInit = LgModeInit; if (!CirDGAInit(pScreen)) @@ -1609,9 +1616,11 @@ LgCloseScreen(CLOSE_SCREEN_ARGS_DECL) CirUnmapMem(pCir, pScrn->scrnIndex); } +#ifdef HAVE_XAA_H if (pCir->AccelInfoRec) XAADestroyInfoRec(pCir->AccelInfoRec); pCir->AccelInfoRec = NULL; +#endif if (pCir->CursorInfoRec) xf86DestroyCursorInfoRec(pCir->CursorInfoRec); diff --git a/src/lg_xaa.c b/src/lg_xaa.c index 45ecea7..5e6e72e 100644 --- a/src/lg_xaa.c +++ b/src/lg_xaa.c @@ -26,6 +26,8 @@ #include "cir.h" #define _LG_PRIVATE_ #include "lg.h" + +#ifdef HAVE_XAA_H #include "lg_xaa.h" /* Laguna raster operations, source is OP1 and destination is OP0. */ @@ -296,4 +298,4 @@ LgSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, LgSETDSTXY(x2, y2); LgSETEXTENTS(w, h); } - +#endif |