Module Name:    xsrc
Committed By:   macallan
Date:           Sun Aug 16 17:47:39 UTC 2015

Modified Files:
        xsrc/external/mit/xf86-video-sunffb/dist/src: ffb.h ffb_accel.c
            ffb_exa.c
Added Files:
        xsrc/external/mit/xf86-video-sunffb/dist/src: ffb_accel_common.c

Log Message:
- move some routines used by both XAA and EXA to their own file
- enable hardware prefetch when reading from video memory - now blits in EXA
  are no longer slower than in XAA
- start fleshing out Xrender routines


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xf86-video-sunffb/dist/src/ffb.h
cvs rdiff -u -r1.4 -r1.5 \
    xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel.c
cvs rdiff -u -r0 -r1.1 \
    xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel_common.c
cvs rdiff -u -r1.1 -r1.2 \
    xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_exa.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-sunffb/dist/src/ffb.h
diff -u xsrc/external/mit/xf86-video-sunffb/dist/src/ffb.h:1.6 xsrc/external/mit/xf86-video-sunffb/dist/src/ffb.h:1.7
--- xsrc/external/mit/xf86-video-sunffb/dist/src/ffb.h:1.6	Tue Aug 11 03:57:36 2015
+++ xsrc/external/mit/xf86-video-sunffb/dist/src/ffb.h	Sun Aug 16 17:47:39 2015
@@ -206,9 +206,13 @@ typedef struct {
 
 	/* EXA stuff */
 	ExaDriverPtr 	pExa;
-	int srcpitch, srcoff;
 	int xdir, ydir, rop;
-	CARD32 planemask, fbc, wid;
+	CARD32 planemask, fbc, wid, fillcolour;
+	Bool no_source_pixmap, source_is_solid;
+	int srcoff, srcpitch, mskoff, mskpitch;
+	CARD32 srcformat, dstformat, mskformat;
+	int op;
+
 
 	PixmapPtr pix32, pix8;
 
@@ -298,4 +302,9 @@ do {	fprintf __x; 				\
 #define FFBLOG(__x)		do { } while(0)
 #endif
 
+/* common acceleration routines */
+void FFB_SetupTextureAttrs(FFBPtr);
+void FFB_HardwareSetup(FFBPtr);
+void CreatorAlignTabInit(FFBPtr);
+
 #endif /* FFB_H */

Index: xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel.c
diff -u xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel.c:1.4 xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel.c:1.5
--- xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel.c:1.4	Tue Aug 11 03:57:36 2015
+++ xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel.c	Sun Aug 16 17:47:39 2015
@@ -142,28 +142,6 @@ static CARD32 FFBAlphaTextureFormats[2] 
 static CARD32 FFBTextureFormats[2] = { PICT_a8b8g8r8, 0 };
 static CARD32 FFBTextureDstFormats[3] = { PICT_a8b8g8r8, PICT_x8b8g8r8, 0 };
 
-static void FFB_SetupTextureAttrs(FFBPtr pFfb)
-{
-       ffb_fbcPtr ffb = pFfb->regs;
-       unsigned int ppc = FFB_PPC_APE_DISABLE | FFB_PPC_CS_VAR | FFB_PPC_XS_VAR;
-       unsigned int ppc_mask = FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK;
-       unsigned int rop = FFB_ROP_NEW | (FFB_ROP_NEW << 8);
-       unsigned int fbc = pFfb->fbc;
-       unsigned int wid = pFfb->wid;
-
-       ppc |= FFB_PPC_ABE_ENABLE;
-       ppc_mask |= FFB_PPC_ABE_MASK;
-
-       if ((pFfb->ppc_cache & ppc_mask) != ppc ||
-           pFfb->fbc_cache != fbc ||
-           pFfb->wid_cache != wid ||
-           pFfb->rop_cache != rop ||
-           pFfb->pmask_cache != 0xffffffff)
-               __FFB_Attr_SFB_VAR(pFfb, ppc, ppc_mask, fbc,
-                                  wid, rop, 0xffffffff);
-       FFBWait(pFfb, ffb);
-}
-
 static Bool FFB_SetupForCPUToScreenAlphaTexture(
 	ScrnInfoPtr	pScrn,
 	int		op,
@@ -808,21 +786,6 @@ static void FFB_Sync(ScrnInfoPtr pScrn)
        FFBWait(pFfb, ffb);
 }
 
-/* Multiplies and divides suck... */
-static void CreatorAlignTabInit(FFBPtr pFfb)
-{
-	struct fastfill_parms *ffp = &FFB_FFPARMS(pFfb);
-	short *tab = pFfb->Pf_AlignTab;
-	int i;
-
-	for(i = 0; i < 0x800; i++) {
-		int alignval;
-
-		alignval = (i / ffp->pagefill_width) * ffp->pagefill_width;
-		*tab++ = alignval;
-	}
-}
-
 #endif
 
 Bool FFBAccelInit(ScreenPtr pScreen, FFBPtr pFfb)
@@ -961,66 +924,7 @@ Bool FFBAccelInit(ScreenPtr pScreen, FFB
 		"FFB: cfg0(%08x) cfg1(%08x) cfg2(%08x) cfg3(%08x) ppcfg(%08x)\n",
 		ffb->fbcfg0, ffb->fbcfg1, ffb->fbcfg2, ffb->fbcfg3, ffb->ppcfg));
 
-	/* Determine the current screen resolution type.  This is
-	 * needed to figure out the fastfill/pagefill parameters.
-	 */
-	switch(ffb->fbcfg0 & FFB_FBCFG0_RES_MASK) {
-	default:
-	case FFB_FBCFG0_RES_STD:
-		pFfb->ffb_res = ffb_res_standard;
-		break;
-	case FFB_FBCFG0_RES_HIGH:
-		pFfb->ffb_res = ffb_res_high;
-		break;
-	case FFB_FBCFG0_RES_STEREO:
-		pFfb->ffb_res = ffb_res_stereo;
-		break;
-	case FFB_FBCFG0_RES_PRTRAIT:
-		pFfb->ffb_res = ffb_res_portrait;
-		break;
-	};
-	CreatorAlignTabInit(pFfb);
-
-	/* Next, determine the hwbug workarounds and feature enables
-	 * we should be using on this board.
-	 */
-	pFfb->disable_pagefill = 0;
-	pFfb->disable_vscroll = 0;
-	pFfb->has_brline_bug = 0;
-	pFfb->use_blkread_prefetch = 0;
-	if (pFfb->ffb_type == ffb1_prototype ||
-	    pFfb->ffb_type == ffb1_standard ||
-	    pFfb->ffb_type == ffb1_speedsort) {
-		pFfb->has_brline_bug = 1;
-		if (pFfb->ffb_res == ffb_res_high)
-			pFfb->disable_vscroll = 1;
-		if (pFfb->ffb_res == ffb_res_high ||
-		    pFfb->ffb_res == ffb_res_stereo)
-			pFfb->disable_pagefill = 1;
-
-	} else {
-		/* FFB2 has blkread prefetch.  AFB supposedly does too
-		 * but the chip locks up on me when I try to use it. -DaveM
-		 */
-#define AFB_PREFETCH_IS_BUGGY	1
-		if (!AFB_PREFETCH_IS_BUGGY ||
-		    (pFfb->ffb_type != afb_m3 &&
-		     pFfb->ffb_type != afb_m6)) {
-			pFfb->use_blkread_prefetch = 1;
-		}
-		/* XXX I still cannot get page/block fast fills
-		 * XXX to work reliably on any of my AFB boards. -DaveM
-		 */
-#define AFB_FASTFILL_IS_BUGGY	1
-		if (AFB_FASTFILL_IS_BUGGY &&
-		    (pFfb->ffb_type == afb_m3 ||
-		     pFfb->ffb_type == afb_m6))
-			pFfb->disable_pagefill = 1;
-	}
-	pFfb->disable_fastfill_ap = 0;
-	if (pFfb->ffb_res == ffb_res_stereo ||
-	    pFfb->ffb_res == ffb_res_high)
-		pFfb->disable_fastfill_ap = 1;
+	FFB_HardwareSetup(pFfb);
 
 	pFfb->ppc_cache = (FFB_PPC_FW_DISABLE |
 			   FFB_PPC_VCE_DISABLE | FFB_PPC_APE_DISABLE | FFB_PPC_CS_CONST |

Index: xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_exa.c
diff -u xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_exa.c:1.1 xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_exa.c:1.2
--- xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_exa.c:1.1	Tue Aug 11 03:57:36 2015
+++ xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_exa.c	Sun Aug 16 17:47:39 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ffb_exa.c,v 1.1 2015/08/11 03:57:36 macallan Exp $ */
+/* $NetBSD: ffb_exa.c,v 1.2 2015/08/16 17:47:39 macallan Exp $ */
 /*
  * Copyright (c) 2015 Michael Lorenz
  * All rights reserved.
@@ -55,6 +55,12 @@ extern void VISmoveImageLR(unsigned char
 #define DPRINTF while (0) xf86Msg
 #endif
 
+#define arraysize(ary)        (sizeof(ary) / sizeof(ary[0]))
+
+int src_formats[] = {PICT_a8r8g8b8, PICT_x8r8g8b8,
+		     PICT_a8b8g8r8, PICT_x8b8g8r8, PICT_a8};
+int tex_formats[] = {PICT_a8r8g8b8, PICT_a8b8g8r8, PICT_a8};
+
 static void
 FFBWaitMarker(ScreenPtr pScreen, int Marker)
 {
@@ -107,6 +113,13 @@ FFBCopy(PixmapPtr pDstPixmap,
 		return;
 	}
 	FFB_ATTR_SFB_VAR_XAA(pFfb, pFfb->planemask, pFfb->rop);
+	if (pFfb->use_blkread_prefetch) {
+		FFBFifo(pFfb, 1);
+		if (pFfb->xdir < 0)
+			ffb->mer = FFB_MER_EDRA;
+		else
+			ffb->mer = FFB_MER_EIRA;
+	}
 	FFBWait(pFfb, ffb);
 	sfb32 = (unsigned char *) pFfb->sfb32;
 	src = sfb32 + (srcY * (2048 << psz_shift)) + (srcX << psz_shift);
@@ -123,6 +136,10 @@ FFBCopy(PixmapPtr pDstPixmap,
 		VISmoveImageRL(src, dst, w, h, sdkind, sdkind);
 	else
 		VISmoveImageLR(src, dst, w, h, sdkind, sdkind);
+	if (pFfb->use_blkread_prefetch) {
+		FFBFifo(pFfb, 1);
+		ffb->mer = FFB_MER_DRA;
+	}
 }
 
 static void
@@ -203,26 +220,56 @@ FFBDownloadFromScreen(PixmapPtr pSrc, in
 
 	ENTER;
 	FFB_ATTR_SFB_VAR_XAA(pFfb, 0xffffffff, GXcopy);
+	if (pFfb->use_blkread_prefetch) {
+		FFBFifo(pFfb, 1);
+		ffb->mer = FFB_MER_EIRA;
+	}
 	FFBWait(pFfb, ffb);
 
 	sfb32 = (unsigned char *) pFfb->sfb32;
 	src = sfb32 + (y * (2048 << psz_shift)) + (x << psz_shift);
 	VISmoveImageLR(src, dst, w << psz_shift, h,
 		(2048 << psz_shift), dst_pitch);
+	if (pFfb->use_blkread_prefetch) {
+		FFBFifo(pFfb, 1);
+		ffb->mer = FFB_MER_DRA;
+	}
 	return TRUE;
 }
 
-#if 0
-
-Bool
+static Bool
 FFBCheckComposite(int op, PicturePtr pSrcPicture,
                            PicturePtr pMaskPicture,
                            PicturePtr pDstPicture)
 {
-	return FALSE;
+	int i, ok = FALSE;
+
+	ENTER;
+
+	i = 0;
+	while ((i < arraysize(src_formats)) && (!ok)) {
+		ok =  (pSrcPicture->format == src_formats[i]);
+		i++;
+	}
+
+	if (!ok) {
+		xf86Msg(X_ERROR, "%s: unsupported src format %x\n",
+		    __func__, pSrcPicture->format);
+		return FALSE;
+	}
+
+	DPRINTF(X_ERROR, "src is %x, %d: %d %d\n", pSrcPicture->format, op,
+	    pSrcPicture->pDrawable->width, pSrcPicture->pDrawable->height);
+
+	if (pMaskPicture != NULL) {
+		DPRINTF(X_ERROR, "mask is %x %d %d\n", pMaskPicture->format,
+		    pMaskPicture->pDrawable->width,
+		    pMaskPicture->pDrawable->height);
+	}
+	return TRUE;
 }
 
-Bool
+static Bool
 FFBPrepareComposite(int op, PicturePtr pSrcPicture,
                              PicturePtr pMaskPicture,
                              PicturePtr pDstPicture,
@@ -234,10 +281,76 @@ FFBPrepareComposite(int op, PicturePtr p
 	FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn);
 
 	ENTER;
-	return FALSE;
+
+	pFfb->no_source_pixmap = FALSE;
+	pFfb->source_is_solid = FALSE;
+
+	if (pSrcPicture->format == PICT_a1) {
+		xf86Msg(X_ERROR, "src mono, dst %x, op %d\n",
+		    pDstPicture->format, op);
+		if (pMaskPicture != NULL) {
+			xf86Msg(X_ERROR, "msk %x\n", pMaskPicture->format);
+		}
+	}
+	if (pSrcPicture->pSourcePict != NULL) {
+		if (pSrcPicture->pSourcePict->type == SourcePictTypeSolidFill) {
+			pFfb->fillcolour =
+			    pSrcPicture->pSourcePict->solidFill.color;
+			DPRINTF(X_ERROR, "%s: solid src %08x\n",
+			    __func__, pFfb->fillcolour);
+			pFfb->no_source_pixmap = TRUE;
+			pFfb->source_is_solid = TRUE;
+		}
+	}
+	if ((pMaskPicture != NULL) && (pMaskPicture->pSourcePict != NULL)) {
+		if (pMaskPicture->pSourcePict->type ==
+		    SourcePictTypeSolidFill) {
+			pFfb->fillcolour = 
+			   pMaskPicture->pSourcePict->solidFill.color;
+			xf86Msg(X_ERROR, "%s: solid mask %08x\n",
+			    __func__, pFfb->fillcolour);
+		}
+	}
+	if (pMaskPicture != NULL) {
+		pFfb->mskoff = exaGetPixmapOffset(pMask);
+		pFfb->mskpitch = exaGetPixmapPitch(pMask);
+		pFfb->mskformat = pMaskPicture->format;
+	} else {
+		pFfb->mskoff = 0;
+		pFfb->mskpitch = 0;
+		pFfb->mskformat = 0;
+	}
+	if (pSrc != NULL) {
+		pFfb->source_is_solid = 
+		   ((pSrc->drawable.width == 1) && (pSrc->drawable.height == 1));
+		pFfb->srcoff = exaGetPixmapOffset(pSrc);
+		pFfb->srcpitch = exaGetPixmapPitch(pSrc);
+		if (pFfb->source_is_solid) {
+			pFfb->fillcolour = *(uint32_t *)(pFfb->fb + pFfb->srcoff);
+		}
+	}
+	pFfb->srcformat = pSrcPicture->format;
+	pFfb->dstformat = pDstPicture->format;
+	
+	if (pFfb->source_is_solid) {
+		uint32_t temp;
+
+		/* swap solid source as needed */
+		switch (pFfb->srcformat) {
+			case PICT_a8r8g8b8:
+			case PICT_x8r8g8b8:
+				temp = (pFfb->fillcolour & 0x000000ff) << 16;
+				temp |= (pFfb->fillcolour & 0x00ff0000) >> 16;
+				temp |= (pFfb->fillcolour & 0xff00ff00);
+				pFfb->fillcolour = temp;
+				break;
+		}
+	}
+	pFfb->op = op;
+	return TRUE;
 }
 
