summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c100
1 files changed, 52 insertions, 48 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c
index d168c1c4b..6f54484b0 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c
@@ -28,7 +28,7 @@
*
* Permedia accelerated options.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c,v 1.21 2001/01/31 16:15:02 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c,v 1.21.2.2 2001/05/29 11:32:23 alanh Exp $ */
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -102,8 +102,6 @@ static void PermediaPolylinesThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
static void PermediaPolySegmentThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC,
int nseg, xSegment *pSeg);
-#define MAX_FIFO_ENTRIES 15
-
void
PermediaInitializeEngine(ScrnInfoPtr pScrn)
{
@@ -217,8 +215,7 @@ PermediaAccelInit(ScreenPtr pScreen)
infoPtr->PolySegmentThinSolid = PermediaPolySegmentThinSolidWrapper;
infoPtr->PolylinesThinSolid = PermediaPolylinesThinSolidWrapper;
- infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY |
- ONLY_LEFT_TO_RIGHT_BITBLT;
+ infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY;
infoPtr->SetupForScreenToScreenCopy = PermediaSetupForScreenToScreenCopy;
infoPtr->SubsequentScreenToScreenCopy = PermediaSubsequentScreenToScreenCopy;
@@ -240,14 +237,14 @@ PermediaAccelInit(ScreenPtr pScreen)
#endif
BIT_ORDER_IN_BYTE_LSBFIRST;
- pGlint->XAAScanlineColorExpandBuffers[0] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
- pGlint->XAAScanlineColorExpandBuffers[1] =
- xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8));
-
- infoPtr->NumScanlineColorExpandBuffers = 2;
+ infoPtr->NumScanlineColorExpandBuffers = 1;
+ pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4)
+ + (pScrn->virtualX
+ * pScrn->bitsPerPixel / 8));
infoPtr->ScanlineColorExpandBuffers =
pGlint->XAAScanlineColorExpandBuffers;
+ pGlint->XAAScanlineColorExpandBuffers[0] =
+ pGlint->IOBase + OutputFIFO + 4;
infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
PermediaSetupForScanlineCPUToScreenColorExpandFill;
@@ -256,7 +253,7 @@ PermediaAccelInit(ScreenPtr pScreen)
infoPtr->SubsequentColorExpandScanline =
PermediaSubsequentColorExpandScanline;
- infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES;
+ infoPtr->ColorExpandRange = pGlint->FIFOSize;
infoPtr->WriteBitmap = PermediaWriteBitmap;
@@ -553,15 +550,11 @@ PermediaWriteBitmap(ScrnInfoPtr pScrn,
register CARD32* pattern;
int dobackground = 0;
- skipleft = 0;
-
w += skipleft;
x -= skipleft;
dwords = (w + 31) >> 5;
-#if 0
PermediaSetClippingRectangle(pScrn, x+skipleft, y, x+w, y+h);
-#endif
GLINT_WAIT(14);
DO_PLANEMASK(planemask);
@@ -620,6 +613,7 @@ PermediaWriteBitmap(ScrnInfoPtr pScrn,
srcpntr += srcwidth;
}
+ PermediaDisableClipping(pScrn);
SET_SYNC_FLAG(infoRec);
}
@@ -678,50 +672,60 @@ PermediaSubsequentScanlineCPUToScreenColorExpandFill(
PermediaSetClippingRectangle(pScrn, x+skipleft, y, x+w, y+h);
#endif
- pGlint->cpucount = y;
- pGlint->cpuheight = h;
+ pGlint->cpucount = h;
- GLINT_WAIT(6);
- PermediaLoadCoord(pScrn, x<<16, y<<16, (x+w)<<16, 1, 0, 1<<16);
+ GLINT_WAIT(8);
+ PermediaLoadCoord(pScrn, x<<16, y<<16, (x+w)<<16, h, 0, 1<<16);
+ GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
+ Render);
+#if defined(__alpha__)
+ if (0) /* force Alpha to use indirect always */
+#else
+ if ((pGlint->dwords*h) < pGlint->FIFOSize)
+#endif
+ {
+ /* Turn on direct for less than FIFOSize dword colour expansion */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4;
+ pGlint->ScanlineDirect = 1;
+ GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO);
+ GLINT_WAIT(pGlint->dwords*h);
+ } else {
+ /* Use indirect for anything else */
+ pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer;
+ pGlint->ScanlineDirect = 0;
+ }
+
+ pGlint->cpucount--;
}
static void
PermediaSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
GLINTPtr pGlint = GLINTPTR(pScrn);
- CARD32 *src;
+ CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
int dwords = pGlint->dwords;
- GLINT_WAIT(7);
- PermediaLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount<<16, pGlint->startxsub, 1, 0, 1<<16);
-
- GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask,
- Render);
- dwords = pGlint->dwords;
-
- src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno];
- while (dwords >= infoRec->ColorExpandRange) {
- GLINT_WAIT(infoRec->ColorExpandRange);
- GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- src, infoRec->ColorExpandRange - 1);
- dwords -= (infoRec->ColorExpandRange - 1);
- src += (infoRec->ColorExpandRange - 1);
- }
- if (dwords) {
- GLINT_WAIT(dwords);
- GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO);
- GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
- src,dwords);
+ if (!pGlint->ScanlineDirect) {
+ while(dwords >= pGlint->FIFOSize) {
+ GLINT_WAIT(pGlint->FIFOSize);
+ GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, pGlint->FIFOSize - 1);
+ dwords -= pGlint->FIFOSize - 1;
+ srcp += pGlint->FIFOSize - 1;
+ }
+ if(dwords) {
+ GLINT_WAIT(dwords + 1);
+ GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO);
+ GLINT_MoveDWORDS(
+ (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4),
+ (CARD32*)srcp, dwords);
+ }
}
- pGlint->cpucount += 1;
-#if 0
- if (pGlint->cpucount == (pGlint->cpuheight + 1))
- CHECKCLIPPING;
-#endif
}
+
static void
PermediaWritePixmap8bpp(
ScrnInfoPtr pScrn,