Raise minimum supported Xserver version to 1.18 (ABI_VIDEODRV_VERSION 20.0)

Already effectively required by use of XNFcallocarray() introduced in
xorg/xserver@b96dc999 - xserver-1.18.0, released in Nov. 2015.

Allows dropping remnants of code for XAA and pre-pciaccess X servers

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/11>
This commit is contained in:
Alan Coopersmith
2024-05-14 16:16:50 -07:00
parent e7329f4634
commit af09c0ca1f
10 changed files with 17 additions and 2883 deletions

View File

@@ -69,7 +69,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.1.0 xproto fontsproto $REQUIRED_MODULES])
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.18.0 xproto fontsproto $REQUIRED_MODULES])
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
# Checks for libraries.
@@ -131,27 +131,6 @@ 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])
if test "x$XAA" = xyes; then
AC_DEFINE(USE_XAA, 1, [Build support for XAA])
fi
# Properly handle EXA.
AC_MSG_CHECKING([whether to enable EXA support])
if test "x$EXA" = xyes; then

View File

@@ -103,15 +103,14 @@ specified in multihead configurations. Default: auto\-detected.
Disable or enable acceleration. Default: acceleration is enabled.
.TP
.BI "Option \*qAccelMethod\*q \*q" "string" \*q
Chooses between available acceleration architectures. Valid options are
.B XAA
and
.B EXA.
XAA is the traditional acceleration architecture and support for it is very
stable. EXA is a newer acceleration architecture with better performance for
Chooses between available acceleration architectures. The only valid options is
.BR EXA .
XAA was the traditional acceleration architecture, but support for it has been
removed from the X server and this driver.
EXA is a newer acceleration architecture with better performance for
the Render and Composite extensions, but the rendering code for it is newer and
possibly unstable. The default is
.B XAA.
.BR EXA .
.TP
.BI "Option \*qOverclockMem\*q"
Set clocks to values used by some commercial X Servers (G100, G200 and G400

View File

@@ -65,8 +65,3 @@ if USE_EXA
mga_drv_la_SOURCES += \
mga_exa.c
endif
if XAA
mga_drv_la_SOURCES += \
mga_arc.c
endif

View File

@@ -20,9 +20,6 @@
#include <stdio.h>
#include "compiler.h"
#ifdef HAVE_XAA_H
#include "xaa.h"
#endif
#include "xf86fbman.h"
#include "exa.h"
#include "xf86Cursor.h"
@@ -559,9 +556,6 @@ typedef struct {
CARD32 MAccess;
int FifoSize;
int StyleLen;
#ifdef USE_XAA
XAAInfoRecPtr AccelInfoRec;
#endif
xf86CursorInfoPtr CursorInfoRec;
DGAModePtr DGAModes;
int numDGAModes;
@@ -724,12 +718,10 @@ void MGAAdjustGranularity(ScrnInfoPtr pScrn, int* x, int* y);
void MGA2064SetupFuncs(ScrnInfoPtr pScrn);
void MGAGSetupFuncs(ScrnInfoPtr pScrn);
/*#ifdef USE_XAA */
void MGAStormSync(ScrnInfoPtr pScrn);
void MGAStormEngineInit(ScrnInfoPtr pScrn);
Bool MGAStormAccelInit(ScreenPtr pScreen);
Bool mgaAccelInit(ScreenPtr pScreen);
/* #endif */
#ifdef USE_EXA
Bool mgaExaInit(ScreenPtr pScreen);
@@ -737,10 +729,6 @@ Bool mgaExaInit(ScreenPtr pScreen);
Bool MGAHWCursorInit(ScreenPtr pScreen);
#ifdef USE_XAA
void MGAPolyArcThinSolid(DrawablePtr, GCPtr, int, xArc*);
#endif /* USE_XAA */
Bool MGADGAInit(ScreenPtr pScreen);
void MGARefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
@@ -816,10 +804,6 @@ MGA_MARK_SYNC(MGAPtr pMga, ScrnInfoPtr pScrn)
if (pMga->Exa)
exaMarkSync(pScrn->pScreen);
#endif
#ifdef USE_XAA
if (!pMga->Exa)
SET_SYNC_FLAG(pMga->AccelInfoRec);
#endif
}
static __inline__ void
@@ -829,10 +813,6 @@ MGA_SYNC(MGAPtr pMga, ScrnInfoPtr pScrn)
if (pMga->Exa)
exaWaitSync(pScrn->pScreen);
#endif
#ifdef USE_XAA
if (!pMga->Exa && pMga->AccelInfoRec && pMga->AccelInfoRec->NeedToSync)
pMga->AccelInfoRec->Sync(pScrn);
#endif
}
#endif

