summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2012-07-15 17:14:10 +1000
committerDave Airlie <airlied@gmail.com>2012-07-15 17:15:07 +1000
commit16df5622c550c64711a25a9d8ece9152c3047a94 (patch)
tree12d583c4fdb689a68820ee77ba606a3ffda32436
parent734e9ff97b81af732ab7065761212e8eb8f6aa3c (diff)
r128: drop XAA support.
this just makes XAA conditional. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--configure.ac18
-rw-r--r--src/r128.h7
-rw-r--r--src/r128_accel.c15
-rw-r--r--src/r128_dga.c10
-rw-r--r--src/r128_dri.c14
-rw-r--r--src/r128_driver.c4
6 files changed, 62 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 8049006..6c4f5d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,24 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[#include "xorg-server.h"])
CPPFLAGS="$SAVE_CPPFLAGS"
+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])
+
AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
diff --git a/src/r128.h b/src/r128.h
index 3c51879..bee1562 100644
--- a/src/r128.h
+++ b/src/r128.h
@@ -44,7 +44,10 @@
#include "xf86Pci.h"
/* XAA and Cursor Support */
+#ifdef HAVE_XAA_H
#include "xaa.h"
+#endif
+#include "xf86fbman.h"
#include "xf86Cursor.h"
/* DDC support */
@@ -65,6 +68,8 @@
#include "GL/glxint.h"
#endif
+#include "fb.h"
+
#include "compat-api.h"
#include "atipcirename.h"
@@ -276,7 +281,9 @@ typedef struct {
Bool PaletteSavedOnVT; /* Palette saved on last VT switch */
+#ifdef HAVE_XAA_H
XAAInfoRecPtr accel;
+#endif
Bool accelOn;
xf86CursorInfoPtr cursor;
unsigned long cursor_start;
diff --git a/src/r128_accel.c b/src/r128_accel.c
index 7708bda..defc076 100644
--- a/src/r128_accel.c
+++ b/src/r128_accel.c
@@ -101,6 +101,7 @@
/* X and server generic header files */
#include "xf86.h"
+#ifdef HAVE_XAA_H
static struct {
int rop;
int pattern;
@@ -122,6 +123,7 @@ static struct {
{ R128_ROP3_DSan, R128_ROP3_DPan }, /* GXnand */
{ R128_ROP3_ONE, R128_ROP3_ONE } /* GXset */
};
+#endif
extern int getR128EntityIndex(void);
@@ -317,6 +319,7 @@ int R128CCEStop(ScrnInfoPtr pScrn)
#endif
+#ifdef HAVE_XAA_H
/* Setup for XAA SolidFill. */
static void R128SetupForSolidFill(ScrnInfoPtr pScrn,
int color, int rop, unsigned int planemask)
@@ -1006,6 +1009,7 @@ static void R128SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
}
}
}
+#endif
/* Initialize the acceleration hardware. */
void R128EngineInit(ScrnInfoPtr pScrn)
@@ -1098,6 +1102,8 @@ void R128EngineInit(ScrnInfoPtr pScrn)
#ifdef R128DRI
+#ifdef HAVE_XAA_H
+
/* Setup for XAA SolidFill. */
static void R128CCESetupForSolidFill(ScrnInfoPtr pScrn,
int color, int rop,
@@ -1540,6 +1546,7 @@ static void R128CCESubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
ADVANCE_RING();
}
+#endif
/* Get an indirect buffer for the CCE 2D acceleration commands.
*/
@@ -1634,6 +1641,7 @@ void R128CCEFlushIndirect( ScrnInfoPtr pScrn, int discard )
info->indirectStart = buffer->used;
}
+#ifdef HAVE_XAA_H
/* Flush and release the indirect buffer.
*/
void R128CCEReleaseIndirect( ScrnInfoPtr pScrn )
@@ -1743,7 +1751,9 @@ static void R128CCEAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
}
#endif
+#endif
+#ifdef HAVE_XAA_H
/* This callback is required for multihead cards using XAA */
static
void R128RestoreAccelState(ScrnInfoPtr pScrn)
@@ -1857,11 +1867,15 @@ static void R128MMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a)
}
}
+#endif
/* Initialize XAA for supported acceleration and also initialize the
graphics hardware for acceleration. */
Bool R128AccelInit(ScreenPtr pScreen)
{
+#ifndef HAVE_XAA_H
+ return FALSE;
+#else
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
R128InfoPtr info = R128PTR(pScrn);
XAAInfoRecPtr a;
@@ -1880,4 +1894,5 @@ Bool R128AccelInit(ScreenPtr pScreen)
R128EngineInit(pScrn);
return XAAInit(pScreen, a);
+#endif
}
diff --git a/src/r128_dga.c b/src/r128_dga.c
index 71e1b42..d7fee02 100644
--- a/src/r128_dga.c
+++ b/src/r128_dga.c
@@ -29,10 +29,12 @@ static Bool R128_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
static Bool R128_SetMode(ScrnInfoPtr, DGAModePtr);
static int R128_GetViewport(ScrnInfoPtr);
static void R128_SetViewport(ScrnInfoPtr, int, int, int);
+#ifdef HAVE_XAA_H
static void R128_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
static void R128_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
static void R128_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int,
unsigned long);
+#endif
static DGAModePtr R128SetupDGAMode(ScrnInfoPtr pScrn,
DGAModePtr modes,
@@ -81,6 +83,7 @@ SECOND_PASS:
if (pixmap)
currentMode->flags |= DGA_PIXMAP_AVAILABLE;
+#ifdef HAVE_XAA_H
if (info->accel) {
if (info->accel->SetupForSolidFill &&
info->accel->SubsequentSolidFillRect)
@@ -93,6 +96,7 @@ SECOND_PASS:
DGA_BLIT_RECT | DGA_BLIT_RECT_TRANS))
currentMode->flags &= ~DGA_CONCURRENT_ACCESS;
}
+#endif
if (pMode->Flags & V_DBLSCAN)
currentMode->flags |= DGA_DOUBLESCAN;
if (pMode->Flags & V_INTERLACE)
@@ -211,6 +215,7 @@ R128DGAInit(ScreenPtr pScreen)
info->DGAFuncs.BlitRect = NULL;
info->DGAFuncs.BlitTransRect = NULL;
+#ifdef HAVE_XAA_H
if (info->accel) {
info->DGAFuncs.Sync = info->accel->Sync;
if (info->accel->SetupForSolidFill &&
@@ -222,6 +227,7 @@ R128DGAInit(ScreenPtr pScreen)
info->DGAFuncs.BlitTransRect = R128_BlitTransRect;
}
}
+#endif
return DGAInit(pScreen, &(info->DGAFuncs), modes, num);
}
@@ -317,7 +323,7 @@ R128_SetViewport(
info->DGAViewportStatus = 0; /* FIXME */
}
-
+#ifdef HAVE_XAA_H
static void
R128_FillRect (
ScrnInfoPtr pScrn,
@@ -379,7 +385,7 @@ R128_BlitTransRect(
if (pScrn->bitsPerPixel == info->CurrentLayout.bitsPerPixel)
SET_SYNC_FLAG(info->accel);
}
-
+#endif
static Bool
R128_OpenFramebuffer(
diff --git a/src/r128_dri.c b/src/r128_dri.c
index 4f318ef..09b3cff 100644
--- a/src/r128_dri.c
+++ b/src/r128_dri.c
@@ -301,10 +301,11 @@ static void R128DestroyContext(ScreenPtr pScreen, drm_context_t hwContext,
can start/stop the engine. */
static void R128EnterServer(ScreenPtr pScreen)
{
+#ifdef HAVE_XAA_H
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
R128InfoPtr info = R128PTR(pScrn);
-
if (info->accel) info->accel->NeedToSync = TRUE;
+#endif
}
/* Called when the X server goes to sleep to allow the X server's
@@ -358,9 +359,11 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx)
ScreenPtr pScreen = pWin->drawable.pScreen;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
R128InfoPtr info = R128PTR(pScrn);
+#ifdef HAVE_XAA_H
BoxPtr pbox, pboxSave;
int nbox, nboxSave;
int depth;
+#endif
/* FIXME: Use accel when CCE 2D code is written
* EA: What is this code kept for? Radeon doesn't have it and
@@ -369,7 +372,7 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx)
*/
if (info->directRenderingEnabled)
return;
-
+#ifdef HAVE_XAA_H
/* FIXME: This should be based on the __GLXvisualConfig info */
switch (pScrn->bitsPerPixel) {
case 8: depth = 0x000000ff; break;
@@ -413,6 +416,7 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx)
pbox->y2 - pbox->y1);
info->accel->NeedToSync = TRUE;
+#endif
}
/* Copy the back and depth buffers when the X server moves a window. */
@@ -1386,8 +1390,10 @@ void R128DRICloseScreen(ScreenPtr pScreen)
static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
+#ifdef HAVE_XAA_H
R128InfoPtr info = R128PTR(pScrn);
int i;
+#endif
R128SAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen);
/* Don't want to do this when no 3d is active and pages are
@@ -1396,6 +1402,7 @@ static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
if (!pSAREAPriv->pfAllowPageFlip && pSAREAPriv->pfCurrentPage == 0)
return;
+#ifdef HAVE_XAA_H
(*info->accel->SetupForScreenToScreenCopy)(pScrn,
1, 1, GXcopy,
(CARD32)(-1), -1);
@@ -1412,10 +1419,12 @@ static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
yb - ya + 1);
}
}
+#endif
}
static void R128EnablePageFlip(ScreenPtr pScreen)
{
+#ifdef HAVE_XAA_H
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
R128InfoPtr info = R128PTR(pScrn);
R128SAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
@@ -1436,6 +1445,7 @@ static void R128EnablePageFlip(ScreenPtr pScreen)
pSAREAPriv->pfAllowPageFlip = 1;
}
+#endif
}
static void R128DisablePageFlip(ScreenPtr pScreen)
diff --git a/src/r128_driver.c b/src/r128_driver.c
index bfa3dfd..9714896 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -78,8 +78,6 @@
#include "r128_sarea.h"
#endif
-#include "fb.h"
-
/* colormap initialization */
#include "micmap.h"
@@ -4298,8 +4296,10 @@ static Bool R128CloseScreen(CLOSE_SCREEN_ARGS_DECL)
R128UnmapMem(pScrn);
}
+#ifdef HAVE_XAA_H
if (info->accel) XAADestroyInfoRec(info->accel);
info->accel = NULL;
+#endif
if (info->scratch_save) free(info->scratch_save);
info->scratch_save = NULL;