summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:48:59 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:48:59 +0000
commit45ac28411cd66380aaab9ccc2c7e2ffd270323c0 (patch)
treed6de58cd129e4e629aea4f55302b37be91840e36
parentb8772dfb095f92bdedafae787f74a099182a4594 (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branch
-rw-r--r--src/s3.h7
-rw-r--r--src/s3_IBMRGB.c6
-rw-r--r--src/s3_Ti.c6
-rw-r--r--src/s3_Trio64DAC.c19
-rw-r--r--src/s3_cursor.c6
-rw-r--r--src/s3_driver.c56
-rw-r--r--src/s3_video.c170
7 files changed, 77 insertions, 193 deletions
diff --git a/src/s3.h b/src/s3.h
index 6d3ed32..42b949c 100644
--- a/src/s3.h
+++ b/src/s3.h
@@ -24,7 +24,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h,v 1.16 2002/12/11 17:30:47 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h,v 1.18 2003/07/17 08:19:35 eich Exp $ */
#ifndef _S3_H
@@ -165,6 +165,7 @@ typedef struct _S3Rec {
unsigned char *imageBuffer;
int imageWidth;
int imageHeight;
+ Bool hwCursor;
} S3Rec, *S3Ptr;
#define S3PTR(p) ((S3Ptr)((p)->driverPrivate))
@@ -240,6 +241,8 @@ Bool S3_CursorInit(ScreenPtr pScreen);
#define S3_964_SERIES() ((pS3->Chipset == PCI_CHIP_964_0) || \
(pS3->Chipset == PCI_CHIP_964_1))
#define S3_TRIO_SERIES() ((pS3->Chipset == PCI_CHIP_TRIO) || \
- (pS3->Chipset == PCI_CHIP_AURORA64VP))
+ (pS3->Chipset == PCI_CHIP_AURORA64VP) || \
+ (pS3->Chipset == PCI_CHIP_TRIO64UVP) || \
+ (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX))
#endif /* _S3_H */
diff --git a/src/s3_IBMRGB.c b/src/s3_IBMRGB.c
index e1edc0f..88045e2 100644
--- a/src/s3_IBMRGB.c
+++ b/src/s3_IBMRGB.c
@@ -24,7 +24,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_IBMRGB.c,v 1.5 2003/02/17 16:45:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_IBMRGB.c,v 1.6 2003/07/17 08:19:36 eich Exp $ */
#include "xf86.h"
@@ -510,7 +510,9 @@ static void S3IBMRGBLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *image)
static Bool S3IBMRGBUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
{
- return TRUE;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ S3Ptr pS3 = S3PTR(pScrn);
+ return (pS3->hwCursor);
}
diff --git a/src/s3_Ti.c b/src/s3_Ti.c
index 81bab6a..f02a6b1 100644
--- a/src/s3_Ti.c
+++ b/src/s3_Ti.c
@@ -24,7 +24,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_Ti.c,v 1.5 2003/02/17 16:45:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_Ti.c,v 1.6 2003/07/17 08:19:36 eich Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -721,7 +721,9 @@ static void S3TiLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *image)
static Bool S3TiUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
{
- return TRUE;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ S3Ptr pS3 = S3PTR(pScrn);
+ return (pS3->hwCursor);
}
diff --git a/src/s3_Trio64DAC.c b/src/s3_Trio64DAC.c
index fa5d5e8..07b88c3 100644
--- a/src/s3_Trio64DAC.c
+++ b/src/s3_Trio64DAC.c
@@ -24,7 +24,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_Trio64DAC.c,v 1.5 2003/02/17 16:45:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_Trio64DAC.c,v 1.8 2003/11/03 05:11:28 tsi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -180,7 +180,7 @@ S3TrioCalcClock(long freq, int min_m, int min_n1, int max_n1, int min_n2,
ffreq = ffreq_min / (1<<max_n2);
}
if (ffreq > ffreq_max / (1<<min_n2)) {
- ErrorF("invalid frequency %1.3F Mhz [freq <= %1.3f Mhz]\n",
+ ErrorF("invalid frequency %1.3f Mhz [freq <= %1.3f Mhz]\n",
ffreq*BASE_FREQ, ffreq_max*BASE_FREQ/(1<<min_n2));
ffreq = ffreq_max / (1<<min_n2);
}
@@ -220,7 +220,6 @@ static void S3TrioSetPLL(ScrnInfoPtr pScrn, int clk, unsigned char m,
unsigned char n)
{
unsigned char tmp;
- int index2;
if (clk < 2) {
tmp = inb(0x3cc);
@@ -244,7 +243,6 @@ static void S3TrioSetPLL(ScrnInfoPtr pScrn, int clk, unsigned char m,
outb(0x3c5, tmp | 0x22);
outb(0x3c5, tmp | 0x02);
} else {
- index2 = 0x10;
outb(0x3c4, 0x10);
outb(0x3c5, n);
outb(0x3c4, 0x11);
@@ -282,7 +280,7 @@ static void S3TrioSetClock(ScrnInfoPtr pScrn, long freq, int clk, int min_m,
void S3Trio64DAC_PreInit(ScrnInfoPtr pScrn)
{
S3Ptr pS3 = S3PTR(pScrn);
- unsigned char SR8, SR27, SR28;
+ unsigned char SR8, SR27;
int m, n, n1, n2, mclk;
outb(0x3c4, 0x08);
@@ -302,7 +300,7 @@ void S3Trio64DAC_PreInit(ScrnInfoPtr pScrn)
outb(0x3c4, 0x27);
SR27 = inb(0x3c5);
outb(0x3c4, 0x28);
- SR28 = inb(0x3c5);
+ (void) inb(0x3c5);
mclk /= ((SR27 >> 2) & 0x03) + 1;
}
pS3->mclk = mclk;
@@ -324,10 +322,14 @@ void S3Trio64DAC_Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (pS3->Chipset == PCI_CHIP_AURORA64VP)
S3TrioSetClock(pScrn, mode->Clock, 2, 1, 1, 63, 0, 3, 2,
135000, 270000);
+ else if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX)
+ S3TrioSetClock(pScrn, mode->Clock, 2, 1, 1, 31, 0, 3, 2,
+ 170000, 270000);
else
S3TrioSetClock(pScrn, mode->Clock, 2, 1, 1, 31, 0, 3, 2,
135000, 270000);
+
outb(0x3c4, 1);
blank = inb(0x3c5);
outb(0x3c5, blank | 0x20); /* blank the screen */
@@ -348,6 +350,11 @@ void S3Trio64DAC_Init(ScrnInfoPtr pScrn, DisplayModePtr mode)
outb(pS3->vgaCRIndex, 0x33);
cr33 = inb(pS3->vgaCRReg) & ~0x28;
+ if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX)
+ {
+ cr33 |= 0x20;
+ }
+
/* ! pixmux */
switch (pScrn->depth) {
case 8:
diff --git a/src/s3_cursor.c b/src/s3_cursor.c
index 6400874..7a098a1 100644
--- a/src/s3_cursor.c
+++ b/src/s3_cursor.c
@@ -24,7 +24,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_cursor.c,v 1.1 2001/07/02 10:46:04 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_cursor.c,v 1.2 2003/07/17 08:19:36 eich Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -195,7 +195,9 @@ static void S3LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *image)
static Bool S3UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
{
- return TRUE;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ S3Ptr pS3 = S3PTR(pScrn);
+ return (pS3->hwCursor);
}
diff --git a/src/s3_driver.c b/src/s3_driver.c
index b40b164..8ec99f5 100644
--- a/src/s3_driver.c
+++ b/src/s3_driver.c
@@ -34,7 +34,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c,v 1.12 2003/02/14 18:06:58 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c,v 1.20 2003/11/03 05:11:28 tsi Exp $ */
#include "xf86.h"
@@ -132,6 +132,8 @@ static SymTabRec S3Chipsets[] = {
{ PCI_CHIP_968, "968" },
{ PCI_CHIP_TRIO, "Trio32/64" },
{ PCI_CHIP_AURORA64VP, "Aurora64V+" },
+ { PCI_CHIP_TRIO64UVP, "Trio64UV+" },
+ { PCI_CHIP_TRIO64V2_DXGX, "Trio64V2/DX/GX" },
{ -1, NULL }
};
@@ -142,6 +144,8 @@ static PciChipsets S3PciChipsets[] = {
{ PCI_CHIP_968, PCI_CHIP_968, RES_SHARED_VGA },
{ PCI_CHIP_TRIO, PCI_CHIP_TRIO, RES_SHARED_VGA },
{ PCI_CHIP_AURORA64VP, PCI_CHIP_AURORA64VP, RES_SHARED_VGA },
+ { PCI_CHIP_TRIO64UVP, PCI_CHIP_TRIO64UVP, RES_SHARED_VGA },
+ { PCI_CHIP_TRIO64V2_DXGX, PCI_CHIP_TRIO64V2_DXGX, RES_SHARED_VGA },
{ -1, -1, RES_UNDEFINED }
};
@@ -241,6 +245,7 @@ static const char *xaaSymbols[] = {
NULL
};
+static int s3AccelLinePitches[] = { 640, 800, 1024, 1280, 1600 };
#ifdef XFree86LOADER
@@ -395,7 +400,7 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
pScrn->monitor = pScrn->confScreen->monitor;
- if (!xf86SetDepthBpp(pScrn, 8, 8, 8, Support24bppFb | Support32bppFb))
+ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb))
return FALSE;
switch (pScrn->depth) {
@@ -531,6 +536,8 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
case PCI_CHIP_AURORA64VP: /* ??? */
pS3->S3NewMMIO = FALSE;
break;
+ case PCI_CHIP_TRIO64V2_DXGX:
+ case PCI_CHIP_TRIO64UVP:
case PCI_CHIP_968:
pS3->S3NewMMIO = TRUE;
break;
@@ -540,10 +547,10 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
if (pS3->S3NewMMIO)
pS3->IOAddress = pS3->FBAddress + S3_NEWMMIO_REGBASE;
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Framebuffer @ 0x%x\n",
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Framebuffer @ 0x%lx\n",
pS3->FBAddress);
if (pS3->S3NewMMIO)
- xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MMIO @ 0x%x\n",
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MMIO @ 0x%lx\n",
pS3->IOAddress);
pS3->PCIRetry = FALSE; /* not supported yet */
@@ -580,6 +587,15 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
outb(0x102, 0x01);
outb(0x46e8, 0x08);
+ if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX)
+ {
+ outb (0x3d4, 0x86);
+ outb (0x3d5, 0x80);
+
+ outb (0x3d4, 0x90);
+ outb (0x3d5, 0x00);
+ }
+
if (!pScrn->videoRam) {
/* probe videoram */
outb(vgaCRIndex, 0x36);
@@ -691,17 +707,19 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
clockRanges = xnfcalloc(sizeof(ClockRange), 1);
clockRanges->next = NULL;
- clockRanges->minClock = 16000; /* guess */
+ clockRanges->minClock = 15600;
clockRanges->maxClock = pS3->MaxClock;
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = FALSE; /* not yet */
- clockRanges->doubleScanAllowed = FALSE; /* not yet */
-
+ clockRanges->doubleScanAllowed = TRUE; /* not yet */
+
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
pScrn->display->modes, clockRanges,
- NULL, 256, 2048, pScrn->bitsPerPixel,
- 128, 2048, pScrn->display->virtualX,
- pScrn->display->virtualY, pScrn->videoRam * 1024,
+ pS3->NoAccel ? NULL : s3AccelLinePitches,
+ 256, 2048,
+ pScrn->bitsPerPixel, 128, 2048,
+ pScrn->display->virtualX,
+ pScrn->display->virtualY, pScrn->videoRam * 1024,
LOOKUP_BEST_REFRESH);
if (i == -1) {
@@ -725,7 +743,7 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
#ifdef S3_USEFB
xf86LoadSubModule(pScrn, "fb");
- xf86LoaderReqSymbols("fbScreenInit", NULL);
+ xf86LoaderReqSymLists(fbSymbols, NULL);
#else
{
switch (pScrn->bitsPerPixel) {
@@ -935,15 +953,10 @@ static void S3Save(ScrnInfoPtr pScrn)
S3RegPtr save = &pS3->SavedRegs;
vgaHWPtr hwp = VGAHWPTR(pScrn);
vgaRegPtr pVga = &hwp->SavedReg;
- RamDacHWRecPtr pRAMDAC;
- RamDacRegRecPtr RAMDACreg;
int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg;
int i;
unsigned char cr5c = 0;
- pRAMDAC = RAMDACHWPTR(pScrn);
- RAMDACreg = &pRAMDAC->SavedReg;
-
S3BankZero(pScrn);
save->clock = inb(0x3cc);
@@ -1046,7 +1059,7 @@ Bool S3CloseScreen(int scrnIndex, ScreenPtr pScreen)
Bool S3SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
- return S3ModeInit(xf86Screens[scrnIndex], xf86Screens[scrnIndex]->currentMode);
+ return S3ModeInit(xf86Screens[scrnIndex], mode);
}
@@ -1118,7 +1131,9 @@ static int S3GetPixMuxShift(ScrnInfoPtr pScrn)
if (pS3->Chipset == PCI_CHIP_968)
shift = 1; /* XXX IBMRGB */
- else if (pS3->Chipset == PCI_CHIP_TRIO)
+ else if (pS3->Chipset == PCI_CHIP_TRIO ||
+ pS3->Chipset == PCI_CHIP_TRIO64UVP ||
+ pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX)
shift = -(pS3->s3Bpp >> 1);
return shift;
@@ -1138,6 +1153,7 @@ static Bool S3ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
pS3->pixMuxShift = S3GetPixMuxShift(pScrn);
pS3->s3BppDisplayWidth = pScrn->displayWidth * pS3->s3Bpp;
+ pS3->hwCursor = (mode->Flags & V_DBLSCAN) ? FALSE : TRUE;
pS3->HDisplay = mode->HDisplay;
pS3->s3ScissB = ((pScrn->videoRam * 1024) / pS3->s3BppDisplayWidth) - 1;
@@ -1146,7 +1162,7 @@ static Bool S3ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
if (mode->HTotal == mode->CrtcHTotal) {
if (pS3->pixMuxShift > 0) {
/* XXX hack */
- mode->Flags |= V_PIXMUX;
+/* mode->Flags |= V_PIXMUX; */
mode->CrtcHTotal >>= pS3->pixMuxShift;
mode->CrtcHDisplay >>= pS3->pixMuxShift;
@@ -1154,7 +1170,7 @@ static Bool S3ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
mode->CrtcHSyncEnd >>= pS3->pixMuxShift;
mode->CrtcHSkew >>= pS3->pixMuxShift;
} else if (pS3->pixMuxShift < 0) {
- mode->Flags |= V_PIXMUX;
+/* mode->Flags |= V_PIXMUX; */
mode->CrtcHTotal <<= -pS3->pixMuxShift;
mode->CrtcHDisplay <<= -pS3->pixMuxShift;
diff --git a/src/s3_video.c b/src/s3_video.c
index 2a60366..2272002 100644
--- a/src/s3_video.c
+++ b/src/s3_video.c
@@ -24,7 +24,7 @@
*
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_video.c,v 1.2 2001/08/15 11:54:27 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_video.c,v 1.5 2003/11/10 18:22:25 tsi Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -168,45 +168,6 @@ static void S3QueryBestSize(ScrnInfoPtr pScrn, Bool motion, short vid_w,
-static void S3CopyData(unsigned char *src, unsigned char *dst,
- int srcPitch, int dstPitch, int h, int w)
-{
- w <<= 1;
- while (h--) {
- memcpy(dst, src, w);
- src += srcPitch;
- dst += dstPitch;
- }
-}
-
-
-static void S3CopyMungedData(unsigned char *src1, unsigned char *src2,
- unsigned char *src3, unsigned char *dst1,
- int srcPitch, int srcPitch2, int dstPitch,
- int h, int w)
-{
- CARD32 *dst = (CARD32*)dst1;
- int i, j;
-
- dstPitch >>= 2;
- w >>= 1;
-
- for(j = 0; j < h; j++) {
- for(i = 0; i < w; i++) {
- dst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) |
- (src3[i] << 8) | (src2[i] << 24);
- }
- dst += dstPitch;
- src1 += srcPitch;
- if(j & 1) {
- src2 += srcPitch2;
- src3 += srcPitch2;
- }
- }
-}
-
-
-
static void S3ResetVideoOverlay(ScrnInfoPtr pScrn)
{
}
@@ -281,7 +242,7 @@ static XF86VideoAdaptorPtr S3SetupImageVideoOverlay(ScreenPtr pScreen)
adapt->QueryImageAttributes = S3QueryImageAttributes;
/* gotta uninit this someplace */
- REGION_INIT(pScreen, &(pS3->portPrivate->clip), NullBox, 0);
+ REGION_NULL(pScreen, &(pS3->portPrivate->clip));
S3ResetVideoOverlay(pScrn);
@@ -289,110 +250,6 @@ static XF86VideoAdaptorPtr S3SetupImageVideoOverlay(ScreenPtr pScreen)
}
-
-static Bool
-RegionsEqual(RegionPtr A, RegionPtr B)
-{
- int *dataA, *dataB;
- int num;
-
- num = REGION_NUM_RECTS(A);
- if(num != REGION_NUM_RECTS(B))
- return FALSE;
-
- if((A->extents.x1 != B->extents.x1) ||
- (A->extents.x2 != B->extents.x2) ||
- (A->extents.y1 != B->extents.y1) ||
- (A->extents.y2 != B->extents.y2))
- return FALSE;
-
- dataA = (int*)REGION_RECTS(A);
- dataB = (int*)REGION_RECTS(B);
-
- while(num--) {
- if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1]))
- return FALSE;
- dataA += 2;
- dataB += 2;
- }
-
- return TRUE;
-}
-
-
-
-static Bool S3ClipVideo(BoxPtr dst, INT32 *x1, INT32 *x2, INT32 *y1, INT32 *y2,
- RegionPtr reg, INT32 width, INT32 height)
-{
- INT32 vscale, hscale, delta;
- BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
- int diff;
-
- hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1);
- vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1);
-
- *x1 <<= 16; *x2 <<= 16;
- *y1 <<= 16; *y2 <<= 16;
-
- diff = extents->x1 - dst->x1;
- if(diff > 0) {
- dst->x1 = extents->x1;
- *x1 += diff * hscale;
- }
- diff = dst->x2 - extents->x2;
- if(diff > 0) {
- dst->x2 = extents->x2;
- *x2 -= diff * hscale;
- }
- diff = extents->y1 - dst->y1;
- if(diff > 0) {
- dst->y1 = extents->y1;
- *y1 += diff * vscale;
- }
- diff = dst->y2 - extents->y2;
- if(diff > 0) {
- dst->y2 = extents->y2;
- *y2 -= diff * vscale;
- }
-
- if(*x1 < 0) {
- diff = (- *x1 + hscale - 1)/ hscale;
- dst->x1 += diff;
- *x1 += diff * hscale;
- }
- delta = *x2 - (width << 16);
- if(delta > 0) {
- diff = (delta + hscale - 1)/ hscale;
- dst->x2 -= diff;
- *x2 -= diff * hscale;
- }
- if(*x1 >= *x2) return FALSE;
-
- if(*y1 < 0) {
- diff = (- *y1 + vscale - 1)/ vscale;
- dst->y1 += diff;
- *y1 += diff * vscale;
- }
- delta = *y2 - (height << 16);
- if(delta > 0) {
- diff = (delta + vscale - 1)/ vscale;
- dst->y2 -= diff;
- *y2 -= diff * vscale;
- }
- if(*y1 >= *y2) return FALSE;
-
- if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
- (dst->y1 != extents->y1) || (dst->y2 != extents->y2))
- {
- RegionRec clipReg;
- REGION_INIT(DummyScreen, &clipReg, dst, 1);
- REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
- REGION_UNINIT(DummyScreen, &clipReg);
- }
- return TRUE;
-}
-
-
static void S3StopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit)
{
S3Ptr pS3 = S3PTR(pScrn);
@@ -510,8 +367,6 @@ static int S3PutImage(ScrnInfoPtr pScrn, short src_x, short src_y,
int top, left, npixels, nlines;
BoxRec dstBox;
CARD32 tmp;
- static int once = 1;
- static int once2 = 1;
/* Clip */
x1 = src_x;
@@ -524,7 +379,8 @@ static int S3PutImage(ScrnInfoPtr pScrn, short src_x, short src_y,
dstBox.y1 = drw_y;
dstBox.y2 = drw_y + drw_h;
- if(!S3ClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height))
+ if(!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2,
+ clipBoxes, width, height))
return Success;
/*if(!pMga->TexturedVideo) {*/
@@ -577,28 +433,24 @@ static int S3PutImage(ScrnInfoPtr pScrn, short src_x, short src_y,
offset3 = tmp;
}
nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
- S3CopyMungedData(buf + (top * srcPitch) + (left >> 1),
- buf + offset2, buf + offset3, dst_start,
- srcPitch, srcPitch2, dstPitch, nlines, npixels);
- once2 = 0;
+ xf86XVCopyYUV12ToPacked(buf + (top * srcPitch) + (left >> 1),
+ buf + offset2, buf + offset3, dst_start,
+ srcPitch, srcPitch2, dstPitch, nlines, npixels);
break;
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
buf += (top * srcPitch) + left;
nlines = ((y2 + 0xffff) >> 16) - top;
- S3CopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
- once = 0;
+ xf86XVCopyPacked(buf, dst_start, srcPitch, dstPitch, nlines, npixels);
break;
}
/* update cliplist */
- if(!RegionsEqual(&pPriv->clip, clipBoxes)) {
- REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
+ if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) {
+ REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes);
/* draw these */
- (*pS3->pXAA->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0,
- REGION_NUM_RECTS(clipBoxes),
- REGION_RECTS(clipBoxes));
+ xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
}
offset += left + (top * dstPitch);