View File

@@ -1,225 +0,0 @@
/************************************************************
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
********************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <limits.h>
#include <X11/X.h>
#include "gcstruct.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "regionstr.h"
#include <X11/Xprotostr.h>
#include "regionstr.h"
#include "mizerarc.h"
#include "mi.h"
#include "scrnintstr.h"
#ifdef HAVE_XAA_H
#include "xaa.h"
#include "xaalocal.h"
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Pci.h"
#include "mga.h"
#include "mga_reg.h"
#include "mga_macros.h"
#define DRAW_POINT(x, y) { \
tmp = x; \
OUTREG(MGAREG_FXBNDRY, (tmp) | (((tmp) + 1) << 16)); \
OUTREG(MGAREG_YDSTLEN + MGAREG_EXEC, ((y) << 16) | 1); \
}
#ifdef USE_XAA
static void
MGAZeroArc(
DrawablePtr pDraw,
GCPtr pGC,
xArc *arc
){
int yoffset, dyoffset, x, y, a, b, d, mask, k1, k3, dx, dy, tmp;
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
ScrnInfoPtr pScrn = infoRec->pScrn;
MGAPtr pMga = MGAPTR(pScrn);
miZeroArcRec info;
Bool do360;
DDXPointRec org, orgo;
CHECK_DMA_QUIESCENT( pMga, infoRec->pScrn );
(*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel,
pGC->alu, pGC->planemask);
do360 = miZeroArcSetup(arc, &info, TRUE);
org.y = info.yorg + pDraw->y;
org.x = 0;
orgo.y = info.yorgo + pDraw->y;
orgo.x = 0;
info.xorg += pDraw->x;
info.xorgo += pDraw->x;
MIARCSETUP();
yoffset = y ? 1 : 0;
dyoffset = 0;
mask = info.initialMask;
if (!(arc->width & 1)) {
WAITFIFO(4);
if (mask & 2)
DRAW_POINT(info.xorgo, org.y);
if (mask & 8)
DRAW_POINT(info.xorgo, orgo.y);
}
if (!info.end.x || !info.end.y) {
mask = info.end.mask;
info.end = info.altend;
}
if (do360 && (arc->width == arc->height) && !(arc->width & 1)) {
int xoffset = 1;
DDXPointRec orghb, orgohb;
orghb.y = org.y + info.h;
orghb.x = org.x + info.xorg;
orgohb.y = orghb.y;
orgohb.x = orghb.x - info.h;
org.x += info.xorg;
orgo.x += info.xorg;
orghb.x += info.h;
while (1) {
WAITFIFO(16);
DRAW_POINT(org.x + x, org.y + yoffset);
DRAW_POINT(org.x - x, org.y + yoffset);
DRAW_POINT(orgo.x - x, orgo.y - yoffset);
DRAW_POINT(orgo.x + x, orgo.y - yoffset);
if (a < 0) break;
DRAW_POINT(orghb.x - y, orghb.y - xoffset);
DRAW_POINT(orgohb.x + y, orgohb.y - xoffset);
DRAW_POINT(orgohb.x + y, orgohb.y + xoffset);
DRAW_POINT(orghb.x - y, orghb.y + xoffset);
xoffset ++;
MIARCCIRCLESTEP(yoffset ++;);
}
org.x -= info.xorg;
orgo.x -= info.xorg;
x = info.w;
yoffset = info.h;
}
else if (do360) {
while (y < info.h || x < info.w) {
MIARCOCTANTSHIFT(dyoffset = 1;);
WAITFIFO(8);
DRAW_POINT(org.x + info.xorg + x, org.y + yoffset);
DRAW_POINT(org.x + info.xorgo - x, org.y + yoffset);
DRAW_POINT(orgo.x + info.xorgo - x, orgo.y - yoffset);
DRAW_POINT(orgo.x + info.xorg + x, orgo.y - yoffset);
MIARCSTEP(yoffset += dyoffset;, yoffset++;);
}
}
else {
while (y < info.h || x < info.w) {
MIARCOCTANTSHIFT(dyoffset = 1;);
if ((x == info.start.x) || (y == info.start.y)) {
mask = info.start.mask;
info.start = info.altstart;
}
WAITFIFO(8);
if (mask & 1)
DRAW_POINT(org.x + info.xorg + x, org.y + yoffset);
if (mask & 2)
DRAW_POINT(org.x + info.xorgo - x, org.y + yoffset);
if (mask & 4)
DRAW_POINT(orgo.x + info.xorgo - x, orgo.y - yoffset);
if (mask & 8)
DRAW_POINT(orgo.x + info.xorg + x, orgo.y - yoffset);
if ((x == info.end.x) || (y == info.end.y)) {
mask = info.end.mask;
info.end = info.altend;
}
MIARCSTEP(yoffset += dyoffset;, yoffset++;);
}
}
if ((x == info.start.x) || (y == info.start.y))
mask = info.start.mask;
WAITFIFO(4);
if (mask & 1)
DRAW_POINT(org.x + info.xorg + x, org.y + yoffset);
if (mask & 4)
DRAW_POINT(orgo.x + info.xorgo - x, orgo.y - yoffset);
if (arc->height & 1) {
WAITFIFO(4);
if (mask & 2)
DRAW_POINT(org.x + info.xorgo - x, org.y + yoffset);
if (mask & 8)
DRAW_POINT(orgo.x + info.xorg + x, orgo.y - yoffset);
}
SET_SYNC_FLAG(infoRec);
}
void
MGAPolyArcThinSolid (
DrawablePtr pDraw,
GCPtr pGC,
int narcs,
xArc *parcs
){
xArc *arc;
BoxRec box;
int i, x2, y2;
RegionPtr cclip;
cclip = pGC->pCompositeClip;
if(!REGION_NUM_RECTS(cclip))
return;
for (arc = parcs, i = narcs; --i >= 0; arc++) {
if (miCanZeroArc(arc)) {
box.x1 = arc->x + pDraw->x;
box.y1 = arc->y + pDraw->y;
x2 = box.x1 + (int)arc->width + 1;
box.x2 = x2;
y2 = box.y1 + (int)arc->height + 1;
box.y2 = y2;
if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) &&
(RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
MGAZeroArc (pDraw, pGC, arc);
else
miZeroPolyArc(pDraw, pGC, 1, arc);
}
else
miPolyArc(pDraw, pGC, 1, arc);
}
}
#endif /* USE_XAA */

