summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-16 04:55:18 +0100
committerDave Airlie <airlied@redhat.com>2012-07-16 04:55:18 +0100
commite1176eb1a009d5d4b9568bf06045297c82c9028c (patch)
tree15ef1ba5d6f6610eb46421aced94f1cce70ccbaf
parentac6e7154f1f78c7e8dee28dec9ac9f0445735db7 (diff)
tga: port to XAA-less server.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--configure.ac18
-rw-r--r--src/tga.h4
-rw-r--r--src/tga_accel.c9
-rw-r--r--src/tga_driver.c2
-rw-r--r--src/tga_line.c4
5 files changed, 34 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 87305b0..1d5e7c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,24 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then
fi
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = 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_SUBST([moduledir])
DRIVER_NAME=tga
diff --git a/src/tga.h b/src/tga.h
index 9e967e0..7903b80 100644
--- a/src/tga.h
+++ b/src/tga.h
@@ -26,7 +26,9 @@
#define _TGA_H_
#include "tga_pcirename.h"
+#ifdef HAVE_XAA_H
#include "xaa.h"
+#endif
#include "xf86RamDac.h"
#include "compat-api.h"
@@ -72,7 +74,9 @@ typedef struct {
TGARegRec ModeReg;
CARD32 AccelFlags;
RamDacRecPtr RamDacRec;
+#ifdef HAVE_XAA_H
XAAInfoRecPtr AccelInfoRec;
+#endif
xf86CursorInfoPtr CursorInfoRec;
CloseScreenProcPtr CloseScreen;
int CardType;
diff --git a/src/tga_accel.c b/src/tga_accel.c
index 8a6dacf..35af1a4 100644
--- a/src/tga_accel.c
+++ b/src/tga_accel.c
@@ -44,6 +44,7 @@
#include "BT.h"
#include "tga.h"
+#ifdef HAVE_XAA_H
/* defines */
#define BLIT_FORWARDS 0
@@ -89,7 +90,7 @@ TGASubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
static void
TGASubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
-
+#endif
/*
* The following function sets up the supported acceleration. Call it
* from the FbInit() function in the SVGA driver.
@@ -97,6 +98,7 @@ TGASubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
Bool
DEC21030AccelInit(ScreenPtr pScreen)
{
+#ifdef HAVE_XAA_H
XAAInfoRecPtr TGA_AccelInfoRec;
BoxRec AvailFBArea;
ScrnInfoPtr pScrn;
@@ -192,8 +194,12 @@ DEC21030AccelInit(ScreenPtr pScreen)
/* initialize XAA */
return(XAAInit(pScreen, TGA_AccelInfoRec));
+#else
+ return FALSE;
+#endif
}
+#ifdef HAVE_XAA_H
static void
TGASetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
int fg, int bg, int rop,
@@ -1568,3 +1574,4 @@ TGASubsequentClippedDashedLine(ScrnInfoPtr pScrn, int x1, int y1, int len,
return;
}
+#endif
diff --git a/src/tga_driver.c b/src/tga_driver.c
index 1a3eca8..dd4f3e6 100644
--- a/src/tga_driver.c
+++ b/src/tga_driver.c
@@ -1625,8 +1625,10 @@ TGACloseScreen(CLOSE_SCREEN_ARGS_DECL)
TGASync(pScrn);
TGAUnmapMem(pScrn);
+#ifdef HAVE_XAA_H
if(pTga->AccelInfoRec)
XAADestroyInfoRec(pTga->AccelInfoRec);
+#endif
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pTga->CloseScreen;
diff --git a/src/tga_line.c b/src/tga_line.c
index e32f8b2..41253ca 100644
--- a/src/tga_line.c
+++ b/src/tga_line.c
@@ -42,12 +42,11 @@
#include "pixmapstr.h"
#include "miline.h"
#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
/* #include "tga.h" */
#include "tga_regs.h"
+#ifdef HAVE_XAA_H
/* line functions */
extern void
TGASetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop,
@@ -632,3 +631,4 @@ TGAPolySegment(
}
+#endif