summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-07-17 14:06:43 +1000
committerDave Airlie <airlied@redhat.com>2012-07-17 14:19:46 +1000
commit018440b3e852304b6a1aa46ae8ed358635d70ff4 (patch)
treec5f64fb1c2f58155a9e84a31a77aff7f605bcf21
parent94a2eb3193867502d0d52d88a8e1bb990cad2b2a (diff)
i740: fix build after XAA removal from server.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--configure.ac18
-rw-r--r--src/i740.h4
-rw-r--r--src/i740_accel.c11
-rw-r--r--src/i740_dga.c17
-rw-r--r--src/i740_driver.c2
-rw-r--r--src/i740_video.c2
6 files changed, 47 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 285975f..086a41f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,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=i740
diff --git a/src/i740.h b/src/i740.h
index 7da7ebc..4e4dd9c 100644
--- a/src/i740.h
+++ b/src/i740.h
@@ -43,7 +43,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i740_reg.h"
#include "i740_macros.h"
+#ifdef HAVE_XAA_H
#include "xaa.h"
+#endif
#include "xf86Cursor.h"
/* Globals */
@@ -106,7 +108,9 @@ typedef struct _I740Rec {
int HasSGRAM;
I740RegRec SavedReg;
I740RegRec ModeReg;
+#ifdef HAVE_XAA_H
XAAInfoRecPtr AccelInfoRec;
+#endif
xf86CursorInfoPtr CursorInfoRec;
FBAreaPtr CursorData;
CloseScreenProcPtr CloseScreen;
diff --git a/src/i740_accel.c b/src/i740_accel.c
index 81c7565..7d59ae6 100644
--- a/src/i740_accel.c
+++ b/src/i740_accel.c
@@ -44,12 +44,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86Pci.h"
#include "xf86PciInfo.h"
-#include "xaa.h"
#include "vgaHW.h"
#include "xf86xv.h"
#include "i740.h"
+#ifdef HAVE_XAA_H
static unsigned int i740Rop[16] = {
0x00, /* GXclear */
0x88, /* GXand */
@@ -115,6 +115,7 @@ static void I740SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
int x, int y, int w, int h,
int skipleft);
#endif
+#endif
/*
* The following function sets up the supported acceleration. Call it
* from the FbInit() function in the SVGA driver, or before ScreenInit
@@ -122,6 +123,7 @@ static void I740SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
*/
Bool
I740AccelInit(ScreenPtr pScreen) {
+#ifdef HAVE_XAA_H
XAAInfoRecPtr infoPtr;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I740Ptr pI740 = I740PTR(pScrn);
@@ -192,8 +194,13 @@ I740AccelInit(ScreenPtr pScreen) {
#endif
#endif
return XAAInit(pScreen, infoPtr);
+#else
+ return FALSE;
+#endif
}
+#ifdef HAVE_XAA_H
+
static void
I740SyncPIO(ScrnInfoPtr pScrn) {
WAIT_ENGINE_IDLE_PIO();
@@ -396,3 +403,5 @@ I740SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, int y,
OUTREG(LP_FIFO, (h << 16) | (w * pI740->cpp));
}
#endif
+
+#endif
diff --git a/src/i740_dga.c b/src/i740_dga.c
index 8fac946..9315080 100644
--- a/src/i740_dga.c
+++ b/src/i740_dga.c
@@ -30,11 +30,12 @@
#include "xf86_OSproc.h"
#include "xf86Pci.h"
#include "xf86PciInfo.h"
-#include "xaa.h"
-#include "xaalocal.h"
#include "vgaHW.h"
#include "xf86xv.h"
#include "i740.h"
+#ifdef HAVE_XAA_H
+#include "xaalocal.h"
+#endif
#include "dgaproc.h"
#include "i740_dga.h"
@@ -43,12 +44,13 @@ static Bool I740_SetMode(ScrnInfoPtr, DGAModePtr);
static void I740_Sync(ScrnInfoPtr);
static int I740_GetViewport(ScrnInfoPtr);
static void I740_SetViewport(ScrnInfoPtr, int, int, int);
+#ifdef HAVE_XAA_H
static void I740_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
static void I740_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
#if 0
static void I740_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long);
#endif
-
+#endif
static DGAFunctionRec I740DGAFuncs = {
I740_OpenFramebuffer,
NULL,
@@ -56,6 +58,7 @@ static DGAFunctionRec I740DGAFuncs = {
I740_SetViewport,
I740_GetViewport,
I740_Sync,
+#ifdef HAVE_XAA_H
I740_FillRect,
I740_BlitRect,
#if 0
@@ -63,6 +66,9 @@ static DGAFunctionRec I740DGAFuncs = {
#else
NULL
#endif
+#else
+ NULL, NULL, NULL
+#endif
};
Bool I740DGAInit(ScreenPtr pScreen)
@@ -91,8 +97,10 @@ Bool I740DGAInit(ScreenPtr pScreen)
currentMode->mode = pMode;
currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE;
+#ifdef HAVE_XAA_H
if(pI740->AccelInfoRec)
currentMode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT;
+#endif
if(pMode->Flags & V_DBLSCAN)
currentMode->flags |= DGA_DOUBLESCAN;
if(pMode->Flags & V_INTERLACE)
@@ -182,6 +190,7 @@ static void I740_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
pI740->DGAViewportStatus = 0;
}
+#ifdef HAVE_XAA_H
static void I740_FillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color)
{
I740Ptr pI740 = I740PTR(pScrn);
@@ -219,7 +228,7 @@ static void I740_BlitRect(
SET_SYNC_FLAG(pI740->AccelInfoRec);
}
}
-
+#endif
#if 0
static void I740_BlitTransRect(ScrnInfoPtr pScrn,
int srcx, int srcy,
diff --git a/src/i740_driver.c b/src/i740_driver.c
index d819ad9..fc26f0e 100644
--- a/src/i740_driver.c
+++ b/src/i740_driver.c
@@ -1690,9 +1690,11 @@ I740CloseScreen(int scrnIndex, ScreenPtr pScreen)
I740UnmapMem(pScrn);
vgaHWUnmapMem(pScrn);
+#ifdef HAVE_XAA_H
if (pI740->AccelInfoRec)
XAADestroyInfoRec(pI740->AccelInfoRec);
pI740->AccelInfoRec=0;
+#endif
if (pI740->CursorInfoRec)
xf86DestroyCursorInfoRec(pI740->CursorInfoRec);
pI740->CursorInfoRec=0;
diff --git a/src/i740_video.c b/src/i740_video.c
index ca60ded..2f783c2 100644
--- a/src/i740_video.c
+++ b/src/i740_video.c
@@ -67,8 +67,6 @@
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
-#include "xaa.h"
-#include "xaalocal.h"
#include "dixstruct.h"
#include "fourcc.h"