View File

@@ -15,12 +15,6 @@ static Bool MGA_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **,
static Bool MGA_SetMode(ScrnInfoPtr, DGAModePtr);
static int MGA_GetViewport(ScrnInfoPtr);
static void MGA_SetViewport(ScrnInfoPtr, int, int, int);
#ifdef USE_XAA
static void MGA_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
static void MGA_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
static void MGA_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int,
unsigned long);
#endif
static
DGAFunctionRec MGA_DGAFuncs = {
@@ -30,13 +24,7 @@ DGAFunctionRec MGA_DGAFuncs = {
MGA_SetViewport,
MGA_GetViewport,
MGAStormSync,
#ifdef USE_XAA
MGA_FillRect,
MGA_BlitRect,
MGA_BlitTransRect
#else
NULL, NULL, NULL
#endif
};
@@ -124,13 +112,6 @@ SECOND_PASS:
mode->flags = DGA_CONCURRENT_ACCESS;
if(pixmap)
mode->flags |= DGA_PIXMAP_AVAILABLE;
#ifdef USE_XAA
if(!pMga->NoAccel) {
mode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT;
if((Bpp != 3) && (pMga->Chipset != PCI_CHIP_MGA2064))
mode->flags |= DGA_BLIT_RECT_TRANS;
}
#endif
if(pMode->Flags & V_DBLSCAN)
mode->flags |= DGA_DOUBLESCAN;
if(pMode->Flags & V_INTERLACE)
@@ -365,74 +346,6 @@ MGA_SetViewport(
pMga->DGAViewportStatus = 0; /* MGAAdjustFrame loops until finished */
}
#ifdef USE_XAA
static void
MGA_FillRect (
ScrnInfoPtr pScrn,
int x, int y, int w, int h,
unsigned long color
){
MGAPtr pMga = MGAPTR(pScrn);
if(!pMga->AccelInfoRec) return;
mgaDoSetupForSolidFill(pScrn, color, GXcopy, ~0,
pMga->CurrentLayout.bitsPerPixel);
(*pMga->AccelInfoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
SET_SYNC_FLAG(pMga->AccelInfoRec);
}
static void
MGA_BlitRect(
ScrnInfoPtr pScrn,
int srcx, int srcy,
int w, int h,
int dstx, int dsty
){
MGAPtr pMga = MGAPTR(pScrn);
int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
int ydir = (srcy < dsty) ? -1 : 1;
if(!pMga->AccelInfoRec) return;
mgaDoSetupForScreenToScreenCopy( pScrn, xdir, ydir, GXcopy, ~0, -1,
pMga->CurrentLayout.bitsPerPixel );
(*pMga->AccelInfoRec->SubsequentScreenToScreenCopy)(
pScrn, srcx, srcy, dstx, dsty, w, h);
SET_SYNC_FLAG(pMga->AccelInfoRec);
}
static void MGA_BlitTransRect( ScrnInfoPtr pScrn, int srcx, int srcy,
int w, int h, int dstx, int dsty,
unsigned long color )
{
MGAPtr pMga = MGAPTR(pScrn);
if( (pMga->AccelInfoRec != NULL)
&& (pMga->CurrentLayout.bitsPerPixel != 24)
&& (pMga->Chipset != PCI_CHIP_MGA2064) ) {
const int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1;
const int ydir = (srcy < dsty) ? -1 : 1;
pMga->DrawTransparent = TRUE;
mgaDoSetupForScreenToScreenCopy( pScrn, xdir, ydir, GXcopy, ~0, color,
pMga->CurrentLayout.bitsPerPixel );
pMga->DrawTransparent = FALSE;
(*pMga->AccelInfoRec->SubsequentScreenToScreenCopy)(
pScrn, srcx, srcy, dstx, dsty, w, h);
SET_SYNC_FLAG(pMga->AccelInfoRec);
}
}
#endif
static Bool
MGA_OpenFramebuffer(
ScrnInfoPtr pScrn,

View File

@@ -121,9 +121,6 @@ static void MGAWaitForIdleDMA( ScrnInfoPtr pScrn )
void MGAGetQuiescence( ScrnInfoPtr pScrn )
{
MGAPtr pMga = MGAPTR(pScrn);
#ifdef USE_XAA
MGAFBLayout *pLayout = &pMga->CurrentLayout;
#endif /* USE_XAA */
pMga->haveQuiescense = 1;
@@ -131,31 +128,6 @@ void MGAGetQuiescence( ScrnInfoPtr pScrn )
MGAWaitForIdleDMA( pScrn );
/* FIXME what about EXA? */
#ifdef USE_XAA
if (!pMga->Exa && pMga->AccelInfoRec) {
WAITFIFO( 11 );
OUTREG( MGAREG_MACCESS, pMga->MAccess );
OUTREG( MGAREG_PITCH, pLayout->displayWidth );
pMga->PlaneMask = ~0;
OUTREG( MGAREG_PLNWT, pMga->PlaneMask );
pMga->BgColor = 0;
pMga->FgColor = 0;
OUTREG( MGAREG_BCOL, pMga->BgColor );
OUTREG( MGAREG_FCOL, pMga->FgColor );
OUTREG( MGAREG_SRCORG, pMga->realSrcOrg );
pMga->SrcOrg = 0;
OUTREG( MGAREG_DSTORG, pMga->DstOrg );
OUTREG( MGAREG_OPMODE, MGAOPM_DMA_BLIT );
OUTREG( MGAREG_CXBNDRY, 0xFFFF0000 ); /* (maxX << 16) | minX */
OUTREG( MGAREG_YTOP, 0x00000000 ); /* minPixelPointer */
OUTREG( MGAREG_YBOT, 0x007FFFFF ); /* maxPixelPointer */
pMga->AccelFlags &= ~CLIPPER_ON;
}
#endif
}
}
@@ -173,10 +145,6 @@ void MGAGetQuiescenceShared( ScrnInfoPtr pScrn )
MGAWaitForIdleDMA( pMGAEnt->pScrn_1 );
/* FIXME what about EXA? */
#ifdef USE_XAA
if (!pMga->Exa && pMga->AccelInfoRec)
pMga->RestoreAccelState( pScrn );
#endif
xf86SetLastScrnFlag( pScrn->entityList[0], pScrn->scrnIndex );
}
}
@@ -667,191 +635,12 @@ static Bool MGADRIBuffersInit( ScreenPtr pScreen )
return TRUE;
}
#ifdef USE_XAA
static void MGADRIInitBuffersXAA(WindowPtr pWin, RegionPtr prgn,
CARD32 index)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
MGAPtr pMga = MGAPTR(pScrn);
BoxPtr pbox = REGION_RECTS(prgn);
int nbox = REGION_NUM_RECTS(prgn);
XAAInfoRecPtr xaa = pMga->AccelInfoRec;
CHECK_DMA_QUIESCENT(MGAPTR(pScrn), pScrn);
xaa->SetupForSolidFill(pScrn, 0, GXcopy, -1);
while (nbox--) {
MGASelectBuffer(pScrn, MGA_BACK);
xaa->SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
pbox->x2-pbox->x1, pbox->y2-pbox->y1);
MGASelectBuffer(pScrn, MGA_DEPTH);
xaa->SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
pbox->x2-pbox->x1, pbox->y2-pbox->y1);
pbox++;
}
MGASelectBuffer(pScrn, MGA_FRONT);
pMga->AccelInfoRec->NeedToSync = TRUE;
}
#endif
static void MGADRIInitBuffersEXA(WindowPtr pWin, RegionPtr prgn,
CARD32 index)
{
/* FIXME */
}
#ifdef USE_XAA
/*
This routine is a modified form of XAADoBitBlt with the calls to
ScreenToScreenBitBlt built in. My routine has the prgnSrc as source
instead of destination. My origin is upside down so the ydir cases
are reversed.
*/
static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index)
{
ScreenPtr pScreen = pParent->drawable.pScreen;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
MGAPtr pMga = MGAPTR(pScrn);
int nbox;
BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
DDXPointPtr pptTmp, pptNew1, pptNew2;
int xdir, ydir;
int dx, dy;
DDXPointPtr pptSrc;
int screenwidth = pScrn->virtualX;
int screenheight = pScrn->virtualY;
XAAInfoRecPtr xaa = pMga->AccelInfoRec;
CHECK_DMA_QUIESCENT(pMga, pScrn);
pbox = REGION_RECTS(prgnSrc);
nbox = REGION_NUM_RECTS(prgnSrc);
pboxNew1 = 0;
pptNew1 = 0;
pboxNew2 = 0;
pptNew2 = 0;
pptSrc = &ptOldOrg;
dx = pParent->drawable.x - ptOldOrg.x;
dy = pParent->drawable.y - ptOldOrg.y;
/* If the copy will overlap in Y, reverse the order */
if (dy>0) {
ydir = -1;
if (nbox>1) {
/* Keep ordering in each band, reverse order of bands */
pboxNew1 = (BoxPtr)malloc(sizeof(BoxRec)*nbox);
if (!pboxNew1) return;
pptNew1 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox);
if (!pptNew1) {
free(pboxNew1);
return;
}
pboxBase = pboxNext = pbox+nbox-1;
while (pboxBase >= pbox) {
while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
pboxNext--;
pboxTmp = pboxNext+1;
pptTmp = pptSrc + (pboxTmp - pbox);
while (pboxTmp <= pboxBase) {
*pboxNew1++ = *pboxTmp++;
*pptNew1++ = *pptTmp++;
}
pboxBase = pboxNext;
}
pboxNew1 -= nbox;
pbox = pboxNew1;
pptNew1 -= nbox;
pptSrc = pptNew1;
}
} else {
/* No changes required */
ydir = 1;
}
/* If the regions will overlap in X, reverse the order */
if (dx>0) {
xdir = -1;
if (nbox > 1) {
/*reverse orderof rects in each band */
pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec)*nbox);
pptNew2 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox);
if (!pboxNew2 || !pptNew2) {
free(pptNew2);
free(pboxNew2);
if (pboxNew1) {
free(pptNew1);
free(pboxNew1);
}
return;
}
pboxBase = pboxNext = pbox;
while (pboxBase < pbox+nbox) {
while ((pboxNext < pbox+nbox) &&
(pboxNext->y1 == pboxBase->y1))
pboxNext++;
pboxTmp = pboxNext;
pptTmp = pptSrc + (pboxTmp - pbox);
while (pboxTmp != pboxBase) {
*pboxNew2++ = *--pboxTmp;
*pptNew2++ = *--pptTmp;
}
pboxBase = pboxNext;
}
pboxNew2 -= nbox;
pbox = pboxNew2;
pptNew2 -= nbox;
pptSrc = pptNew2;
}
} else {
/* No changes are needed */
xdir = 1;
}
xaa->SetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1);
for ( ; nbox-- ; pbox++) {
int x1 = pbox->x1;
int y1 = pbox->y1;
int destx = x1 + dx;
int desty = y1 + dy;
int w = pbox->x2 - x1 + 1;
int h = pbox->y2 - y1 + 1;
if ( destx < 0 ) x1 -= destx, w += destx, destx = 0;
if ( desty < 0 ) y1 -= desty, h += desty, desty = 0;
if ( destx + w > screenwidth ) w = screenwidth - destx;
if ( desty + h > screenheight ) h = screenheight - desty;
if ( w <= 0 ) continue;
if ( h <= 0 ) continue;
MGASelectBuffer(pScrn, MGA_BACK);
xaa->SubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h);
MGASelectBuffer(pScrn, MGA_DEPTH);
xaa->SubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h);
}
MGASelectBuffer(pScrn, MGA_FRONT);
if (pboxNew2) {
free(pptNew2);
free(pboxNew2);
}
if (pboxNew1) {
free(pptNew1);
free(pboxNew1);
}
pMga->AccelInfoRec->NeedToSync = TRUE;
}
#endif
static void MGADRIMoveBuffersEXA(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index)
{
@@ -1001,19 +790,6 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
pDRIInfo->InitBuffers = MGADRIInitBuffersEXA;
pDRIInfo->MoveBuffers = MGADRIMoveBuffersEXA;
#ifdef USE_EXA
if (pMga->Exa) {
pDRIInfo->InitBuffers = MGADRIInitBuffersEXA;
pDRIInfo->MoveBuffers = MGADRIMoveBuffersEXA;
} else {
#endif
#ifdef USE_XAA
pDRIInfo->InitBuffers = MGADRIInitBuffersXAA;
pDRIInfo->MoveBuffers = MGADRIMoveBuffersXAA;
#endif
#ifdef USE_EXA
}
#endif
pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;

View File

@@ -56,11 +56,6 @@
#include "xf86Modes.h"
#endif
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#include "xf86Resources.h"
#include "xf86RAC.h"
#endif
/* All drivers need this */
#include "compiler.h"
@@ -87,10 +82,6 @@
#include "mga_macros.h"
#include "mga_maven.h"
#ifdef USE_XAA
#include "xaa.h"
#endif
#include "xf86cmap.h"
#include "shadowfb.h"
#include "fbdevhw.h"
@@ -1969,16 +1960,14 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pMga->NoAccel = FALSE;
pMga->Exa = FALSE;
#ifdef USE_EXA
#ifndef USE_XAA
pMga->Exa = TRUE;
#endif
if (!xf86NameCmp(s, "EXA")) {
pMga->Exa = TRUE;
from = X_CONFIG;
}
#endif
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s acceleration\n",
pMga->Exa ? "EXA" : "XAA");
pMga->Exa ? "EXA" : "no");
}
if (xf86ReturnOptValBool(pMga->Options, OPTION_PCI_RETRY, FALSE)) {
pMga->UsePCIRetry = TRUE;
@@ -2069,7 +2058,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
}
/* Load XAA if needed */
/* Load EXA if needed */
if (!pMga->NoAccel) {
#ifdef USE_EXA
if (pMga->Exa) {
@@ -2081,14 +2070,10 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
}
} else {
#endif
#ifdef USE_XAA
if (!xf86LoadSubModule(pScrn, "xaa")) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Falling back to shadowfb\n");
pMga->ShadowFB = TRUE;
pMga->NoAccel = TRUE;
}
#endif
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Falling back to shadowfb\n");
pMga->ShadowFB = TRUE;
pMga->NoAccel = TRUE;
#ifdef USE_EXA
}
#endif
@@ -3148,13 +3133,6 @@ MGACrtc2FillStrip(ScrnInfoPtr pScrn)
(pScrn->bitsPerPixel >> 3) * pScrn->displayWidth * pScrn->virtualY);
} else {
xf86SetLastScrnFlag(pScrn->entityList[0], pScrn->scrnIndex);
#ifdef USE_XAA
pMga->RestoreAccelState(pScrn);
pMga->SetupForSolidFill(pScrn, 0, GXcopy, 0xFFFFFFFF);
pMga->SubsequentSolidFillRect(pScrn, pScrn->virtualX, 0,
pScrn->displayWidth - pScrn->virtualX,
pScrn->virtualY);
#endif
MGAStormSync(pScrn);
}
}
@@ -3800,10 +3778,6 @@ MGACloseScreen(CLOSE_SCREEN_ARGS_DECL)
pMgaEnt->refCount--;
}
#ifdef USE_XAA
if (pMga->AccelInfoRec)
XAADestroyInfoRec(pMga->AccelInfoRec);
#endif
#ifdef USE_EXA
if (pMga->ExaDriver) {
exaDriverFini(pScreen);

File diff suppressed because it is too large Load Diff

View File

@@ -15,11 +15,6 @@
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
#ifdef USE_XAA
#include "xaa.h"
#include "xaalocal.h"
#endif
#include "dixstruct.h"
#include "fourcc.h"
@@ -565,15 +560,11 @@ MGAAllocateMemory(
void **mem_struct,
int size
){
#if defined(USE_XAA) || defined(USE_EXA)
MGAPtr pMga = MGAPTR(pScrn);
#endif /* defined(USE_XAA) || defined(USE_EXA) */
#ifdef USE_XAA
ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
#endif /* USE_XAA */
int offset = 0;
#ifdef USE_EXA
MGAPtr pMga = MGAPTR(pScrn);
if (pMga->Exa) {
ExaOffscreenArea *area = *mem_struct;
@@ -594,53 +585,6 @@ MGAAllocateMemory(
offset = area->offset;
}
#endif /* USE_EXA */
#ifdef USE_XAA
FBLinearPtr linear = *mem_struct;
int cpp = pMga->CurrentLayout.bitsPerPixel / 8;
/* XAA allocates in units of pixels at the screen bpp, so adjust size
* appropriately.
*/
size = (size + cpp - 1) / cpp;
if (!pMga->Exa) {
if (linear) {
if (linear->size >= size)
return linear->offset * cpp;
if (xf86ResizeOffscreenLinear(linear, size))
return linear->offset * cpp;
xf86FreeOffscreenLinear(linear);
}
linear = xf86AllocateOffscreenLinear(pScreen, size, 16,
NULL, NULL, NULL);
*mem_struct = linear;
if (!linear) {
int max_size;
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16,
PRIORITY_EXTREME);
if (max_size < size)
return 0;
xf86PurgeUnlockedOffscreenAreas(pScreen);
linear = xf86AllocateOffscreenLinear(pScreen, size, 16,
NULL, NULL, NULL);
*mem_struct = linear;
if (!linear)
return 0;
}
offset = linear->offset * cpp;
}
#endif /* USE_XAA */
return offset;
}
@@ -648,11 +592,9 @@ MGAAllocateMemory(
static void
MGAFreeMemory(ScrnInfoPtr pScrn, void *mem_struct)
{
#if defined(USE_XAA) || defined(USE_EXA)
MGAPtr pMga = MGAPTR(pScrn);
#endif /* defined(USE_XAA) || defined(USE_EXA) */
#ifdef USE_EXA
MGAPtr pMga = MGAPTR(pScrn);
if (pMga->Exa) {
ExaOffscreenArea *area = mem_struct;
@@ -660,14 +602,6 @@ MGAFreeMemory(ScrnInfoPtr pScrn, void *mem_struct)
exaOffscreenFree(pScrn->pScreen, area);
}
#endif /* USE_EXA */
#ifdef USE_XAA
if (!pMga->Exa) {
FBLinearPtr linear = mem_struct;
if (linear)
xf86FreeOffscreenLinear(linear);
}
#endif /* USE_XAA */
}
static void
@@ -2005,12 +1939,6 @@ MGAPutImageILOAD(
clipBoxes, width, height))
return Success;
#ifdef USE_XAA
if( pMga->AccelInfoRec->NeedToSync && ((long)data != pPriv->lastPort) ) {
MGAStormSync(pScrn);
}
#endif
pPriv->lastPort = (long)data;
nbox=REGION_NUM_RECTS(clipBoxes);
pbox=REGION_RECTS(clipBoxes);
@@ -2039,9 +1967,6 @@ MGAPutImageILOAD(
pbox++;
}
#ifdef USE_XAA
pMga->AccelInfoRec->NeedToSync = TRUE;
#endif
pPriv->videoStatus = FREE_TIMER;
pPriv->freeTime = currentTime.milliseconds + FREE_DELAY;
pMga->VideoTimerCallback = MGAVideoTimerCallback;