summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2012-07-15 19:41:28 +1000
committerDave Airlie <airlied@gmail.com>2012-07-15 19:41:28 +1000
commitf11a407ceb0857bb0d33811511117b490a8ae6ee (patch)
treea11bad19014270c1d7bf4f27a261f3992e4e281c
parentfa0f3092ed38ce71ba9f65156bde306eb63feaf8 (diff)
mga: fix after XAA removal
Fix mga build after XAA removal. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--configure.ac20
-rw-r--r--src/Makefile.am4
-rw-r--r--src/mga.h7
-rw-r--r--src/mga_arc.c2
-rw-r--r--src/mga_dga.c13
-rw-r--r--src/mga_dri.c2
-rw-r--r--src/mga_driver.c10
-rw-r--r--src/mga_video.c6
8 files changed, 49 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index fd870b8..cc2498e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,8 +126,24 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then
fi
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
-AM_CONDITIONAL(USE_XAA, true)
-AC_DEFINE(USE_XAA, 1, [Build support for XAA])
+
+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])
# Properly handle EXA.
AC_MSG_CHECKING([whether to enable EXA support])
diff --git a/src/Makefile.am b/src/Makefile.am
index 46f0265..79745d1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,7 +32,6 @@ mga_drv_la_LIBADD = $(noinst_LTLIBRARIES)
mga_drv_la_SOURCES = \
binding.h \
client.h \
- mga_arc.c \
mga_bios.c \
mga_common.h \
mga_dac3026.c \
@@ -70,7 +69,8 @@ mga_drv_la_SOURCES += \
mga_exa.c
endif
-if USE_XAA
+if XAA
mga_drv_la_SOURCES += \
+ mga_arc.c \
mga_storm.c
endif
diff --git a/src/mga.h b/src/mga.h
index 5856a3f..34695c1 100644
--- a/src/mga.h
+++ b/src/mga.h
@@ -20,7 +20,10 @@
#include <stdio.h>
#include "compiler.h"
+#ifdef HAVE_XAA_H
#include "xaa.h"
+#endif
+#include "xf86fbman.h"
#include "exa.h"
#include "xf86Cursor.h"
#include "vgaHW.h"
@@ -554,7 +557,9 @@ typedef struct {
CARD32 MAccess;
int FifoSize;
int StyleLen;
+#ifdef HAVE_XAA_H
XAAInfoRecPtr AccelInfoRec;
+#endif
xf86CursorInfoPtr CursorInfoRec;
DGAModePtr DGAModes;
int numDGAModes;
@@ -715,7 +720,7 @@ void MGAAdjustGranularity(ScrnInfoPtr pScrn, int* x, int* y);
void MGA2064SetupFuncs(ScrnInfoPtr pScrn);
void MGAGSetupFuncs(ScrnInfoPtr pScrn);
-/* #ifdef USE_XAA */
+/*#ifdef USE_XAA */
void MGAStormSync(ScrnInfoPtr pScrn);
void MGAStormEngineInit(ScrnInfoPtr pScrn);
Bool MGAStormAccelInit(ScreenPtr pScreen);
diff --git a/src/mga_arc.c b/src/mga_arc.c
index 5263f1f..61ade3b 100644
--- a/src/mga_arc.c
+++ b/src/mga_arc.c
@@ -39,8 +39,10 @@ in this Software without prior written authorization from The Open Group.
#include "mizerarc.h"
#include "mi.h"
#include "scrnintstr.h"
+#ifdef HAVE_XAA_H
#include "xaa.h"
#include "xaalocal.h"
+#endif
#include "xf86.h"
#include "xf86_OSproc.h"
diff --git a/src/mga_dga.c b/src/mga_dga.c
index a806eb2..ef03688 100644
--- a/src/mga_dga.c
+++ b/src/mga_dga.c
@@ -5,8 +5,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
-#include "xaa.h"
-#include "xaalocal.h"
#include "mga.h"
#include "mga_reg.h"
#include "dgaproc.h"
@@ -17,10 +15,12 @@ static Bool MGA_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
static Bool MGA_SetMode(ScrnInfoPtr, DGAModePtr);
static int MGA_GetViewport(ScrnInfoPtr);
static void MGA_SetViewport(ScrnInfoPtr, int, int, int);
+#ifdef HAVE_XAA_H
static void MGA_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
static void MGA_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
static void MGA_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int,
unsigned long);
+#endif
static
DGAFunctionRec MGA_DGAFuncs = {
@@ -30,9 +30,13 @@ DGAFunctionRec MGA_DGAFuncs = {
MGA_SetViewport,
MGA_GetViewport,
MGAStormSync,
+#ifdef HAVE_XAA_H
MGA_FillRect,
MGA_BlitRect,
MGA_BlitTransRect
+#else
+ NULL, NULL, NULL
+#endif
};
@@ -120,11 +124,13 @@ SECOND_PASS:
mode->flags = DGA_CONCURRENT_ACCESS;
if(pixmap)
mode->flags |= DGA_PIXMAP_AVAILABLE;
+#ifdef HAVE_XAA_H
if(!pMga->NoAccel) {
mode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT;
if((Bpp != 3) && (pMga->Chipset != PCI_CHIP_MGA2064))
mode->flags |= DGA_BLIT_RECT_TRANS;
}
+#endif
if(pMode->Flags & V_DBLSCAN)
mode->flags |= DGA_DOUBLESCAN;
if(pMode->Flags & V_INTERLACE)
@@ -359,6 +365,7 @@ MGA_SetViewport(
pMga->DGAViewportStatus = 0; /* MGAAdjustFrame loops until finished */
}
+#ifdef HAVE_XAA_H
static void
MGA_FillRect (
ScrnInfoPtr pScrn,
@@ -424,7 +431,7 @@ static void MGA_BlitTransRect( ScrnInfoPtr pScrn, int srcx, int srcy,
SET_SYNC_FLAG(pMga->AccelInfoRec);
}
}
-
+#endif
static Bool
MGA_OpenFramebuffer(
diff --git a/src/mga_dri.c b/src/mga_dri.c
index c517322..0154671 100644
--- a/src/mga_dri.c
+++ b/src/mga_dri.c
@@ -355,7 +355,7 @@ void MGAGetQuiescence( ScrnInfoPtr pScrn )
MGAWaitForIdleDMA( pScrn );
/* FIXME what about EXA? */
-#ifdef USE_XAA
+#ifdef XAA
if (!pMga->Exa && pMga->AccelInfoRec) {
WAITFIFO( 11 );
OUTREG( MGAREG_MACCESS, pMga->MAccess );
diff --git a/src/mga_driver.c b/src/mga_driver.c
index e50d77b..b3fe538 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -90,7 +90,7 @@
#include "mga_macros.h"
#include "mga_maven.h"
-#ifdef USE_XAA
+#ifdef XAA
#include "xaa.h"
#endif
@@ -2118,7 +2118,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
} else {
#endif
-#ifdef USE_XAA
+#ifdef XAA
if (!xf86LoadSubModule(pScrn, "xaa")) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Falling back to shadowfb\n");
@@ -3401,8 +3401,10 @@ MGAScreenInit(SCREEN_INIT_ARGS_DECL)
mgaExaInit(pScreen);
else
#endif
-#ifdef USE_XAA
+#ifdef XAA
MGAStormAccelInit(pScreen);
+#else
+ ;
#endif
}
@@ -3771,7 +3773,7 @@ MGACloseScreen(CLOSE_SCREEN_ARGS_DECL)
pMgaEnt->refCount--;
}
-#ifdef USE_XAA
+#ifdef XAA
if (pMga->AccelInfoRec)
XAADestroyInfoRec(pMga->AccelInfoRec);
#endif
diff --git a/src/mga_video.c b/src/mga_video.c
index 00e026d..535e329 100644
--- a/src/mga_video.c
+++ b/src/mga_video.c
@@ -14,7 +14,6 @@
#include "mga_macros.h"
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
-#include "xaa.h"
#ifdef USE_XAA
#include "xaa.h"
@@ -1987,9 +1986,11 @@ MGAPutImageILOAD(
bpp = pScrn->bitsPerPixel >> 3;
+#ifdef HAVE_XAA_H
if( pMga->AccelInfoRec->NeedToSync && ((long)data != pPriv->lastPort) ) {
MGAStormSync(pScrn);
}
+#endif
pPriv->lastPort = (long)data;
nbox=REGION_NUM_RECTS(clipBoxes);
@@ -2019,8 +2020,9 @@ MGAPutImageILOAD(
pbox++;
}
-
+#ifdef HAVE_XAA_H
pMga->AccelInfoRec->NeedToSync = TRUE;
+#endif
pPriv->videoStatus = FREE_TIMER;
pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
pMga->VideoTimerCallback = MGAVideoTimerCallback;