summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2012-07-21 12:36:17 +0200
committerMart Raudsepp <leio@gentoo.org>2012-07-26 05:18:14 +0300
commit68646c3119a69a8391a49f2d565672d73829e2c9 (patch)
tree5e4f053ef16d225f165c9485ad6b738d2b341351
parentcb0e67bbc019b170194b3b51e2a47fca8d3aeac1 (diff)
Allow building on Xservers without XAA
-rw-r--r--configure.ac18
-rw-r--r--src/geode.h14
-rw-r--r--src/gx_accel.c9
-rw-r--r--src/gx_driver.c4
-rw-r--r--src/gx_rotate.c3
-rw-r--r--src/gx_video.c2
6 files changed, 47 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 2c810a2..7d9ead7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,24 @@ AC_ARG_ENABLE(ztv,
[ztv=$enableval],
[ztv=auto])
+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])
+
# Check for Video4Linux Version 2 (V4L2) availability
AC_CHECK_HEADERS([linux/videodev2.h],[v4l2=yes],[v4l2=no])
if test "x$ztv" != "xno" ; then
diff --git a/src/geode.h b/src/geode.h
index 4a86b38..0165c81 100644
--- a/src/geode.h
+++ b/src/geode.h
@@ -30,7 +30,9 @@
#include "geode_pcirename.h"
#include "config.h"
+#ifdef HAVE_XAA_H
#include "xaa.h"
+#endif
#include "exa.h"
#include "xf86Cursor.h"
@@ -51,6 +53,12 @@
#undef XF86EXA
#endif
+#ifdef HAVE_XAA_H
+#define XF86XAA 1
+#else
+#undef XF86XAA
+#endif
+
#define CFB 0
#define INT10_SUPPORT 1
@@ -71,7 +79,7 @@
#define GFX_CPU_GEODELX 4
-#ifdef HAVE_GX
+#if defined(HAVE_GX) && XF86XAA
#define GX_FILL_RECT_SUPPORT 1
#define GX_BRES_LINE_SUPPORT 1
#define GX_DASH_LINE_SUPPORT 0 /* does not do dashed lines */
@@ -84,10 +92,10 @@
#define GX_USE_OFFSCRN_MEM 0
#define GX_ONE_LINE_AT_A_TIME 1
#define GX_WRITE_PIXMAP_SUPPORT 1
+#endif
#define GFX(func) gfx_##func
#define GFX2(func) gfx2_##func
-#endif
#define GEODEPTR(p) ((GeodeRec *)((p)->driverPrivate))
@@ -299,7 +307,9 @@ typedef struct _geodeRec {
int NoOfImgBuffers;
unsigned char **AccelColorExpandBuffers;
int NoOfColorExpandLines;
+#if XF86XAA
XAAInfoRecPtr AccelInfoRec;
+#endif
/* Save state */
unsigned long FBCompressionOffset;
diff --git a/src/gx_accel.c b/src/gx_accel.c
index 58aa833..c368649 100644
--- a/src/gx_accel.c
+++ b/src/gx_accel.c
@@ -39,7 +39,9 @@
#include "vgaHW.h"
#include "xf86.h"
+#ifdef HAVE_XAA_H
#include "xaalocal.h"
+#endif
#include "xf86fbman.h"
#include "miline.h"
#include "xaarop.h"
@@ -128,7 +130,9 @@ static GDashLine gdln;
static unsigned int gu2_xshift, gu2_yshift;
static unsigned int gu2_pitch;
+#if XF86XAA
static XAAInfoRecPtr localRecPtr;
+#endif
/* pat 0xF0 */
/* src 0xCC */
@@ -1964,6 +1968,8 @@ GXAccelInit(ScreenPtr pScrn)
}
#endif
+#if XF86XAA
+
/* Getting the pointer for acceleration Inforecord */
pGeode->AccelInfoRec = localRecPtr = XAACreateInfoRec();
if (!pGeode->AccelInfoRec)
@@ -2076,6 +2082,9 @@ GXAccelInit(ScreenPtr pScrn)
#endif
return (XAAInit(pScrn, localRecPtr));
+#else /* XF86XAA */
+ return FALSE;
+#endif
}
/* END OF FILE */
diff --git a/src/gx_driver.c b/src/gx_driver.c
index f6ac4c6..96b3dc3 100644
--- a/src/gx_driver.c
+++ b/src/gx_driver.c
@@ -258,6 +258,7 @@ GXAllocateMemory(ScreenPtr pScrn, ScrnInfoPtr pScrni, int rotate)
if (!pGeode->useEXA) {
+#if XF86XAA
if (!xf86FBManagerRunning(pScrn)) {
unsigned int offset = fboffset;
@@ -296,6 +297,7 @@ GXAllocateMemory(ScreenPtr pScrn, ScrnInfoPtr pScrni, int rotate)
else
xf86DrvMsg(pScrni->scrnIndex, X_INFO,
"XAA offscreen memory has already been allocated.\n");
+#endif
}
}
return ret;
@@ -972,8 +974,10 @@ GXCloseScreen(int scrnIndex, ScreenPtr pScrn)
if (pScrni->vtSema)
GXLeaveGraphics(pScrni);
+#ifdef XF86XAA
if (pGeode->AccelInfoRec)
XAADestroyInfoRec(pGeode->AccelInfoRec);
+#endif
if (pGeode->AccelImageWriteBuffers) {
free(pGeode->AccelImageWriteBuffers[0]);
diff --git a/src/gx_rotate.c b/src/gx_rotate.c
index 9eb39e7..2a86b30 100644
--- a/src/gx_rotate.c
+++ b/src/gx_rotate.c
@@ -158,7 +158,7 @@ GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode)
pScrni->fbOffset));
/* Don't use XAA pixmap cache or offscreen pixmaps when rotated */
-
+#if XF86XAA
if (pGeode->AccelInfoRec) {
if (pGeode->rotation == RR_Rotate_0) {
pGeode->AccelInfoRec->Flags =
@@ -174,6 +174,7 @@ GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode)
pGeode->AccelInfoRec->maxOffPixHeight = 1;
}
}
+#endif
return TRUE;
diff --git a/src/gx_video.c b/src/gx_video.c
index fef7764..b687b11 100644
--- a/src/gx_video.c
+++ b/src/gx_video.c
@@ -54,8 +54,10 @@
#include "geode.h"
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
+#ifdef HAVE_XAA_H
#include "xaa.h"
#include "xaalocal.h"
+#endif
#include "dixstruct.h"
#include "fourcc.h"
#include "geode_fourcc.h"