drop obsolete XAA

Since recent commits require xserver-1.18.0 or later to build against,
there's no reason leaving behind big chunks of code that can only build
against the XAA support removed in xserver-1.13.0 (released in 2012).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis/-/merge_requests/26>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-05-24 21:07:15 +02:00
committed by Alan Coopersmith
parent b144cedfe1
commit ee451146c0
11 changed files with 1 additions and 2870 deletions

16
README
View File

@@ -43,7 +43,7 @@
o Hardware cursor; 315/330/340 series: Color HW cursor o Hardware cursor; 315/330/340 series: Color HW cursor
o XAA; EXA; XVideo (Xv); RENDER and other extensions o EXA; XVideo (Xv); RENDER and other extensions
o 6326: TV output o 6326: TV output
@@ -89,12 +89,6 @@
Disables 2D acceleration. By default, 2D acceleration is Disables 2D acceleration. By default, 2D acceleration is
enabled. enabled.
Option "AccelMethod" [string]
Determines which acceleration architecture should be used.
Possible arguments are "XAA" or "EXA". As of this writing, EXA
is still experimental and it is not recommended to be used on
production machines. By default, XAA will be used.
Option "Rotate" [string] Option "Rotate" [string]
This option enables clockwise ("CW") or counter-clockwise This option enables clockwise ("CW") or counter-clockwise
("CCW") rotation of the display. Enabling either CW or CCW ("CCW") rotation of the display. Enabling either CW or CCW
@@ -287,14 +281,6 @@
2.5. 315/330/340 series specific options 2.5. 315/330/340 series specific options
Option "RenderAcceleration" [boolean]
Enables or disables RENDER acceleration. This feature, for
instance, accelerates output of anti-aliased text. By default,
RENDER acceleration is enabled. RENDER acceleration is currently
only supported for XAA, not EXA.
Option "XvOnCRT2" [boolean] Option "XvOnCRT2" [boolean]
(For 315, 650, 740, 330, 340 and XGI chips only) This option (For 315, 650, 740, 330, 340 and XGI chips only) This option
selects whether the XVideo (Xv) overlay should be displayed on selects whether the XVideo (Xv) overlay should be displayed on

View File

@@ -107,24 +107,6 @@ if test "$DRI" = yes; then
AC_DEFINE(SISDRI_DEVEL,1,[Enable developmental DRI driver support]) AC_DEFINE(SISDRI_DEVEL,1,[Enable developmental DRI driver support])
fi fi
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])
# technically this should be a configure flag. meh. # technically this should be a configure flag. meh.
AC_DEFINE(USE_EXA, 1, [Build support for EXA]) AC_DEFINE(USE_EXA, 1, [Build support for EXA])

View File

