summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c71
1 files changed, 37 insertions, 34 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c
index b9ca76492..5b9ff4479 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c,v 1.10 1999/09/25 14:37:32 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_colexp.c,v 1.12 2000/08/08 08:58:06 eich Exp $ */
@@ -237,8 +237,8 @@ TsengXAAInit_Colexp(ScrnInfoPtr pScrn)
TsengSubsequentCPUToScreenColorExpandFill;
/* we'll be using MMU aperture 2 */
- pXAAInfo->ColorExpandBase = tsengCPU2ACLBase;
- /* ErrorF("tsengCPU2ACLBase = 0x%x\n", tsengCPU2ACLBase); */
+ pXAAInfo->ColorExpandBase = (CARD8 *)pTseng->tsengCPU2ACLBase;
+ /* ErrorF("tsengCPU2ACLBase = 0x%x\n", pTseng->tsengCPU2ACLBase); */
/* aperture size is 8kb in banked mode. Larger in linear mode, but 8kb is enough */
pXAAInfo->ColorExpandRange = 8192;
}
@@ -248,12 +248,12 @@ TsengXAAInit_Colexp(ScrnInfoPtr pScrn)
#define SET_FUNCTION_COLOREXPAND \
if (Is_ET6K) \
- *ACL_MIX_CONTROL = 0x32; \
+ ACL_MIX_CONTROL(0x32); \
else \
- *ACL_ROUTING_CONTROL = 0x08;
+ ACL_ROUTING_CONTROL(0x08);
#define SET_FUNCTION_COLOREXPAND_CPU \
- *ACL_ROUTING_CONTROL = 0x02;
+ ACL_ROUTING_CONTROL(0x02);
static CARD32 ColorExpandDst;
static int ce_skipleft;
@@ -282,7 +282,7 @@ TsengSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
wait_acl_queue(pTseng);
#if 0
- *ACL_MIX_Y_OFFSET = w - 1;
+ ACL_MIX_Y_OFFSET(w - 1);
ErrorF(" W=%d", w);
#endif
@@ -297,7 +297,7 @@ TsengSubsequentColorExpandScanline(ScrnInfoPtr pScrn,
wait_acl_queue(pTseng);
- *ACL_MIX_ADDRESS = (pTseng->AccelColorExpandBufferOffsets[bufno] << 3) + ce_skipleft;
+ ACL_MIX_ADDRESS((pTseng->AccelColorExpandBufferOffsets[bufno] << 3) + ce_skipleft);
START_ACL(pTseng, ColorExpandDst);
/* move to next scanline */
@@ -326,8 +326,8 @@ TsengSubsequentColorExpandScanline(ScrnInfoPtr pScrn,
void TsengSubsequentColorExpandScanline_8bpp(ScrnInfoPtr pScrn, int bufno)
{
TsengPtr pTseng = TsengPTR(pScrn);
- CARD8 *dest = (CARD8 *) tsengCPU2ACLBase;
- int i;
+ memType dest = pTseng->tsengCPU2ACLBase;
+ int i,j;
CARD8 *bufptr;
i = colexp_width_bytes;
@@ -337,11 +337,11 @@ void TsengSubsequentColorExpandScanline_8bpp(ScrnInfoPtr pScrn, int bufno)
START_ACL (pTseng, ColorExpandDst);
/* *((LongP) (MMioBase + 0x08)) = (CARD32) ColorExpandDst;*/
-/* *(CARD32*)tsengCPU2ACLBase = (CARD32)ColorExpandDst; */
-
+/* MMIO_OUT32(tsengCPU2ACLBase,0, (CARD32)ColorExpandDst); */
+ j = 0;
/* Copy scanline data to accelerator MMU aperture byte by byte */
while (i--) { /* FIXME: we need to take care of PCI bursting and MMU overflow here! */
- *dest++ = *bufptr++;
+ MMIO_OUT8(dest,j++, *bufptr++);
}
/* move to next scanline */
@@ -357,21 +357,22 @@ void TsengSubsequentColorExpandScanline_8bpp(ScrnInfoPtr pScrn, int bufno)
void TsengSubsequentColorExpandScanline_16bpp(ScrnInfoPtr pScrn, int bufno)
{
TsengPtr pTseng = TsengPTR(pScrn);
- CARD8 *dest = (CARD8 *) tsengCPU2ACLBase;
- int i;
+ memType dest = pTseng->tsengCPU2ACLBase;
+ int i,j;
CARD8 *bufptr;
register CARD32 bits16;
-
+
i = colexp_width_dwords * 2;
bufptr = (CARD8 *) (pTseng->XAAScanlineColorExpandBuffers[bufno]);
wait_acl_queue(pTseng);
START_ACL(pTseng, ColorExpandDst);
+ j = 0;
while (i--) {
bits16 = pTseng->ColExpLUT[*bufptr++];
- *dest++ = bits16 & 0xFF;
- *dest++ = (bits16 >> 8) & 0xFF;
+ MMIO_OUT8(dest,j++,bits16 & 0xFF);
+ MMIO_OUT8(dest,j++,(bits16 >> 8) & 0xFF);
}
/* move to next scanline */
@@ -387,8 +388,8 @@ void TsengSubsequentColorExpandScanline_16bpp(ScrnInfoPtr pScrn, int bufno)
void TsengSubsequentColorExpandScanline_24bpp(ScrnInfoPtr pScrn, int bufno)
{
TsengPtr pTseng = TsengPTR(pScrn);
- CARD8 *dest = (CARD8 *) tsengCPU2ACLBase;
- int i, j = -1;
+ memType dest = pTseng->tsengCPU2ACLBase;
+ int i, k, j = -1;
CARD8 *bufptr;
register CARD32 bits24;
@@ -400,12 +401,13 @@ void TsengSubsequentColorExpandScanline_24bpp(ScrnInfoPtr pScrn, int bufno)
/* take 8 input bits, expand to 3 output bytes */
bits24 = pTseng->ColExpLUT[*bufptr++];
+ k = 0;
while (i--) {
if ((j++) == 2) { /* "i % 3" operation is much to expensive */
j = 0;
bits24 = pTseng->ColExpLUT[*bufptr++];
}
- *dest++ = bits24 & 0xFF;
+ MMIO_OUT8(dest,k++,bits24 & 0xFF);
bits24 >>= 8;
}
@@ -422,8 +424,8 @@ void TsengSubsequentColorExpandScanline_24bpp(ScrnInfoPtr pScrn, int bufno)
void TsengSubsequentColorExpandScanline_32bpp(ScrnInfoPtr pScrn, int bufno)
{
TsengPtr pTseng = TsengPTR(pScrn);
- CARD8 *dest = (CARD8 *) tsengCPU2ACLBase;
- int i;
+ memType dest = pTseng->tsengCPU2ACLBase;
+ int i,j;
CARD8 *bufptr;
register CARD32 bits32;
@@ -433,12 +435,13 @@ void TsengSubsequentColorExpandScanline_32bpp(ScrnInfoPtr pScrn, int bufno)
wait_acl_queue(pTseng);
START_ACL(pTseng, ColorExpandDst);
+ j = 0;
while (i--) {
bits32 = pTseng->ColExpLUT[*bufptr++];
- *dest++ = bits32 & 0xFF;
- *dest++ = (bits32 >> 8) & 0xFF;
- *dest++ = (bits32 >> 16) & 0xFF;
- *dest++ = (bits32 >> 24) & 0xFF;
+ MMIO_OUT8(dest,j++,bits32 & 0xFF);
+ MMIO_OUT8(dest,j++,(bits32 >> 8) & 0xFF);
+ MMIO_OUT8(dest,j++,(bits32 >> 16) & 0xFF);
+ MMIO_OUT8(dest,j++,(bits32 >> 24) & 0xFF);
}
/* move to next scanline */
@@ -457,7 +460,7 @@ void TsengSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
/* ErrorF("X"); */
- PINGPONG();
+ PINGPONG(pTseng);
wait_acl_queue(pTseng);
@@ -471,7 +474,7 @@ void TsengSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
SET_FUNCTION_COLOREXPAND_CPU;
/* assure correct alignment of MIX address (ACL needs same alignment here as in MMU aperture) */
- *ACL_MIX_ADDRESS = 0;
+ ACL_MIX_ADDRESS(0);
}
/*
@@ -498,7 +501,7 @@ void TsengSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
ErrorF("=========WAIT FIXME!\n");
WAIT_INTERFACE;
- *ACL_MIX_Y_OFFSET = w - 1;
+ ACL_MIX_Y_OFFSET(w - 1);
SET_XY(pTseng, w, h);
START_ACL(pTseng, destaddr);
}
@@ -512,7 +515,7 @@ TsengSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
/* ErrorF("SSC "); */
- PINGPONG();
+ PINGPONG(pTseng);
wait_acl_queue(pTseng);
@@ -538,10 +541,10 @@ TsengSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
wait_acl_queue(pTseng);
SET_XY(pTseng, w, h);
- *ACL_MIX_ADDRESS = /* MIX address is in BITS */
- (((srcy * pScrn->displayWidth) + srcx) * pScrn->bitsPerPixel) + skipleft;
+ ACL_MIX_ADDRESS( /* MIX address is in BITS */
+ (((srcy * pScrn->displayWidth) + srcx) * pScrn->bitsPerPixel) + skipleft);
- *ACL_MIX_Y_OFFSET = pTseng->line_width << 3;
+ ACL_MIX_Y_OFFSET(pTseng->line_width << 3);
START_ACL(pTseng, destaddr);
}