-void
+static void
 FFBComposite(PixmapPtr pDst, int srcX, int srcY,
                               int maskX, int maskY,
                               int dstX, int dstY,
@@ -248,8 +361,6 @@ FFBComposite(PixmapPtr pDst, int srcX, i
 	exaMarkSync(pDst->drawable.pScreen);
 }
 
-#endif
-
 static Bool
 FFBPrepareAccess(PixmapPtr pPix, int index)
 {
@@ -336,6 +447,7 @@ FFBInitEXA(ScreenPtr pScreen)
 	FFB_ATTR_SFB_VAR_XAA(pFfb, 0xffffffff, GXcopy);
 	FFBWait(pFfb, ffb);
 
+	FFB_HardwareSetup(pFfb);
 	pExa = exaDriverAlloc();
 	if (!pExa)
 		return FALSE;
@@ -371,19 +483,22 @@ FFBInitEXA(ScreenPtr pScreen)
 	pExa->PrepareSolid = FFBPrepareSolid;
 	pExa->Solid = FFBSolid;
 	pExa->DoneSolid = FFBDoneCopy;
+
 	pExa->PrepareCopy = FFBPrepareCopy;
 	pExa->Copy = FFBCopy;
 	pExa->DoneCopy = FFBDoneCopy;
+
 	pExa->UploadToScreen = FFBUploadToScreen;
 	pExa->DownloadFromScreen = FFBDownloadFromScreen;
+
 	pExa->PrepareAccess = FFBPrepareAccess;
 	pExa->FinishAccess = FFBFinishAccess;
-#if 0
-	pExa->CheckComposite = CG14CheckComposite;
-	pExa->PrepareComposite = CG14PrepareComposite;
-	pExa->Composite = CG14Composite;
-	pExa->DoneComposite = CG14DoneCopy;
-#endif
 
+if(0) {
+	pExa->CheckComposite = FFBCheckComposite;
+	pExa->PrepareComposite = FFBPrepareComposite;
+	pExa->Composite = FFBComposite;
+	pExa->DoneComposite = FFBDoneCopy;
+}
 	return exaDriverInit(pScreen, pExa);
 }

Added files:

Index: xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel_common.c
diff -u /dev/null xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel_common.c:1.1
--- /dev/null	Sun Aug 16 17:47:39 2015
+++ xsrc/external/mit/xf86-video-sunffb/dist/src/ffb_accel_common.c	Sun Aug 16 17:47:39 2015
@@ -0,0 +1,144 @@
+/* $NetBSD: ffb_accel_common.c,v 1.1 2015/08/16 17:47:39 macallan Exp $ */
+/*
+ * Copyright (C) 1998,1999,2000 Jakub Jelinek ([email protected])
+ * Copyright (C) 1998 Michal Rehacek ([email protected])
+ * Copyright (C) 1999,2000 David S. Miller ([email protected])
+ * Copyright (C) 2015 Michael Lorenz ([email protected])
+  *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * 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
+ * JAKUB JELINEK, MICHAL REHACEK, OR DAVID MILLER 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.
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+ 
+#include <sys/types.h>
+
+/* all driver need this */
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "compiler.h"
+#include "exa.h"
+
+#include "ffb_fifo.h"
+#include "ffb_rcache.h"
+#include "ffb.h"
+#include "ffb_regs.h"
+
+void FFB_SetupTextureAttrs(FFBPtr pFfb)
+{
+       ffb_fbcPtr ffb = pFfb->regs;
+       unsigned int ppc = FFB_PPC_APE_DISABLE | FFB_PPC_CS_VAR | FFB_PPC_XS_VAR;
+       unsigned int ppc_mask = FFB_PPC_APE_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK;
+       unsigned int rop = FFB_ROP_NEW | (FFB_ROP_NEW << 8);
+       unsigned int fbc = pFfb->fbc;
+       unsigned int wid = pFfb->wid;
+
+       ppc |= FFB_PPC_ABE_ENABLE;
+       ppc_mask |= FFB_PPC_ABE_MASK;
+
+       if ((pFfb->ppc_cache & ppc_mask) != ppc ||
+           pFfb->fbc_cache != fbc ||
+           pFfb->wid_cache != wid ||
+           pFfb->rop_cache != rop ||
+           pFfb->pmask_cache != 0xffffffff)
+               __FFB_Attr_SFB_VAR(pFfb, ppc, ppc_mask, fbc,
+                                  wid, rop, 0xffffffff);
+       FFBWait(pFfb, ffb);
+}
+
+void FFB_HardwareSetup(FFBPtr pFfb)
+{
+       ffb_fbcPtr ffb = pFfb->regs;
+
+	/* Determine the current screen resolution type.  This is
+	 * needed to figure out the fastfill/pagefill parameters.
+	 */
+	switch(ffb->fbcfg0 & FFB_FBCFG0_RES_MASK) {
+	default:
+	case FFB_FBCFG0_RES_STD:
+		pFfb->ffb_res = ffb_res_standard;
+		break;
+	case FFB_FBCFG0_RES_HIGH:
+		pFfb->ffb_res = ffb_res_high;
+		break;
+	case FFB_FBCFG0_RES_STEREO:
+		pFfb->ffb_res = ffb_res_stereo;
+		break;
+	case FFB_FBCFG0_RES_PRTRAIT:
+		pFfb->ffb_res = ffb_res_portrait;
+		break;
+	};
+	CreatorAlignTabInit(pFfb);
+
+	/* Next, determine the hwbug workarounds and feature enables
+	 * we should be using on this board.
+	 */
+	pFfb->disable_pagefill = 0;
+	pFfb->disable_vscroll = 0;
+	pFfb->has_brline_bug = 0;
+	pFfb->use_blkread_prefetch = 0;
+	if (pFfb->ffb_type == ffb1_prototype ||
+	    pFfb->ffb_type == ffb1_standard ||
+	    pFfb->ffb_type == ffb1_speedsort) {
+		pFfb->has_brline_bug = 1;
+		if (pFfb->ffb_res == ffb_res_high)
+			pFfb->disable_vscroll = 1;
+		if (pFfb->ffb_res == ffb_res_high ||
+		    pFfb->ffb_res == ffb_res_stereo)
+			pFfb->disable_pagefill = 1;
+
+	} else {
+		/* FFB2 has blkread prefetch.  AFB supposedly does too
+		 * but the chip locks up on me when I try to use it. -DaveM
+		 */
+#define AFB_PREFETCH_IS_BUGGY	1
+		if (!AFB_PREFETCH_IS_BUGGY ||
+		    (pFfb->ffb_type != afb_m3 &&
+		     pFfb->ffb_type != afb_m6)) {
+			pFfb->use_blkread_prefetch = 1;
+		}
+		/* XXX I still cannot get page/block fast fills
+		 * XXX to work reliably on any of my AFB boards. -DaveM
+		 */
+#define AFB_FASTFILL_IS_BUGGY	1
+		if (AFB_FASTFILL_IS_BUGGY &&
+		    (pFfb->ffb_type == afb_m3 ||
+		     pFfb->ffb_type == afb_m6))
+			pFfb->disable_pagefill = 1;
+	}
+	pFfb->disable_fastfill_ap = 0;
+	if (pFfb->ffb_res == ffb_res_stereo ||
+	    pFfb->ffb_res == ffb_res_high)
+		pFfb->disable_fastfill_ap = 1;
+}
+
+/* Multiplies and divides suck... */
+void CreatorAlignTabInit(FFBPtr pFfb)
+{
+	struct fastfill_parms *ffp = &FFB_FFPARMS(pFfb);
+	short *tab = pFfb->Pf_AlignTab;
+	int i;
+
+	for(i = 0; i < 0x800; i++) {
+		int alignval;
+
+		alignval = (i / ffp->pagefill_width) * ffp->pagefill_width;
+		*tab++ = alignval;
+	}
+}
+

Reply via email to