@@ -147,23 +147,12 @@
#define SIS_XINERAMA_MINOR_VERSION 1 #define SIS_XINERAMA_MINOR_VERSION 1
#endif #endif
#ifdef HAVE_XAA_H
#define SIS_USE_XAA /* Include code for XAA */
#endif
#if defined(SIS_HAVE_EXA) || (defined(USE_EXA) && (USE_EXA != 0)) #if defined(SIS_HAVE_EXA) || (defined(USE_EXA) && (USE_EXA != 0))
#define SIS_USE_EXA /* Include code for EXA */ #define SIS_USE_EXA /* Include code for EXA */
#endif #endif
/* End of configurable stuff --------------------------------- */ /* End of configurable stuff --------------------------------- */
#if !defined(SIS_USE_XAA) && !defined(SIS_USE_EXA)
#define SIS_USE_XAA
#endif
#ifdef SIS_USE_XAA
#include "xaa.h"
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
#include "exa.h" #include "exa.h"
#endif #endif
@@ -932,16 +921,6 @@ typedef struct {
Bool ClipEnabled; Bool ClipEnabled;
int Xdirection; /* for temp use in accel */ int Xdirection; /* for temp use in accel */
int Ydirection; /* for temp use in accel */ int Ydirection; /* for temp use in accel */
#ifdef SIS_USE_XAA
XAAInfoRecPtr AccelInfoPtr;
UChar *XAAScanlineColorExpandBuffers[2];
Bool DoColorExpand;
Bool ColorExpandBusy;
int xcurrent; /* for temp use in accel */
int ycurrent; /* for temp use in accel */
int sisPatternReg[4];
int ROPReg;
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
ExaDriverPtr EXADriverPtr; ExaDriverPtr EXADriverPtr;
int fillPitch, fillBpp; int fillPitch, fillBpp;
@@ -998,11 +977,6 @@ typedef struct {
unsigned int DRIheapstart, DRIheapend; unsigned int DRIheapstart, DRIheapend;
Bool NeedFlush; /* Need to flush cmd buf mem (760) */ Bool NeedFlush; /* Need to flush cmd buf mem (760) */
#ifdef SIS_USE_XAA
void (*RenderCallback)(ScrnInfoPtr);
Time RenderTime;
FBLinearPtr AccelLinearScratch;
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
void (*ExaRenderCallback)(ScrnInfoPtr); void (*ExaRenderCallback)(ScrnInfoPtr);
Time ExaRenderTime; Time ExaRenderTime;

View File

@@ -46,17 +46,6 @@
/* This is the offset to the memory for each head */ /* This is the offset to the memory for each head */
#define HEADOFFSET (pSiS->dhmOffset) #define HEADOFFSET (pSiS->dhmOffset)
#ifdef SIS_USE_XAA
#undef STSCE /* Use/Don't use ScreenToScreenColorExpand - does not work */
#undef TRAP /* Use/Don't use Trapezoid Fills - does not work - XAA provides
* illegal trapezoid data (left and right edges cross each other
* sometimes) which causes drawing errors. Further, I have not found
* out how to draw polygones with a height greater than 127...
*/
#endif /* XAA */
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
extern void SiSScratchSave(ScreenPtr pScreen, ExaOffscreenArea *area); extern void SiSScratchSave(ScreenPtr pScreen, ExaOffscreenArea *area);
extern Bool SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst); extern Bool SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst);
@@ -68,11 +57,6 @@ extern UChar SiSGetPatternROP(int rop);
static void static void
SiSInitializeAccelerator(ScrnInfoPtr pScrn) SiSInitializeAccelerator(ScrnInfoPtr pScrn)
{ {
#ifdef SIS_USE_XAA
SISPtr pSiS = SISPTR(pScrn);
pSiS->DoColorExpand = FALSE;
#endif
} }
static void static void
@@ -205,675 +189,6 @@ SiSSubsequentSolidFillRect(ScrnInfoPtr pScrn,
SiSDoCMD SiSDoCMD
} }
#ifdef SIS_USE_XAA /* ---------------------------- XAA -------------------------- */
#ifdef SISDUALHEAD
static void
SiSRestoreAccelState(ScrnInfoPtr pScrn)
{
SISPtr pSiS = SISPTR(pScrn);
/* We don't need to do anything special here; forcing the
* other head to re-read the CmdQueLen is not necessary:
* After the Sync in RestoreAccelState(), the real queue
* length is always larger than (or at least equal to)
* the amount stored in CmdQueueLen of the other head,
* so the only thing that might happen is one unnecessary
* Sync on the other head. I think we can live with that.
*/
pSiS->DoColorExpand = FALSE;
SiSIdle
}
#endif
/* Trapezoid */
/* This would work better if XAA would provide us with valid trapezoids.
* In fact, with small trapezoids the left and the right edge often cross
* each other or result in a line length of 0 which causes drawing errors
* (filling over whole scanline).
* Furthermore, I have not found out how to draw trapezoids with a height
* greater than 127.
*/
#ifdef TRAP
static void
SiSSubsequentSolidFillTrap(ScrnInfoPtr pScrn, int y, int h,
int left, int dxL, int dyL, int eL,
int right, int dxR, int dyR, int eR )
{
SISPtr pSiS = SISPTR(pScrn);
CARD32 dstbase;
#if 0
float kL, kR;
#endif
dstbase = 0;
if(y >= 2048) {
dstbase=pSiS->scrnOffset*y;
y = 0;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
dstbase += HEADOFFSET;
}
#endif
SiSSetupDSTBase(dstbase)
/* SiSSetupRect(w,h) */
#if 1
SiSSetupPATFG(0xff0000) /* FOR TESTING */
#endif
/* Clear CommandReg because SetUp can be used for Rect and Trap */
pSiS->CommandReg &= ~(T_L_X_INC | T_L_Y_INC |
T_R_X_INC | T_R_Y_INC |
T_XISMAJORL | T_XISMAJORR |
BITBLT);
xf86DrvMsg(0, X_INFO, "Trap (%d %d %d %d) dxL %d dyL %d eL %d dxR %d dyR %d eR %d\n",
left, right, y, h, dxL, dyL, eL, dxR, dyR, eR);
/* Unfortunately, we must check if the right and the left edge
* cross each other... INCOMPLETE (line equation wrong)
*/
#if 0
if (dxL == 0) kL = 0;
else kL = (float)dyL / (float)dxL;
if (dxR == 0) kR = 0;
else kR = (float)dyR / (float)dxR;
xf86DrvMsg(0, X_INFO, "kL %f kR %f!\n", kL, kR);
if ( (kR != kL) &&
(!(kR == 0 && kL == 0)) &&
(!(kR < 0 && kL > 0)) ) {
xf86DrvMsg(0, X_INFO, "Inside if (%f - %d)\n", ( kL * ( ( ((float)right - (float)left) / (kL - kR) ) - left) + y), h+y);
if ( ( ( kL * ( ( ((float)right - (float)left) / (kL - kR) ) - (float)left) + (float)y) < (h + y) ) ) {
xf86DrvMsg(0, X_INFO, "Cross detected!\n");
}
}
#endif
/* Determine edge angles */
if(dxL < 0) { dxL = -dxL; }
else { SiSSetupCMDFlag(T_L_X_INC) }
if(dxR < 0) { dxR = -dxR; }
else { SiSSetupCMDFlag(T_R_X_INC) }
/* (Y direction always positive - do this anyway) */
if(dyL < 0) { dyL = -dyL; }
else { SiSSetupCMDFlag(T_L_Y_INC) }
if(dyR < 0) { dyR = -dyR; }
else { SiSSetupCMDFlag(T_R_Y_INC) }
/* Determine major axis */
if(dxL >= dyL) { /* X is major axis */
SiSSetupCMDFlag(T_XISMAJORL)
}
if(dxR >= dyR) { /* X is major axis */
SiSSetupCMDFlag(T_XISMAJORR)
}
/* Set up deltas */
SiSSetupdL(dxL, dyL)
SiSSetupdR(dxR, dyR)
#if 0 /* Could it be that this crappy engine can only draw trapezoids up to 127 pixels high? */
h &= 0x7F;
if (h == 0) h = 10;
#endif
/* Set up y, h, left, right */
SiSSetupYH(y,h)
SiSSetupLR(left,right)
/* Set up initial error term */
SiSSetupEL(eL)
SiSSetupER(eR)
SiSSetupCMDFlag(TRAPAZOID_FILL);
SiSDoCMD
}
#endif
static void
SiSSetupForSolidLine(ScrnInfoPtr pScrn,
int color, int rop, unsigned int planemask)
{
SISPtr pSiS = SISPTR(pScrn);
SiSSetupLineCount(1)
SiSSetupPATFG(color)
SiSSetupDSTRect(pSiS->scrnOffset, -1)
SiSSetupDSTColorDepth(pSiS->DstColor);
SiSSetupROP(SiSGetPatternROP(rop))
SiSSetupCMDFlag(PATFG | LINE)
}
static void
SiSSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
int x1, int y1, int x2, int y2, int flags)
{
SISPtr pSiS = SISPTR(pScrn);
int miny, maxy;
CARD32 dstbase = 0;
miny = (y1 > y2) ? y2 : y1;
maxy = (y1 > y2) ? y1 : y2;
if(maxy >= 2048) {
dstbase = pSiS->scrnOffset * miny;
y1 -= miny;
y2 -= miny;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
dstbase += HEADOFFSET;
}
#endif
SiSSetupDSTBase(dstbase)
SiSSetupX0Y0(x1,y1)
SiSSetupX1Y1(x2,y2)
if(flags & OMIT_LAST) {
SiSSetupCMDFlag(NO_LAST_PIXEL)
} else {
pSiS->CommandReg &= ~(NO_LAST_PIXEL);
}
SiSDoCMD
}
static void
SiSSubsequentSolidHorzVertLine(ScrnInfoPtr pScrn,
int x, int y, int len, int dir)
{
SISPtr pSiS = SISPTR(pScrn);
CARD32 dstbase = 0;
len--; /* starting point is included! */
if((y >= 2048) || ((dir != DEGREES_0) && ((y + len) >= 2048))) {
dstbase = pSiS->scrnOffset * y;
y = 0;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
dstbase += HEADOFFSET;
}
#endif
SiSSetupDSTBase(dstbase)
SiSSetupX0Y0(x,y)
if(dir == DEGREES_0) {
SiSSetupX1Y1(x + len, y);
} else {
SiSSetupX1Y1(x, y + len);
}
SiSDoCMD
}
static void
SiSSetupForDashedLine(ScrnInfoPtr pScrn,
int fg, int bg, int rop, unsigned int planemask,
int length, UChar *pattern)
{
SISPtr pSiS = SISPTR(pScrn);
SiSSetupLineCount(1)
SiSSetupDSTRect(pSiS->scrnOffset, -1)
SiSSetupDSTColorDepth(pSiS->DstColor);
SiSSetupStyleLow(*pattern)
SiSSetupStyleHigh(*(pattern+4))
SiSSetupStylePeriod(length-1);
SiSSetupROP(SiSGetPatternROP(rop))
SiSSetupPATFG(fg)
SiSSetupCMDFlag(LINE | LINE_STYLE)
if(bg != -1) {
SiSSetupPATBG(bg)
} else {
SiSSetupCMDFlag(TRANSPARENT);
}
}
static void
SiSSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn,
int x1, int y1, int x2, int y2,
int flags, int phase)
{
SISPtr pSiS = SISPTR(pScrn);
int miny, maxy;
CARD32 dstbase = 0;
miny = (y1 > y2) ? y2 : y1;
maxy = (y1 > y2) ? y1 : y2;
if(maxy >= 2048) {
dstbase = pSiS->scrnOffset * miny;
y1 -= miny;
y2 -= miny;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
dstbase += HEADOFFSET;
}
#endif
SiSSetupDSTBase(dstbase)
SiSSetupX0Y0(x1,y1)
SiSSetupX1Y1(x2,y2)
if(flags & OMIT_LAST) {
SiSSetupCMDFlag(NO_LAST_PIXEL)
} else {
pSiS->CommandReg &= ~(NO_LAST_PIXEL);
}
SiSDoCMD
}
static void
SiSSetupForMonoPatternFill(ScrnInfoPtr pScrn,
int patx, int paty, int fg, int bg,
int rop, unsigned int planemask)
{
SISPtr pSiS = SISPTR(pScrn);
SiSSetupDSTRect(pSiS->scrnOffset, -1)
SiSSetupDSTColorDepth(pSiS->DstColor);
SiSSetupMONOPAT(patx,paty)
SiSSetupPATFG(fg)
SiSSetupROP(SiSGetPatternROP(rop))
SiSSetupCMDFlag(PATMONO)
if(bg != -1) {
SiSSetupPATBG(bg)
} else {
SiSSetupCMDFlag(TRANSPARENT)
}
}
static void
SiSSubsequentMonoPatternFill(ScrnInfoPtr pScrn,
int patx, int paty,
int x, int y, int w, int h)
{
SISPtr pSiS = SISPTR(pScrn);
CARD32 dstbase = 0;
if(y >= 2048) {
dstbase = pSiS->scrnOffset * y;
y = 0;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
dstbase += HEADOFFSET;
}
#endif
SiSSetupDSTBase(dstbase)
SiSSetupDSTXY(x, y)
SiSSetupRect(w, h)
/* Clear commandReg because Setup can be used for Rect and Trap */
pSiS->CommandReg &= ~(T_XISMAJORL | T_XISMAJORR |
T_L_X_INC | T_L_Y_INC |
T_R_X_INC | T_R_Y_INC |
TRAPAZOID_FILL);
SiSSetupCMDFlag(X_INC | Y_INC)
SiSDoCMD
}
/* Trapezoid */
#ifdef TRAP
static void
SiSSubsequentMonoPatternFillTrap(ScrnInfoPtr pScrn,
int patx, int paty,
int y, int h,
int left, int dxL, int dyL, int eL,
int right, int dxR, int dyR, int eR )
{
SISPtr pSiS = SISPTR(pScrn);
CARD32 dstbase = 0;
if(y >= 2048) {
dstbase = pSiS->scrnOffset * y;
y = 0;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
dstbase += HEADOFFSET;
}
#endif
SiSSetupDSTBase(dstbase)
/* Clear CommandReg because SetUp can be used for Rect and Trap */
pSiS->CommandReg &= ~(T_XISMAJORL | T_XISMAJORR |
T_L_X_INC | T_L_Y_INC |
T_R_X_INC | T_R_Y_INC |
BITBLT);
if(dxL < 0) { dxL = -dxL; }
else { SiSSetupCMDFlag(T_L_X_INC) }
if(dxR < 0) { dxR = -dxR; }
else { SiSSetupCMDFlag(T_R_X_INC) }
if(dyL < 0) { dyL = -dyL; }
else { SiSSetupCMDFlag(T_L_Y_INC) }
if(dyR < 0) { dyR = -dyR; }
else { SiSSetupCMDFlag(T_R_Y_INC) }
/* Determine major axis */
if(dxL >= dyL) { /* X is major axis */
SiSSetupCMDFlag(T_XISMAJORL)
}
if(dxR >= dyR) { /* X is major axis */
SiSSetupCMDFlag(T_XISMAJORR)
}
SiSSetupYH(y,h)
SiSSetupLR(left,right)
SiSSetupdL(dxL, dyL)
SiSSetupdR(dxR, dyR)
SiSSetupEL(eL)
SiSSetupER(eR)
SiSSetupCMDFlag(TRAPAZOID_FILL);
SiSDoCMD
}
#endif
/* ------ Screen To Screen Color Expand ------------------------------- */
/* The hareware does not seem to support this the way we need it */
#ifdef STSCE
static void
SiSSetupForScreenToScreenColorExpand(ScrnInfoPtr pScrn,
int fg, int bg,
int rop, unsigned int planemask)
{
SISPtr pSiS = SISPTR(pScrn);
SiSSetupDSTColorDepth(pSiS->DstColor)
SiSSetupDSTRect(pSiS->scrnOffset, -1)
SiSSetupROP(SiSGetCopyROP(rop))
SiSSetupSRCFG(fg)
/* SiSSetupSRCXY(0,0) */
if(bg == -1) {
SiSSetupCMDFlag(TRANSPARENT | ENCOLOREXP | X_INC |
Y_INC | SRCVIDEO);
} else {
SiSSetupSRCBG(bg);
SiSSetupCMDFlag(ENCOLOREXP | X_INC | Y_INC |
SRCVIDEO);
};
}
#endif
/* This method blits in a single task; this does not seem to work
* because the hardware does not use the source pitch as scanline
* offset but only to calculate pattern address from source X and Y.
* XAA provides the pattern bitmap with scrnOffset (displayWidth * bpp/8)
* offset, but this does not seem to be supported by the hardware.
*/
#ifdef STSCE
/* For testing, these are the methods: (use only one at a time!) */
#undef npitch /* Normal: Use srcx/y as srcx/y, use scrnOffset as source pitch
* This would work if the hareware used the source pitch for
* incrementing the source address after each scanline - but
* it doesn't do this! The first line of the area is correctly
* color expanded, but since the source pitch is ignored and
* the source address not incremented correctly, the following
* lines are color expanded with any bit pattern that is left
* in the unused space of the source bitmap (which is organized
* with the depth of the screen framebuffer hence with a pitch
* of scrnOffset).
*/
#undef pitchdw /* Use source pitch "displayWidth / 8" instead
* of scrnOffset (=displayWidth * bpp / 8)
* This can't work, because the pitch of the source
* bitmap is scrnoffset!
*/
#define nopitch /* Calculate srcbase with srcx and srcy, set the
* pitch to scrnOffset (which IS the correct pitch
* for the source bitmap) and set srcx and srcy both
* to 0.
* This would work if the hareware used the source pitch for
* incrementing the source address after each scanline - but
* it doesn't do this! Again: The first line of the area is
* correctly color expanded, but since the source pitch is
* ignored for scanline address incremention, the following
* lines are not correctly color expanded.
* WHATEVER I write to source pitch is ignored!
*/
static void
SiSSubsequentScreenToScreenColorExpand(ScrnInfoPtr pScrn,
int x, int y, int w, int h,
int srcx, int srcy, int skipleft)
{
SISPtr pSiS = SISPTR(pScrn);
CARD32 srcbase, dstbase;
#if 0
int _x0, _y0, _x1, _y1;
#endif
#ifdef pitchdw
int newsrcx, newsrcy;
/* srcx and srcy are provided based on a scrnOffset pitch ( = displayWidth * bpp / 8 )
* We recalculate srcx and srcy based on pitch = displayWidth / 8
*/
newsrcy = ((pSiS->scrnOffset * srcy) + (srcx * ((pScrn->bitsPerPixel+7)/8))) /
(pScrn->displayWidth/8);
newsrcx = ((pSiS->scrnOffset * srcy) + (srcx * ((pScrn->bitsPerPixel+7)/8))) %
(pScrn->displayWidth/8);
#endif
xf86DrvMsg(0, X_INFO, "Sub ScreenToScreen ColorExp(%d,%d, %d,%d, %d,%d, %d)\n",
x, y, w, h, srcx, srcy, skipleft);
srcbase = dstbase = 0;
#ifdef pitchdw
if(newsrcy >= 2048) {
srcbase = (pScrn->displayWidth / 8) * newsrcy;
newsrcy = 0;
}
#endif
#ifdef nopitch
srcbase = (pSiS->scrnOffset * srcy) + (srcx * ((pScrn->bitsPerPixel+7)/8));
#endif
#ifdef npitch
if(srcy >= 2048) {
srcbase = pSiS->scrnOffset * srcy;
srcy = 0;
}
#endif
if(y >= 2048) {
dstbase = pSiS->scrnOffset * y;
y = 0;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
srcbase += HEADOFFSET;
dstbase += HEADOFFSET;
}
#endif
SiSSetupSRCBase(srcbase)
SiSSetupDSTBase(dstbase)
#ifdef pitchdw
SiSSetupSRCPitch(pScrn->displayWidth/8)
#endif
#ifdef nopitch
SiSSetupSRCPitch(pSiS->scrnOffset)
/* SiSSetupSRCPitch(100) */ /* For test - has NO effect WHATSOEVER */
#endif
#ifdef npitch
SiSSetupSRCPitch(pSiS->scrnOffset)
#endif
SiSSetupRect(w,h)
#if 0 /* How do I implement the offset? Not this way, that's for sure.. */
if (skipleft > 0) {
_x0 = x+skipleft;
_y0 = y;
_x1 = x+w;
_y1 = y+h;
SiSSetupClipLT(_x0, _y0);
SiSSetupClipRB(_x1, _y1);
SiSSetupCMDFlag(CLIPENABLE);
}
#endif
#ifdef pitchdw
SiSSetupSRCXY(newsrcx, newsrcy)
#endif
#ifdef nopitch
SiSSetupSRCXY(0,0)
#endif
#ifdef npitch
SiSSetupSRCXY(srcx, srcy)
#endif
SiSSetupDSTXY(x,y)
SiSDoCMD
}
#endif
/* ----- CPU To Screen Color Expand (scanline-wise) ----------------- */
/* We do it using the indirect method */
static void
SiSSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
int fg, int bg, int rop, unsigned int planemask)
{
SISPtr pSiS=SISPTR(pScrn);
/* Make sure that current CPU-driven BitBlt buffer stage is 0
* This is required!!! (Otherwise -> drawing errors)
*/
while((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0x1F00) != 0) {} /* WDR: == 0x10 */
SiSSetupSRCXY(0,0);
SiSSetupROP(SiSGetCopyROP(rop));
SiSSetupSRCFG(fg);
SiSSetupDSTRect(pSiS->scrnOffset, -1);
SiSSetupDSTColorDepth(pSiS->DstColor);
if(bg == -1) {
SiSSetupCMDFlag(TRANSPARENT |
ENCOLOREXP |
X_INC | Y_INC |
SRCCPUBLITBUF);
} else {
SiSSetupSRCBG(bg);
SiSSetupCMDFlag(ENCOLOREXP |
X_INC | Y_INC |
SRCCPUBLITBUF);
}
}
static void
SiSSubsequentScanlineCPUToScreenColorExpandFill(
ScrnInfoPtr pScrn, int x, int y, int w,
int h, int skipleft)
{
SISPtr pSiS = SISPTR(pScrn);
int _x0, _y0, _x1, _y1;
CARD32 dstbase = 0;
if((y >= 2048) || ((y + h) >= 2048)) {
dstbase = pSiS->scrnOffset * y;
y = 0;
}
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
dstbase += HEADOFFSET;
}
#endif
/* Wait until there is no color expansion command in queue
* (This solves the OpenOffice.org window-move bug)
* Added Idle-check - bit 23 is set sometimes, although
* engine is actually idle!
* Update: Bit 23 is not reliable. After heavy 3D engine
* action, this bit never gets cleared again. So do
* SiSIdle instead.
*/
if((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0xe000) != 0xe000) {
/* while ((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0x0080) != 0) {} */
SiSIdle
}
SiSSetupDSTBase(dstbase)
if(skipleft > 0) {
_x0 = x + skipleft;
_y0 = y;
_x1 = x + w;
_y1 = y + h;
SiSSetupClipLT(_x0, _y0);
SiSSetupClipRB(_x1, _y1);
SiSSetupCMDFlag(CLIPENABLE);
} else {
pSiS->CommandReg &= (~CLIPENABLE);
}
SiSSetupRect(w, 1);
SiSSetupSRCPitch(((((w + 7) / 8) + 3) >> 2) * 4);
pSiS->xcurrent = x;
pSiS->ycurrent = y;
}
static void
SiSSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
{
SISPtr pSiS=SISPTR(pScrn);
#if 0
int newhead,bltbufstage,newtail;
#endif
CARD32 cbo;
cbo = pSiS->ColorExpandBufferScreenOffset[bufno];
#ifdef SISDUALHEAD
if(pSiS->VGAEngine != SIS_530_VGA) {
cbo += HEADOFFSET;
}
#endif
/* Wait until there is no color expansion command in queue
* (This solves the GTK-big-font bug)
* Added Idle-check - bit 23 is set sometimes, although
* engine is actually idle!
* Update: Bit 23 is not reliable. After heavy 3D engine
* action, this bit never gets cleared again. So do
* SiSIdle instead.
*/
if((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0xe000) != 0xe000) {
/* while ((SIS_MMIO_IN16(pSiS->IOBase, 0x8242) & 0x0080) != 0) {} */
SiSIdle
}
SiSSetupSRCBase(cbo);
SiSSetupDSTXY(pSiS->xcurrent, pSiS->ycurrent);
SiSDoCMD
pSiS->ycurrent++;
if(pSiS->VGAEngine == SIS_530_VGA) {
while(SIS_MMIO_IN8(pSiS->IOBase, 0x8242) & 0x80) {}
}
}
#endif /* XAA */
#ifdef SIS_USE_EXA /* ---------------------------- EXA -------------------------- */ #ifdef SIS_USE_EXA /* ---------------------------- EXA -------------------------- */
static const unsigned short dstcol[] = { 0x0000, 0x8000, 0xc000 }; static const unsigned short dstcol[] = { 0x0000, 0x8000, 0xc000 };
@@ -1063,19 +378,10 @@ SiS300AccelInit(ScreenPtr pScreen)
{ {
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
SISPtr pSiS = SISPTR(pScrn); SISPtr pSiS = SISPTR(pScrn);
#ifdef SIS_USE_XAA
XAAInfoRecPtr infoPtr = NULL;
UChar *AvailBufBase;
int topFB, reservedFbSize, usableFbSize, i;
BoxRec Avail;
#endif /* XAA */
pSiS->ColorExpandBufferNumber = 0; pSiS->ColorExpandBufferNumber = 0;
pSiS->PerColorExpandBufferSize = 0; pSiS->PerColorExpandBufferSize = 0;
pSiS->RenderAccelArray = NULL; pSiS->RenderAccelArray = NULL;
#ifdef SIS_USE_XAA
pSiS->AccelInfoPtr = NULL;
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
pSiS->EXADriverPtr = NULL; pSiS->EXADriverPtr = NULL;
pSiS->exa_scratch = NULL; pSiS->exa_scratch = NULL;
@@ -1088,12 +394,6 @@ SiS300AccelInit(ScreenPtr pScreen)
} }
if(!pSiS->NoAccel) { if(!pSiS->NoAccel) {
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
pSiS->AccelInfoPtr = infoPtr = XAACreateInfoRec();
if(!infoPtr) pSiS->NoAccel = TRUE;
}
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA) { if(pSiS->useEXA) {
if(!(pSiS->EXADriverPtr = exaDriverAlloc())) { if(!(pSiS->EXADriverPtr = exaDriverAlloc())) {
@@ -1113,118 +413,6 @@ SiS300AccelInit(ScreenPtr pScreen)
pSiS->FillRect = SiSDGAFillRect; pSiS->FillRect = SiSDGAFillRect;
pSiS->BlitRect = SiSDGABlitRect; pSiS->BlitRect = SiSDGABlitRect;
#ifdef SIS_USE_XAA /* ----------------------- XAA ----------------------- */
if(!pSiS->useEXA) {
infoPtr->Flags = LINEAR_FRAMEBUFFER |
OFFSCREEN_PIXMAPS |
PIXMAP_CACHE;
/* sync */
infoPtr->Sync = SiSSync;
/* Although SiS states that the 300 series supports a
* virtual screen of 4096x4096, the 2D accelerator
* does not seem to know that. If the destination bitmap
* pitch is > 8192 (which easily happens in 32bpp mode),
* the accelerator engine collapses.
* TODO: Find out about the 530 and 620
*/
if(pSiS->scrnOffset < 8192) {
/* screen to screen copy */
infoPtr->SetupForScreenToScreenCopy = SiSSetupForScreenToScreenCopy;
infoPtr->SubsequentScreenToScreenCopy = SiSSubsequentScreenToScreenCopy;
infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK |
TRANSPARENCY_GXCOPY_ONLY;
/* solid fills */
infoPtr->SetupForSolidFill = SiSSetupForSolidFill;
infoPtr->SubsequentSolidFillRect = SiSSubsequentSolidFillRect;
#ifdef TRAP
infoPtr->SubsequentSolidFillTrap = SiSSubsequentSolidFillTrap;
#endif
infoPtr->SolidFillFlags = NO_PLANEMASK;
/* solid line */
infoPtr->SetupForSolidLine = SiSSetupForSolidLine;
infoPtr->SubsequentSolidTwoPointLine = SiSSubsequentSolidTwoPointLine;
infoPtr->SubsequentSolidHorVertLine = SiSSubsequentSolidHorzVertLine;
infoPtr->SolidLineFlags = NO_PLANEMASK;
/* dashed line */
infoPtr->SetupForDashedLine = SiSSetupForDashedLine;
infoPtr->SubsequentDashedTwoPointLine = SiSSubsequentDashedTwoPointLine;
infoPtr->DashPatternMaxLength = 64;
infoPtr->DashedLineFlags = NO_PLANEMASK |
LINE_PATTERN_MSBFIRST_LSBJUSTIFIED;
/* 8x8 mono pattern fill */
infoPtr->SetupForMono8x8PatternFill = SiSSetupForMonoPatternFill;
infoPtr->SubsequentMono8x8PatternFillRect = SiSSubsequentMonoPatternFill;
#ifdef TRAP
infoPtr->SubsequentMono8x8PatternFillTrap = SiSSubsequentMonoPatternFillTrap;
#endif
infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK |
HARDWARE_PATTERN_SCREEN_ORIGIN |
HARDWARE_PATTERN_PROGRAMMED_BITS |
/* NO_TRANSPARENCY | */
BIT_ORDER_IN_BYTE_MSBFIRST ;
#ifdef STSCE
/* Screen To Screen Color Expand */
/* The hardware does support this the way we need it */
infoPtr->SetupForScreenToScreenColorExpandFill =
SiSSetupForScreenToScreenColorExpand;
infoPtr->SubsequentScreenToScreenColorExpandFill =
SiSSubsequentScreenToScreenColorExpand;
infoPtr->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK |
BIT_ORDER_IN_BYTE_MSBFIRST ;
#endif
/* per-scanline color expansion (using indirect method) */
if(pSiS->VGAEngine == SIS_530_VGA) {
pSiS->ColorExpandBufferNumber = 4;
pSiS->ColorExpandBufferCountMask = 0x03;
} else {
pSiS->ColorExpandBufferNumber = 16;
pSiS->ColorExpandBufferCountMask = 0x0F;
}
pSiS->PerColorExpandBufferSize = ((pScrn->virtualX + 31)/32) * 4;
infoPtr->NumScanlineColorExpandBuffers = pSiS->ColorExpandBufferNumber;
infoPtr->ScanlineColorExpandBuffers = (UChar **)&pSiS->ColorExpandBufferAddr[0];
infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
SiSSetupForScanlineCPUToScreenColorExpandFill;
infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
SiSSubsequentScanlineCPUToScreenColorExpandFill;
infoPtr->SubsequentColorExpandScanline =
SiSSubsequentColorExpandScanline;
infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
CPU_TRANSFER_PAD_DWORD |
SCANLINE_PAD_DWORD |
BIT_ORDER_IN_BYTE_MSBFIRST |
LEFT_EDGE_CLIPPING;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Virtual screen width too large for accelerator engine\n");
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"\t2D acceleration and Xv disabled\n");
pSiS->NoXvideo = TRUE;
}
#ifdef SISDUALHEAD
if(pSiS->DualHeadMode) {
infoPtr->RestoreAccelState = SiSRestoreAccelState;
}
#endif
} /* !exa */
#endif /* XAA */
#ifdef SIS_USE_EXA /* ----------------------- EXA ----------------------- */ #ifdef SIS_USE_EXA /* ----------------------- EXA ----------------------- */
if(pSiS->useEXA) { if(pSiS->useEXA) {
@@ -1297,56 +485,6 @@ SiS300AccelInit(ScreenPtr pScreen)
* topFB * topFB
*/ */
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
topFB = pSiS->maxxfbmem;
reservedFbSize = pSiS->ColorExpandBufferNumber * pSiS->PerColorExpandBufferSize;
usableFbSize = topFB - reservedFbSize;
AvailBufBase = pSiS->FbBase + usableFbSize;
for(i = 0; i < pSiS->ColorExpandBufferNumber; i++) {
pSiS->ColorExpandBufferAddr[i] = AvailBufBase +
i * pSiS->PerColorExpandBufferSize;
pSiS->ColorExpandBufferScreenOffset[i] = usableFbSize +
i * pSiS->PerColorExpandBufferSize;
}
Avail.x1 = 0;
Avail.y1 = 0;
Avail.x2 = pScrn->displayWidth;
Avail.y2 = (usableFbSize / (pScrn->displayWidth * pScrn->bitsPerPixel/8)) - 1;
if(Avail.y2 < 0) Avail.y2 = 32767;
if(Avail.y2 < pScrn->currentMode->VDisplay) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Not enough video RAM for accelerator. At least "
"%dKB needed, %dKB available\n",
((((pScrn->displayWidth * pScrn->bitsPerPixel/8) /* +8 for make it sure */
* pScrn->currentMode->VDisplay) + reservedFbSize) / 1024) + 8,
pSiS->maxxfbmem/1024);
pSiS->NoAccel = TRUE;
pSiS->NoXvideo = TRUE;
XAADestroyInfoRec(pSiS->AccelInfoPtr);
pSiS->AccelInfoPtr = NULL;
return FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Framebuffer from (%d,%d) to (%d,%d)\n",
Avail.x1, Avail.y1, Avail.x2 - 1, Avail.y2 - 1);
xf86InitFBManager(pScreen, &Avail);
if(!pSiS->NoAccel) {
return XAAInit(pScreen, infoPtr);
}
} /* !exa */
#endif /* XAA */
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA) { if(pSiS->useEXA) {
@@ -1377,10 +515,3 @@ SiS300AccelInit(ScreenPtr pScreen)
return TRUE; return TRUE;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -35,9 +35,6 @@
#include "sis.h" #include "sis.h"
#ifdef SIS_USE_XAA
#include "xf86fbman.h"
#endif
#include "xf86xv.h" #include "xf86xv.h"
#include "regionstr.h" #include "regionstr.h"
#include <X11/extensions/Xv.h> #include <X11/extensions/Xv.h>

View File

@@ -38,19 +38,8 @@
#include "sis.h" #include "sis.h"
#include "sis_regs.h" #include "sis_regs.h"
#ifdef SIS_USE_XAA
#include "xaarop.h"
#endif
#include "sis_accel.h" #include "sis_accel.h"
#ifdef SIS_USE_XAA
#if 0
#define CTSCE /* Include enhanced color expansion code */
#endif /* This produces drawing errors sometimes */
#endif /* XAA */
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
extern void SiSScratchSave(ScreenPtr pScreen, ExaOffscreenArea *area); extern void SiSScratchSave(ScreenPtr pScreen, ExaOffscreenArea *area);
extern Bool SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst); extern Bool SiSUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst);
@@ -178,287 +167,6 @@ SiSSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h)
sisSETCMD(op); sisSETCMD(op);
} }
#ifdef SIS_USE_XAA /* ---------------------------- XAA -------------------------- */
/* Clipping */
static void
SiSSetClippingRectangle(ScrnInfoPtr pScrn,
int left, int top, int right, int bottom)
{
SISPtr pSiS = SISPTR(pScrn);
sisBLTSync;
sisSETCLIPTOP(left,top);
sisSETCLIPBOTTOM(right,bottom);
pSiS->ClipEnabled = TRUE;
}
static void
SiSDisableClipping(ScrnInfoPtr pScrn)
{
SISPtr pSiS = SISPTR(pScrn);
pSiS->ClipEnabled = FALSE;
}
/* 8x8 mono */
static void
SiSSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patternx, int patterny,
int fg, int bg, int rop, unsigned int planemask)
{
SISPtr pSiS = SISPTR(pScrn);
unsigned int *patternRegPtr;
int i;
(void)XAAHelpPatternROP(pScrn, &fg, &bg, planemask, &rop);
sisBLTSync;
if(bg != -1) {
sisSETBGROPCOL(0xcc, bg); /* copy */
} else {
sisSETBGROPCOL(0xAA, bg); /* noop */
}
sisSETFGROPCOL(rop, fg);
sisSETPITCH(0, pSiS->scrnOffset);
sisSETSRCADDR(0);
patternRegPtr = (unsigned int *)sisSETPATREG();
pSiS->sisPatternReg[0] = pSiS->sisPatternReg[2] = patternx ;
pSiS->sisPatternReg[1] = pSiS->sisPatternReg[3] = patterny ;
for(i = 0 ; i < 16 /* sisPatternHeight */ ; ) {
patternRegPtr[i++] = patternx ;
patternRegPtr[i++] = patterny ;
}
}
static void
SiSSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int patternx,
int patterny, int x, int y, int w, int h)
{
SISPtr pSiS = SISPTR(pScrn);
register UChar *patternRegPtr;
register UChar *srcPatternRegPtr;
register unsigned int *patternRegPtrL;
UShort tmp;
int dstaddr, i, k, shift;
int op = sisCMDCOLEXP |
sisTOP2BOTTOM |
sisLEFT2RIGHT |
sisPATFG |
sisSRCBG;
if(pSiS->ClipEnabled)
op |= sisCLIPINTRN | sisCLIPENABL;
dstaddr = ( y * pSiS->CurrentLayout.displayWidth + x ) *
pSiS->CurrentLayout.bitsPerPixel / 8;
sisBLTSync;
patternRegPtr = sisSETPATREG();
srcPatternRegPtr = (UChar *)pSiS->sisPatternReg ;
shift = 8 - patternx ;
for(i = 0, k = patterny ; i < 8 ; i++, k++ ) {
tmp = srcPatternRegPtr[k]<<8 | srcPatternRegPtr[k] ;
tmp >>= shift ;
patternRegPtr[i] = tmp & 0xff;
}
patternRegPtrL = (unsigned int *)sisSETPATREG();
for(i = 2 ; i < 16 /* sisPatternHeight */; ) {
patternRegPtrL[i++] = patternRegPtrL[0];
patternRegPtrL[i++] = patternRegPtrL[1];
}
sisSETDSTADDR(dstaddr);
sisSETHEIGHTWIDTH(h-1, w*(pSiS->CurrentLayout.bitsPerPixel/8)-1);
sisSETCMD(op);
}
/* Line */
static void
SiSSetupForSolidLine(ScrnInfoPtr pScrn,
int color, int rop, unsigned int planemask)
{
SISPtr pSiS = SISPTR(pScrn);
sisBLTSync;
sisSETBGROPCOL(SiSGetCopyROP(rop), 0);
sisSETFGROPCOL(SiSGetCopyROP(rop), color);
}
static void
SiSSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
int x1, int y1, int x2, int y2, int flags)
{
SISPtr pSiS = SISPTR(pScrn);
int op, major, minor, err, K1, K2, tmp;
op = sisCMDLINE | sisSRCFG;
if((flags & OMIT_LAST))
op |= sisLASTPIX;
if(pSiS->ClipEnabled)
op |= sisCLIPINTRN | sisCLIPENABL;
if((major = x2 - x1) <= 0)
major = -major;
else
op |= sisXINCREASE;
if((minor = y2 - y1) <= 0)
minor = -minor;
else
op |= sisYINCREASE;
if(minor >= major) {
tmp = minor;
minor = major;
major = tmp;
} else
op |= sisXMAJOR;
K1 = (minor - major) << 1;
K2 = minor << 1;
err = (minor << 1) - major;
sisBLTSync;
sisSETXStart(x1);
sisSETYStart(y1);
sisSETLineSteps((short)K1,(short)K2);
sisSETLineErrorTerm((short)err);
sisSETLineMajorCount((short)major);
sisSETCMD(op);
}
static void
SiSSubsequentSolidHorVertLine(ScrnInfoPtr pScrn,
int x, int y, int len, int dir)
{
SISPtr pSiS = SISPTR(pScrn);
int destaddr, op;
destaddr = y * pSiS->CurrentLayout.displayWidth + x;
op = sisCMDBLT | sisSRCFG | sisTOP2BOTTOM | sisLEFT2RIGHT;
if(pSiS->ClipEnabled)
op |= sisCLIPINTRN | sisCLIPENABL;
destaddr *= (pSiS->CurrentLayout.bitsPerPixel / 8);
sisBLTSync;
sisSETPITCH(pSiS->scrnOffset, pSiS->scrnOffset);
if(dir == DEGREES_0) {
sisSETHEIGHTWIDTH(0, len * (pSiS->CurrentLayout.bitsPerPixel >> 3) - 1);
} else {
sisSETHEIGHTWIDTH(len - 1, (pSiS->CurrentLayout.bitsPerPixel >> 3) - 1);
}
sisSETDSTADDR(destaddr);
sisSETCMD(op);
}
#ifdef CTSCE
/* ----- CPU To Screen Color Expand (scanline-wise) ------ */
static void
SiSSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
int fg, int bg, int rop, unsigned int planemask)
{
SISPtr pSiS=SISPTR(pScrn);
pSiS->CommandReg = 0;
pSiS->CommandReg |= (sisCMDECOLEXP |
sisLEFT2RIGHT |
sisTOP2BOTTOM);
sisBLTSync;
/* The combination of flags in the following
* is not understandable. However, this is the
* only combination that seems to work.
*/
if(bg == -1) {
sisSETROPBG(0xAA); /* dst = dst (=noop) */
pSiS->CommandReg |= sisSRCFG;
} else {
sisSETBGROPCOL(SiSGetPatternROP(rop), bg);
pSiS->CommandReg |= sisSRCFG | sisPATBG;
}
sisSETFGROPCOL(SiSGetCopyROP(rop), fg);
sisSETDSTPITCH(pSiS->scrnOffset);
}
static void
SiSSubsequentScanlineCPUToScreenColorExpandFill(
ScrnInfoPtr pScrn, int x, int y, int w,
int h, int skipleft)
{
SISPtr pSiS = SISPTR(pScrn);
int _x0, _y0, _x1, _y1;
int op = pSiS->CommandReg;
if(skipleft > 0) {
_x0 = x + skipleft;
_y0 = y;
_x1 = x + w;
_y1 = y + h;
sisSETCLIPTOP(_x0, _y0);
sisSETCLIPBOTTOM(_x1, _y1);
op |= sisCLIPENABL;
} else {
op &= (~(sisCLIPINTRN | sisCLIPENABL));
}
sisSETSRCPITCH(((((w + 7) / 8) + 3) >> 2) * 4);
sisSETHEIGHTWIDTH(1-1, (w * (pSiS->CurrentLayout.bitsPerPixel/8)) - 1);
pSiS->xcurrent = x;
pSiS->ycurrent = y;
pSiS->CommandReg = op;
}
static void
SiSSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
{
SISPtr pSiS = SISPTR(pScrn);
unsigned long cbo = pSiS->ColorExpandBufferScreenOffset[bufno];
int op = pSiS->CommandReg;
int destaddr;
destaddr = (pSiS->ycurrent * pSiS->CurrentLayout.displayWidth) + pSiS->xcurrent;
destaddr *= (pSiS->CurrentLayout.bitsPerPixel / 8);
/* Wait until there is no color expansion command in queue */
/* sisBLTSync; */
sisSETSRCADDR(cbo);
sisSETDSTADDR(destaddr);
sisSETCMD(op);
pSiS->ycurrent++;
/* Wait for eventual color expand commands to finish */
/* (needs to be done, otherwise the data in the buffer may
* be overwritten while accessed by the hardware)
*/
while((SIS_MMIO_IN32(pSiS->IOBase, 0x8284) & 0x80000000)) {}
sisBLTSync;
}
#endif /* CTSCE */
#endif /* XAA */
#ifdef SIS_USE_EXA /* ---------------------------- EXA -------------------------- */ #ifdef SIS_USE_EXA /* ---------------------------- EXA -------------------------- */
static void static void
@@ -644,31 +352,16 @@ SiSAccelInit(ScreenPtr pScreen)
{ {
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
SISPtr pSiS = SISPTR(pScrn); SISPtr pSiS = SISPTR(pScrn);
#ifdef SIS_USE_XAA
XAAInfoRecPtr infoPtr = NULL;
int topFB, reservedFbSize, usableFbSize, i;
UChar *AvailBufBase;
BoxRec Avail;
#endif
pSiS->ColorExpandBufferNumber = 0; pSiS->ColorExpandBufferNumber = 0;
pSiS->PerColorExpandBufferSize = 0; pSiS->PerColorExpandBufferSize = 0;
pSiS->RenderAccelArray = NULL; pSiS->RenderAccelArray = NULL;
#ifdef SIS_USE_XAA
pSiS->AccelInfoPtr = NULL;
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
pSiS->EXADriverPtr = NULL; pSiS->EXADriverPtr = NULL;
pSiS->exa_scratch = NULL; pSiS->exa_scratch = NULL;
#endif #endif
if(!pSiS->NoAccel) { if(!pSiS->NoAccel) {
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
pSiS->AccelInfoPtr = infoPtr = XAACreateInfoRec();
if(!infoPtr) pSiS->NoAccel = TRUE;
}
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA) { if(pSiS->useEXA) {
if(!(pSiS->EXADriverPtr = exaDriverAlloc())) { if(!(pSiS->EXADriverPtr = exaDriverAlloc())) {
@@ -688,80 +381,6 @@ SiSAccelInit(ScreenPtr pScreen)
pSiS->FillRect = SiSDGAFillRect; pSiS->FillRect = SiSDGAFillRect;
pSiS->BlitRect = SiSDGABlitRect; pSiS->BlitRect = SiSDGABlitRect;
#ifdef SIS_USE_XAA /* ----------------------- XAA ----------------------- */
if(!pSiS->useEXA) {
infoPtr->Flags = LINEAR_FRAMEBUFFER |
OFFSCREEN_PIXMAPS |
PIXMAP_CACHE;
/* Sync */
infoPtr->Sync = SiSSync;
/* Screen To Screen copy */
infoPtr->SetupForScreenToScreenCopy = SiSSetupForScreenToScreenCopy;
infoPtr->SubsequentScreenToScreenCopy = SiSSubsequentScreenToScreenCopy;
infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY | NO_PLANEMASK;
/* Solid fill */
infoPtr->SetupForSolidFill = SiSSetupForFillRectSolid;
infoPtr->SubsequentSolidFillRect = SiSSubsequentFillRectSolid;
infoPtr->SolidFillFlags = NO_PLANEMASK;
/* On 5597/5598 and 6326, clipping and lines only work
for 1024, 2048, 4096 logical width */
if(pSiS->ValidWidth) {
/* Clipping */
infoPtr->SetClippingRectangle = SiSSetClippingRectangle;
infoPtr->DisableClipping = SiSDisableClipping;
infoPtr->ClippingFlags = HARDWARE_CLIP_SOLID_LINE |
HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY |
HARDWARE_CLIP_MONO_8x8_FILL |
HARDWARE_CLIP_SOLID_FILL ;
/* Solid Lines */
infoPtr->SetupForSolidLine = SiSSetupForSolidLine;
infoPtr->SubsequentSolidTwoPointLine = SiSSubsequentSolidTwoPointLine;
infoPtr->SubsequentSolidHorVertLine = SiSSubsequentSolidHorVertLine;
infoPtr->SolidLineFlags = NO_PLANEMASK;
}
if(pScrn->bitsPerPixel != 24) {
/* 8x8 mono pattern */
infoPtr->SetupForMono8x8PatternFill = SiSSetupForMono8x8PatternFill;
infoPtr->SubsequentMono8x8PatternFillRect = SiSSubsequentMono8x8PatternFillRect;
infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK |
HARDWARE_PATTERN_PROGRAMMED_BITS |
HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
BIT_ORDER_IN_BYTE_MSBFIRST;
}
#ifdef CTSCE
if(pScrn->bitsPerPixel != 24) {
/* per-scanline color expansion (using indirect method) */
pSiS->ColorExpandBufferNumber = 4;
pSiS->ColorExpandBufferCountMask = 0x03;
pSiS->PerColorExpandBufferSize = ((pScrn->virtualX + 31) / 32) * 4;
infoPtr->NumScanlineColorExpandBuffers = pSiS->ColorExpandBufferNumber;
infoPtr->ScanlineColorExpandBuffers = (UChar **)&pSiS->ColorExpandBufferAddr[0];
infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
SiSSetupForScanlineCPUToScreenColorExpandFill;
infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
SiSSubsequentScanlineCPUToScreenColorExpandFill;
infoPtr->SubsequentColorExpandScanline =
SiSSubsequentColorExpandScanline;
infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
CPU_TRANSFER_PAD_DWORD |
SCANLINE_PAD_DWORD |
BIT_ORDER_IN_BYTE_MSBFIRST |
LEFT_EDGE_CLIPPING;
}
#endif
} /* !exa */
#endif /* XAA */
#ifdef SIS_USE_EXA /* ----------------------- EXA ----------------------- */ #ifdef SIS_USE_EXA /* ----------------------- EXA ----------------------- */
if(pSiS->useEXA) { if(pSiS->useEXA) {
pSiS->EXADriverPtr->exa_major = 2; pSiS->EXADriverPtr->exa_major = 2;
@@ -812,57 +431,6 @@ SiSAccelInit(ScreenPtr pScreen)
* topFB * topFB
*/ */
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
topFB = pSiS->maxxfbmem;
reservedFbSize = pSiS->ColorExpandBufferNumber * pSiS->PerColorExpandBufferSize;
usableFbSize = topFB - reservedFbSize;
if(pSiS->ColorExpandBufferNumber) {
AvailBufBase = pSiS->FbBase + usableFbSize;
for(i = 0; i < pSiS->ColorExpandBufferNumber; i++) {
pSiS->ColorExpandBufferAddr[i] = AvailBufBase +
i * pSiS->PerColorExpandBufferSize;
pSiS->ColorExpandBufferScreenOffset[i] = usableFbSize +
i * pSiS->PerColorExpandBufferSize;
}
}
Avail.x1 = 0;
Avail.y1 = 0;
Avail.x2 = pScrn->displayWidth;
Avail.y2 = usableFbSize / (pScrn->displayWidth * pScrn->bitsPerPixel / 8) - 1;
if(Avail.y2 < 0) Avail.y2 = 32767;
if(Avail.y2 < pScrn->currentMode->VDisplay) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Not enough video RAM for accelerator: %dKB needed, %dKB available\n",
((((pScrn->displayWidth * pScrn->bitsPerPixel/8) /* +8 for make it sure */
* pScrn->currentMode->VDisplay) + reservedFbSize) / 1024) + 8,
pSiS->maxxfbmem/1024);
pSiS->NoAccel = TRUE;
pSiS->NoXvideo = TRUE;
XAADestroyInfoRec(pSiS->AccelInfoPtr);
pSiS->AccelInfoPtr = NULL;
return FALSE;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Framebuffer from (%d,%d) to (%d,%d)\n",
Avail.x1, Avail.y1, Avail.x2 - 1, Avail.y2 - 1);
xf86InitFBManager(pScreen, &Avail);
if(!pSiS->NoAccel) {
return XAAInit(pScreen, infoPtr);
}
} /* !exa */
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA) { if(pSiS->useEXA) {
@@ -893,10 +461,3 @@ SiSAccelInit(ScreenPtr pScreen)
return TRUE; return TRUE;
} }

View File

@@ -439,11 +439,6 @@ SIS_FillRect(
if(pSiS->FillRect) { if(pSiS->FillRect) {
(*pSiS->FillRect)(pScrn, x, y, w, h, (int)color); (*pSiS->FillRect)(pScrn, x, y, w, h, (int)color);
#ifdef SIS_USE_XAA
if(!pSiS->useEXA && pSiS->AccelInfoPtr) {
SET_SYNC_FLAG(pSiS->AccelInfoPtr);
}
#endif
} }
} }
@@ -458,11 +453,6 @@ SIS_BlitRect(
if(pSiS->BlitRect) { if(pSiS->BlitRect) {
(*pSiS->BlitRect)(pScrn, srcx, srcy, dstx, dsty, w, h, -1); (*pSiS->BlitRect)(pScrn, srcx, srcy, dstx, dsty, w, h, -1);
#ifdef SIS_USE_XAA
if(!pSiS->useEXA && pSiS->AccelInfoPtr) {
SET_SYNC_FLAG(pSiS->AccelInfoPtr);
}
#endif
} }
} }
@@ -478,11 +468,6 @@ SIS_BlitTransRect(
if(pSiS->BlitRect) { if(pSiS->BlitRect) {
(*pSiS->BlitRect)(pScrn, srcx, srcy, dstx, dsty, w, h, (int)color); (*pSiS->BlitRect)(pScrn, srcx, srcy, dstx, dsty, w, h, (int)color);
#ifdef SIS_USE_XAA
if(!pSiS->useEXA && pSiS->AccelInfoPtr) {
SET_SYNC_FLAG(pSiS->AccelInfoPtr);
}
#endif
} }
} }

View File

@@ -3494,9 +3494,6 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
pSiS->SiSFastVidCopyFrom = SiSVidCopyGetDefault(); pSiS->SiSFastVidCopyFrom = SiSVidCopyGetDefault();
pSiS->SiSFastMemCopyFrom = SiSVidCopyGetDefault(); pSiS->SiSFastMemCopyFrom = SiSVidCopyGetDefault();
pSiS->SiSFastVidCopyDone = FALSE; pSiS->SiSFastVidCopyDone = FALSE;
#ifdef SIS_USE_XAA
pSiS->RenderCallback = NULL;
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
pSiS->ExaRenderCallback = NULL; pSiS->ExaRenderCallback = NULL;
#endif #endif
@@ -6688,16 +6685,6 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
/* Load XAA/EXA (if needed) */ /* Load XAA/EXA (if needed) */
if(!pSiS->NoAccel) { if(!pSiS->NoAccel) {
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Falling back to shadowfb\n");
pSiS->NoAccel = 1;
pSiS->ShadowFB = 1;
}
}
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA) { if(pSiS->useEXA) {
XF86ModReqInfo req; XF86ModReqInfo req;
@@ -7969,11 +7956,6 @@ SISBlockHandler(BLOCKHANDLER_ARGS_DECL)
(*pSiS->VideoTimerCallback)(pScrn, currentTime.milliseconds); (*pSiS->VideoTimerCallback)(pScrn, currentTime.milliseconds);
} }
#ifdef SIS_USE_XAA
if(pSiS->RenderCallback) {
(*pSiS->RenderCallback)(pScrn);
}
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->ExaRenderCallback) { if(pSiS->ExaRenderCallback) {
(*pSiS->ExaRenderCallback)(pScrn); (*pSiS->ExaRenderCallback)(pScrn);
@@ -9658,19 +9640,6 @@ SISCloseScreen(CLOSE_SCREEN_ARGS_DECL)
pSiS->pInt = NULL; pSiS->pInt = NULL;
} }
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
if(pSiS->AccelLinearScratch) {
xf86FreeOffscreenLinear(pSiS->AccelLinearScratch);
pSiS->AccelLinearScratch = NULL;
}
if(pSiS->AccelInfoPtr) {
XAADestroyInfoRec(pSiS->AccelInfoPtr);
pSiS->AccelInfoPtr = NULL;
}
}
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA) { if(pSiS->useEXA) {
if(pSiS->EXADriverPtr) { if(pSiS->EXADriverPtr) {

View File

@@ -157,9 +157,6 @@ typedef enum {
static const OptionInfoRec SISOptions[] = { static const OptionInfoRec SISOptions[] = {
{ OPTION_ACCEL, "Accel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ACCEL, "Accel", OPTV_BOOLEAN, {0}, FALSE },
#if defined(SIS_USE_XAA) && defined(SIS_USE_EXA)
{ OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE },
#endif
{ OPTION_TURBOQUEUE, "TurboQueue", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_TURBOQUEUE, "TurboQueue", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_FAST_VRAM, "FastVram", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FAST_VRAM, "FastVram", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_HOSTBUS, "HostBus", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HOSTBUS, "HostBus", OPTV_BOOLEAN, {0}, FALSE },
@@ -465,11 +462,7 @@ SiSOptions(ScrnInfoPtr pScrn)
pSiS->Rotate = 0; pSiS->Rotate = 0;
pSiS->Reflect = 0; pSiS->Reflect = 0;
pSiS->NoAccel = FALSE; pSiS->NoAccel = FALSE;
#if (defined(SIS_USE_EXA) && defined(SIS_USE_XAA)) || !defined(SIS_USE_EXA)
pSiS->useEXA = FALSE;
#else
pSiS->useEXA = TRUE; pSiS->useEXA = TRUE;
#endif
pSiS->ShadowFB = FALSE; pSiS->ShadowFB = FALSE;
pSiS->loadDRI = FALSE; pSiS->loadDRI = FALSE;
#ifdef SISDRI #ifdef SISDRI
@@ -702,40 +695,10 @@ SiSOptions(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "2D Acceleration disabled\n"); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "2D Acceleration disabled\n");
} }
#if defined(SIS_USE_XAA) && defined(SIS_USE_EXA)
if(!pSiS->NoAccel) {
from = X_DEFAULT;
if((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_ACCELMETHOD))) {
if(!xf86NameCmp(strptr,"XAA")) {
from = X_CONFIG;
pSiS->useEXA = FALSE;
} else if(!xf86NameCmp(strptr,"EXA")) {
from = X_CONFIG;
pSiS->useEXA = TRUE;
}
}
xf86DrvMsg(pScrn->scrnIndex, from, "Using %s acceleration architecture\n",
pSiS->useEXA ? "EXA" : "XAA");
}
#endif
/* RenderAcceleration /* RenderAcceleration
* En/Disables RENDER acceleration (315/330/340 series only, not 550, not XGI Z7) * En/Disables RENDER acceleration (315/330/340 series only, not 550, not XGI Z7)
*/ */
#ifdef SIS_USE_XAA
if((pSiS->VGAEngine == SIS_315_VGA) &&
(pSiS->Chipset != PCI_CHIP_SIS550) &&
(pSiS->Chipset != PCI_CHIP_XGIXG20) &&
(!pSiS->NoAccel)) {
if(xf86GetOptValBool(pSiS->Options, OPTION_RENDER, &pSiS->doRender)) {
if(!pSiS->doRender) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "RENDER Acceleration disabled\n");
}
}
}
#else
pSiS->doRender = FALSE; pSiS->doRender = FALSE;
#endif
/* SWCursor, HWCursor /* SWCursor, HWCursor
* Chooses whether to use the hardware or software cursor * Chooses whether to use the hardware or software cursor
@@ -987,9 +950,6 @@ SiSOptions(ScrnInfoPtr pScrn)
OPTION_SISTVCOLCALIBFINE, OPTION_TVXPOSOFFSET, OPTION_TVYPOSOFFSET, OPTION_SISTVCOLCALIBFINE, OPTION_TVXPOSOFFSET, OPTION_TVYPOSOFFSET,
OPTION_TVXSCALE, OPTION_TVYSCALE, OPTION_TVBLUE, OPTION_CRT2GAMMA, OPTION_XVONCRT2, OPTION_TVXSCALE, OPTION_TVYSCALE, OPTION_TVBLUE, OPTION_CRT2GAMMA, OPTION_XVONCRT2,
OPTION_XVDEFAULTADAPTOR, OPTION_XVMEMCPY, OPTION_XVBENCHCPY, OPTION_FORCE2ASPECT, OPTION_XVDEFAULTADAPTOR, OPTION_XVMEMCPY, OPTION_XVBENCHCPY, OPTION_FORCE2ASPECT,
#if defined(SIS_USE_XAA) && defined(SIS_USE_EXA)
OPTION_ACCELMETHOD,
#endif
#ifndef SISCHECKOSSSE #ifndef SISCHECKOSSSE
OPTION_XVSSECOPY, OPTION_XVSSECOPY,
#endif #endif

View File

@@ -97,9 +97,6 @@
#endif #endif
#include "sis.h" #include "sis.h"
#ifdef SIS_USE_XAA
#include "xf86fbman.h"
#endif
#include "regionstr.h" #include "regionstr.h"
#include "xf86xv.h" #include "xf86xv.h"
@@ -3193,49 +3190,6 @@ SISAllocateFBMemory(
SISPtr pSiS = SISPTR(pScrn); SISPtr pSiS = SISPTR(pScrn);
ScreenPtr pScreen = xf86ScrnToScreen(pScrn); ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
FBLinearPtr linear = (FBLinearPtr)(*handle);
FBLinearPtr new_linear;
int depth = pSiS->CurrentLayout.bitsPerPixel >> 3;
int size = ((bytesize + depth - 1) / depth);
if(linear) {
if(linear->size >= size) {
return (unsigned int)(linear->offset * depth);
}
if(xf86ResizeOffscreenLinear(linear, size)) {
return (unsigned int)(linear->offset * depth);
}
xf86FreeOffscreenLinear(linear);
*handle = NULL;
}
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, NULL, NULL, NULL);
if(!new_linear) {
int max_size;
xf86QueryLargestOffscreenLinear(pScreen, &max_size, 8, PRIORITY_EXTREME);
if(max_size < size)
return 0;
xf86PurgeUnlockedOffscreenAreas(pScreen);
new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, NULL, NULL, NULL);
}
if(!new_linear) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Xv: Failed to allocate %d pixels of linear video memory\n", size);
return 0;
} else {
*handle = (void *)new_linear;
return (unsigned int)(new_linear->offset * depth);
}
}
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA && !pSiS->NoAccel) { if(pSiS->useEXA && !pSiS->NoAccel) {
ExaOffscreenArea *area = (ExaOffscreenArea *)(*handle); ExaOffscreenArea *area = (ExaOffscreenArea *)(*handle);
@@ -3269,13 +3223,6 @@ SISFreeFBMemory(ScrnInfoPtr pScrn, void **handle)
ScreenPtr pScreen = xf86ScrnToScreen(pScrn); ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
#endif #endif
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
if(*handle) {
xf86FreeOffscreenLinear((FBLinearPtr)(*handle));
}
}
#endif
#ifdef SIS_USE_EXA #ifdef SIS_USE_EXA
if(pSiS->useEXA && !pSiS->NoAccel) { if(pSiS->useEXA && !pSiS->NoAccel) {
if(*handle) { if(*handle) {
@@ -3336,11 +3283,6 @@ SISPutImage(
){ ){
SISPtr pSiS = SISPTR(pScrn); SISPtr pSiS = SISPTR(pScrn);
SISPortPrivPtr pPriv = (SISPortPrivPtr)data; SISPortPrivPtr pPriv = (SISPortPrivPtr)data;
#ifdef SIS_USE_XAA
XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr;
int depth = pSiS->CurrentLayout.bitsPerPixel >> 3;
int myreds[] = { 0x000000ff, 0x0000f800, 0, 0x00ff0000 };
#endif
int totalSize = 0; int totalSize = 0;
#if 0 #if 0
@@ -3453,22 +3395,9 @@ SISPutImage(
} }
/* draw these */ /* draw these */
pPriv->PrevOverlay = pPriv->NoOverlay; pPriv->PrevOverlay = pPriv->NoOverlay;
#ifdef SIS_USE_XAA
if((pPriv->NoOverlay) && pXAA && pXAA->FillMono8x8PatternRects) {
(*pXAA->FillMono8x8PatternRects)(pScrn, myreds[depth-1],
0x000000, GXcopy, ~0,
REGION_NUM_RECTS(clipBoxes),
REGION_RECTS(clipBoxes),
0x00422418, 0x18244200, 0, 0);
} else {
#endif
if(!pSiS->disablecolorkeycurrent) { if(!pSiS->disablecolorkeycurrent) {
xf86XVFillKeyHelper(pScrn->pScreen, (pPriv->NoOverlay) ? 0x00ff0000 : pPriv->colorKey, clipBoxes); xf86XVFillKeyHelper(pScrn->pScreen, (pPriv->NoOverlay) ? 0x00ff0000 : pPriv->colorKey, clipBoxes);
} }
#ifdef SIS_USE_XAA
}
#endif
} }
pPriv->currentBuf ^= 1; pPriv->currentBuf ^= 1;
@@ -3667,10 +3596,6 @@ SISDisplaySurface (
{ {
ScrnInfoPtr pScrn = surface->pScrn; ScrnInfoPtr pScrn = surface->pScrn;
SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr); SISPortPrivPtr pPriv = (SISPortPrivPtr)(surface->devPrivate.ptr);
#ifdef SIS_USE_XAA
SISPtr pSiS = SISPTR(pScrn);
int myreds[] = { 0x000000ff, 0x0000f800, 0, 0x00ff0000 };
#endif
if(!pPriv->grabbedByV4L) return Success; if(!pPriv->grabbedByV4L) return Success;
@@ -3691,23 +3616,7 @@ SISDisplaySurface (
SISDisplayVideo(pScrn, pPriv); SISDisplayVideo(pScrn, pPriv);
if(pPriv->autopaintColorKey) { if(pPriv->autopaintColorKey) {
#ifdef SIS_USE_XAA
XAAInfoRecPtr pXAA = pSiS->AccelInfoPtr;
if((pPriv->NoOverlay) && pXAA && pXAA->FillMono8x8PatternRects) {
(*pXAA->FillMono8x8PatternRects)(pScrn,
myreds[(pSiS->CurrentLayout.bitsPerPixel >> 3) - 1],
0x000000, GXcopy, ~0,
REGION_NUM_RECTS(clipBoxes),
REGION_RECTS(clipBoxes),
0x00422418, 0x18244200, 0, 0);
} else {
#endif
xf86XVFillKeyHelper(pScrn->pScreen, (pPriv->NoOverlay) ? 0x00ff0000 : pPriv->colorKey, clipBoxes); xf86XVFillKeyHelper(pScrn->pScreen, (pPriv->NoOverlay) ? 0x00ff0000 : pPriv->colorKey, clipBoxes);
#ifdef SIS_USE_XAA
}
#endif
} }
pPriv->videoStatus = CLIENT_VIDEO_ON; pPriv->videoStatus = CLIENT_VIDEO_ON;
@@ -3839,12 +3748,6 @@ SISSetupBlitVideo(ScreenPtr pScreen)
SISBPortPrivPtr pPriv; SISBPortPrivPtr pPriv;
int i; int i;
#ifdef SIS_USE_XAA
if(!pSiS->useEXA) {
if(!pSiS->AccelInfoPtr) return NULL;
}
#endif
if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + if(!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) +
(sizeof(DevUnion) * NUM_BLIT_PORTS) + (sizeof(DevUnion) * NUM_BLIT_PORTS) +
sizeof(SISBPortPrivRec)))) { sizeof(SISBPortPrivRec)))) {