Module Name: xsrc Committed By: macallan Date: Thu Feb 16 15:05:57 UTC 2017
Modified Files: xsrc/external/mit/xf86-video-chips/dist/src: ct_BltHiQV.h ct_exa.c Log Message: set pixmap pitch alignment to 8 bytes - the blitter will lock up otherwise which isn't mentioned anywhere in the manual. Leave in #ifdef DEBUG code to trace blitter timeouts just in case To generate a diff of this commit: cvs rdiff -u -r1.1.1.3 -r1.2 \ xsrc/external/mit/xf86-video-chips/dist/src/ct_BltHiQV.h cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xf86-video-chips/dist/src/ct_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-chips/dist/src/ct_BltHiQV.h diff -u xsrc/external/mit/xf86-video-chips/dist/src/ct_BltHiQV.h:1.1.1.3 xsrc/external/mit/xf86-video-chips/dist/src/ct_BltHiQV.h:1.2 --- xsrc/external/mit/xf86-video-chips/dist/src/ct_BltHiQV.h:1.1.1.3 Sat Aug 14 08:33:13 2010 +++ xsrc/external/mit/xf86-video-chips/dist/src/ct_BltHiQV.h Thu Feb 16 15:05:57 2017 @@ -65,6 +65,8 @@ * Note that BR04[31] can't be used as some C&T chipsets lockup when reading * the BRxx registers. */ + +#if 0 #define ctBLTWAIT \ {int timeout; \ timeout = 0; \ @@ -79,7 +81,35 @@ if ((cPtr->Chipset < CHIPS_CT69000 && \ (timeout > 100000)) || timeout > 300000) { \ unsigned char tmp; \ - ErrorF("timeout\n"); \ + ErrorF("%s: timeout %d (%d, %d, %d x %d) -> %d, %d \n", __func__, last_op, lx, ly, lw, lh, dx, dy); \ + ErrorF("dir %d %d, pitch %d %d\n", xdir, ydir, lsp, ldp); \ + tmp = cPtr->readXR(cPtr, 0x20); \ + cPtr->writeXR(cPtr, 0x20, ((tmp & 0xFD) | 0x2)); \ + usleep(10000); \ + cPtr->writeXR(cPtr, 0x20, (tmp & 0xFD)); \ + break; \ + } \ + } \ + } +#endif + +/* + * XXX + * we only care about C&T 6555x which can safely use BR04 + */ + +#ifdef DEBUG +#define ctBLTWAIT \ + {int timeout; \ + timeout = 0; \ + for (;;) { \ + if (!(MMIO_IN32(cPtr->MMIOBase,BR(0x4))&(1<<31)))\ + break; \ + timeout++; \ + if (timeout > 300000) { \ + unsigned char tmp; \ + ErrorF("%s: timeout %d (%d, %d, %d x %d) -> %d, %d \n", __func__, last_op, lx, ly, lw, lh, dx, dy); \ + ErrorF("dir %d %d, pitch %d %d\n", xdir, ydir, lsp, ldp); \ tmp = cPtr->readXR(cPtr, 0x20); \ cPtr->writeXR(cPtr, 0x20, ((tmp & 0xFD) | 0x2)); \ usleep(10000); \ @@ -89,6 +119,28 @@ } \ } +#else +#define ctBLTWAIT \ + {int timeout; \ + timeout = 0; \ + for (;;) { \ + if (!(MMIO_IN32(cPtr->MMIOBase,BR(0x4))&(1<<31)))\ + break; \ + timeout++; \ + if (timeout > 300000) { \ + unsigned char tmp; \ + ErrorF("%s: timeout\n", __func__); \ + tmp = cPtr->readXR(cPtr, 0x20); \ + cPtr->writeXR(cPtr, 0x20, ((tmp & 0xFD) | 0x2)); \ + usleep(10000); \ + cPtr->writeXR(cPtr, 0x20, (tmp & 0xFD)); \ + break; \ + } \ + } \ + } + +#endif + #if X_BYTE_ORDER == X_BIG_ENDIAN # define TWEAK_24_BE(c) \ c = ((c & 0xFF0000) >> 16) | (c & 0xFF00) | (( c & 0xFF) << 16) Index: xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c diff -u xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c:1.2 xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c:1.3 --- xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c:1.2 Tue Jan 24 15:47:01 2017 +++ xsrc/external/mit/xf86-video-chips/dist/src/ct_exa.c Thu Feb 16 15:05:57 2017 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $NetBSD: ct_exa.c,v 1.2 2017/01/24 15:47:01 christos Exp $ */ +/* $NetBSD: ct_exa.c,v 1.3 2017/02/16 15:05:57 macallan Exp $ */ #include <sys/types.h> @@ -43,6 +43,7 @@ #ifdef DEBUG #define ENTER xf86Msg(X_ERROR, "%s\n", __func__) #define LEAVE xf86Msg(X_ERROR, "%s done\n", __func__) +int last_op = 0, lx, ly, lw, lh, dx, dy, xdir, ydir, lsp, ldp; #else #define ENTER #define LEAVE @@ -130,12 +131,29 @@ ctCopy ctSETDSTADDR(dst); ctSETHEIGHTWIDTHGO(h, w * cAcl->BytesPerPixel); LEAVE; +#ifdef DEBUG + last_op = 1; + lx = srcX; + ly = srcY; + lw = w; + lh = h; + dx = dstX; + dy = dstY; + xdir = cAcl->xdir; + ydir = cAcl->ydir; + lsp = cAcl->srcpitch; + ldp = dstpitch; +#endif } static void ctDoneCopy(PixmapPtr pDstPixmap) { ENTER; + ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; + CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSACLPtr cAcl = CHIPSACLPTR(pScrn); + ctBLTWAIT; LEAVE; } @@ -180,7 +198,10 @@ ctSolid( ctSETDSTADDR(dst); ctSETSRCADDR(dst); ctSETHEIGHTWIDTHGO(y2 - y1, (x2 - x1) * cAcl->BytesPerPixel); - LEAVE; + LEAVE; +#ifdef DEBUG + last_op = 2; +#endif } /* @@ -270,8 +291,14 @@ CHIPSInitEXA(ScreenPtr pScreen) pExa->memoryBase = cPtr->FbBase; pExa->offScreenBase = cAcl->CacheStart; pExa->memorySize = cAcl->CacheEnd; - pExa->pixmapOffsetAlign = 4; - pExa->pixmapPitchAlign = 4; + + /* + * Contrary to the manual, the blitter needs 8 byte pitch alignment or it + * will lock up. Probably shouldn't be surprised, there are hidden 64bit + * alignment requirements all over the place. + */ + pExa->pixmapOffsetAlign = 8; + pExa->pixmapPitchAlign = 8; pExa->flags = EXA_OFFSCREEN_PIXMAPS;