Patch the driver a bit more, to be able to build without XAA.

This commit is contained in:
matthieu 2012-11-11 21:34:15 +00:00
parent 65bb9e1366
commit 5e96e40232
8 changed files with 49 additions and 2 deletions

View File

@ -97,6 +97,27 @@ CFLAGS="$XORG_CFLAGS"
AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
CFLAGS="$save_CFLAGS"
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)
if test "x$XAA" = xyes; then
AC_DEFINE(USE_XAA, test "x$XAA" = xyes, [Build support for XAA])
fi
AC_MSG_RESULT([$XAA])
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
[#include "xorg/xorg-server.h"])

View File

@ -34,7 +34,9 @@
#endif
#include <X11/Xarch.h>
#ifdef USE_XAA
#include "xaalocal.h"
#endif
#include "miline.h"
#include "via.h"
@ -1073,6 +1075,7 @@ viaSetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop,
ADVANCE_RING;
}
#ifdef USE_XAA
static void
viaSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1,
int x2, int y2, int flags)
@ -1349,6 +1352,7 @@ viaInitXAA(ScreenPtr pScreen)
}
#endif
/*
* Mark Sync using the 2D blitter for AGP. NoOp for PCI.
* In the future one could even launch a NULL PCI DMA command
@ -2594,10 +2598,12 @@ viaExitAccel(ScreenPtr pScreen)
pVia->exaDriverPtr = NULL;
return;
}
#ifdef _USE_XAA
if (pVia->AccelInfoRec) {
XAADestroyInfoRec(pVia->AccelInfoRec);
pVia->AccelInfoRec = NULL;
}
#endif
}
/*

View File

@ -26,7 +26,9 @@
#include "config.h"
#endif
#ifdef USE_XAA
#include "xaalocal.h"
#endif
#include "via_driver.h"
#include "dgaproc.h"

View File

@ -1218,9 +1218,11 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
if (!xf86NameCmp(s, "EXA")) {
from = X_CONFIG;
pVia->useEXA = TRUE;
#ifdef USE_XAA
} else if (!xf86NameCmp(s, "XAA")) {
from = X_CONFIG;
pVia->useEXA = FALSE;
#endif
}
}
xf86DrvMsg(pScrn->scrnIndex, from,
@ -1809,11 +1811,13 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
VIAFreeRec(pScrn);
return FALSE;
}
#ifdef USE_XAA
} else {
if (!xf86LoadSubModule(pScrn, "xaa")) {
VIAFreeRec(pScrn);
return FALSE;
}
#endif
}
}

View File

@ -61,7 +61,9 @@
#include "xf86cmap.h"
#include "vbe.h"
#ifdef USE_XAA
#include "xaa.h"
#endif
#include "compat-api.h"
#include "via_regs.h"
@ -274,7 +276,9 @@ typedef struct _VIA {
void (*PointerMoved)(int index, int x, int y);
/* Support for XAA acceleration */
#ifdef USE_XAA
XAAInfoRecPtr AccelInfoRec;
#endif
ViaTwodContext td;
Via3DState v3d;
Via3DState *lastToUpload;

View File

@ -74,14 +74,18 @@ VIAFreeLinear(VIAMemPtr mem)
if (pVia->useEXA && !pVia->NoAccel) {
exaOffscreenFree(mem->pScrn->pScreen, mem->exa);
#ifdef USE_XAA
mem->linear = NULL;
#endif
mem->pool = 0;
return;
}
}
#ifdef USE_XAA
xf86FreeOffscreenLinear(mem->linear);
mem->linear = NULL;
mem->pool = 0;
#endif
return;
case 2:
#ifdef OPENCHROMEDRI
@ -93,7 +97,6 @@ VIAFreeLinear(VIAMemPtr mem)
return;
}
}
int
viaOffScreenLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, unsigned long size)
{
@ -113,7 +116,7 @@ viaOffScreenLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, unsigned long size)
mem->pScrn = pScrn;
return Success;
}
#ifdef USE_XAA
mem->linear = xf86AllocateOffscreenLinear(pScrn->pScreen,
(size + depth - 1) / depth,
32, NULL, NULL, NULL);
@ -122,6 +125,7 @@ viaOffScreenLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, unsigned long size)
mem->base = mem->linear->offset * depth;
mem->pool = 1;
mem->pScrn = pScrn;
#endif
return Success;
}

View File

@ -144,7 +144,9 @@ typedef struct {
drm_via_mem_t drm; /* DRM management object */
#endif
void *pVia; /* VIA driver pointer */
#ifdef USE_XAA
FBLinearPtr linear; /* X linear pool info ptr */
#endif
ExaOffscreenArea *exa;
ScrnInfoPtr pScrn;
} VIAMem;
@ -172,7 +174,9 @@ typedef struct {
OVERLAYRECORD overlayRecordV3;
BoxRec AvailFBArea;
#ifdef USE_XAA
FBLinearPtr SWOVlinear;
#endif
Bool MPEG_ON;
Bool SWVideo_ON;

View File

@ -49,8 +49,10 @@
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
#ifdef USE_XAA
#include "xaa.h"
#include "xaalocal.h"
#endif USE_XAA
#include "dixstruct.h"
#include "via_xvpriv.h"
#include "via_swov.h"