summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-17 14:38:38 +1000
committerDave Airlie <airlied@redhat.com>2012-07-17 14:38:38 +1000
commitfffd73884a0b18bac6f5c35614f21fca609e15e3 (patch)
treed48f6144f657adc0656bffa18becefefa9c2abc3
parent28f8c5f5f957c0fac99d089137d675bf18db5773 (diff)
s3v: adjust to removal of XAA from server.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--configure.ac20
-rw-r--r--src/s3v.h5
-rw-r--r--src/s3v_accel.c11
-rw-r--r--src/s3v_dga.c13
-rw-r--r--src/s3v_driver.c2
5 files changed, 44 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 45a630f..fa68d6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# Copyright 2005 Adam Jackson.
+\# Copyright 2005 Adam Jackson.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@@ -81,6 +81,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=s3virge
diff --git a/src/s3v.h b/src/s3v.h
index 0a5c7a9..5c8d6e6 100644
--- a/src/s3v.h
+++ b/src/s3v.h
@@ -60,8 +60,11 @@ in this Software without prior written authorization from the XFree86 Project.
#include "fb.h"
/* Drivers using the XAA interface ... */
+#ifdef HAVE_XAA_H
#include "xaa.h"
#include "xaalocal.h"
+#endif
+#include "xf86fbman.h"
#include "xf86cmap.h"
#include "xf86i2c.h"
@@ -275,8 +278,10 @@ typedef struct tagS3VRec {
/* Pointer used to save wrapped */
/* CloseScreen function. */
CloseScreenProcPtr CloseScreen;
+#ifdef HAVE_XAA_H
/* XAA info Rec */
XAAInfoRecPtr AccelInfoRec;
+#endif
/* PCI info vars. */
pciVideoPtr PciInfo;
#ifndef XSERVER_LIBPCIACCESS
diff --git a/src/s3v_accel.c b/src/s3v_accel.c
index 7837e4a..cf9a4e2 100644
--- a/src/s3v_accel.c
+++ b/src/s3v_accel.c
@@ -34,11 +34,11 @@ in this Software without prior written authorization from the XFree86 Project.
#include "miline.h"
/* fb includes are in s3v.h */
-#include "xaalocal.h"
#include "xaarop.h"
#include "servermd.h" /* LOG2_BYTES_PER_SCANLINE_PAD */
+#ifdef HAVE_XAA_H
static void S3VWriteMask(CARD32*, int);
static void S3VEngineReset(ScrnInfoPtr pScrn);
@@ -75,11 +75,12 @@ static void S3VPolylinesThinSolidWrapper(DrawablePtr, GCPtr, int, int,
static void S3VPolySegmentThinSolidWrapper(DrawablePtr, GCPtr, int, xSegment*);
#endif
static void S3VNopAllCmdSets(ScrnInfoPtr pScrn);
-
+#endif
Bool
S3VAccelInit(ScreenPtr pScreen)
{
+#ifdef HAVE_XAA_H
XAAInfoRecPtr infoPtr;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
S3VPtr ps3v = S3VPTR(pScrn);
@@ -232,9 +233,11 @@ S3VAccelInit(ScreenPtr pScreen)
infoPtr->maxOffPixHeight = 2048;
return (XAAInit(pScreen, infoPtr));
+#else
+ return FALSE;
+#endif
}
-
Bool
S3VAccelInit32(ScreenPtr pScreen)
{
@@ -537,6 +540,7 @@ S3VWriteMask(
return;
}
+#ifdef HAVE_XAA_H
/************************\
| Solid Filled Rects |
@@ -967,6 +971,7 @@ S3VSubsequentSolidHorVertLinePlaneMask(
S3VWriteMask((CARD32*)ps3v->MapBaseDense, dwords);
}
+#endif
void
S3VWaitFifoGX2(S3VPtr ps3v, int slots )
diff --git a/src/s3v_dga.c b/src/s3v_dga.c
index ecf8571..f7587b8 100644
--- a/src/s3v_dga.c
+++ b/src/s3v_dga.c
@@ -62,8 +62,6 @@ in this Software without prior written authorization from the XFree86 Project.
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
-#include "xaa.h"
-#include "xaalocal.h"
#include "s3v.h"
#include "dgaproc.h"
@@ -74,8 +72,10 @@ static Bool S3V_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
static Bool S3V_SetMode(ScrnInfoPtr, DGAModePtr);
static int S3V_GetViewport(ScrnInfoPtr);
static void S3V_SetViewport(ScrnInfoPtr, int, int, int);
+#ifdef HAVE_XAA_H
static void S3V_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
static void S3V_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
+#endif
/* dummy... */
@@ -87,8 +87,12 @@ DGAFunctionRec S3V_DGAFuncs = {
S3V_SetViewport,
S3V_GetViewport,
S3VAccelSync,
+#ifdef HAVE_XAA_H
S3V_FillRect,
S3V_BlitRect,
+#else
+ NULL, NULL,
+#endif
NULL
/* dummy... MGA_BlitTransRect */
};
@@ -135,8 +139,10 @@ SECOND_PASS:
currentMode->mode = pMode;
currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE;
+#ifdef HAVE_XAA_H
if(!ps3v->NoAccel)
currentMode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT;
+#endif
if(pMode->Flags & V_DBLSCAN)
currentMode->flags |= DGA_DOUBLESCAN;
if(pMode->Flags & V_INTERLACE)
@@ -280,6 +286,7 @@ S3V_SetViewport(
ps3v->DGAViewportStatus = 0; /* MGAAdjustFrame loops until finished */
}
+#ifdef HAVE_XAA_H
static void
S3V_FillRect (
ScrnInfoPtr pScrn,
@@ -315,7 +322,7 @@ S3V_BlitRect(
SET_SYNC_FLAG(ps3v->AccelInfoRec);
}
}
-
+#endif
static Bool
diff --git a/src/s3v_driver.c b/src/s3v_driver.c
index 7064b1e..05f82cc 100644
--- a/src/s3v_driver.c
+++ b/src/s3v_driver.c
@@ -3308,8 +3308,10 @@ S3VCloseScreen(int scrnIndex, ScreenPtr pScreen)
S3VUnmapMem(pScrn);
}
+#ifdef HAVE_XAA_H
if (ps3v->AccelInfoRec)
XAADestroyInfoRec(ps3v->AccelInfoRec);
+#endif
if (ps3v->DGAModes)
free(ps3v->DGAModes);