Module Name: xsrc Committed By: bouyer Date: Sun Nov 26 12:19:22 UTC 2023
Modified Files: xsrc/external/mit/xf86-video-pnozz/dist/src [netbsd-10]: pnozz_exa.c Log Message: Pull up following revision(s) (requested by jdc in ticket #465): external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c: revision 1.5 external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c: revision 1.6 Revert r1.4. The changes are minimal and they cause redraw problems (as reported by Maxim Devaev on port-sparc). Add NetBSD keyword. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.2.1 \ xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_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-pnozz/dist/src/pnozz_exa.c diff -u xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4 xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4.2.1 --- xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4 Wed Jun 9 07:25:57 2021 +++ xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c Sun Nov 26 12:19:22 2023 @@ -1,6 +1,7 @@ /* * SBus Weitek P9100 EXA support - * + */ +/*- * Copyright (c) 2021 The NetBSD Foundation, Inc. * All rights reserved. * @@ -28,6 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +/* $NetBSD: pnozz_exa.c,v 1.4.2.1 2023/11/26 12:19:22 bouyer Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -78,9 +80,11 @@ static CARD32 PnozzDrawROP[] = { #define waitReady(pPnozz) while((pnozz_read_4(pPnozz, ENGINE_STATUS) & \ (ENGINE_BUSY | BLITTER_BUSY)) !=0 ) -/* From pnozz_accel.c */ +void PnozzInitEngine(PnozzPtr); void pnozz_write_colour(PnozzPtr pPnozz, int reg, CARD32 colour); +extern CARD32 MaxClip, junk; + static void PnozzWaitMarker(ScreenPtr pScreen, int Marker) { @@ -107,10 +111,8 @@ PnozzPrepareCopy waitReady(pPnozz); pnozz_write_4(pPnozz, RASTER_OP, (PnozzCopyROP[alu] & 0xff)); pnozz_write_4(pPnozz, PLANE_MASK, planemask); - pPnozz->srcoff = exaGetPixmapOffset(pSrcPixmap); + pPnozz->srcoff = exaGetPixmapOffset(pSrcPixmap) / pPnozz->width; - if (exaGetPixmapPitch(pSrcPixmap) != exaGetPixmapPitch(pDstPixmap)) - return FALSE; return TRUE; } @@ -129,25 +131,24 @@ PnozzCopy ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn); CARD32 src, dst, srcw, dstw; - int soff = pPnozz->srcoff / exaGetPixmapPitch(pDstPixmap); - int doff = exaGetPixmapOffset(pDstPixmap) / exaGetPixmapPitch(pDstPixmap); + int doff = exaGetPixmapOffset(pDstPixmap) / pPnozz->width; src = (((xSrc << pPnozz->depthshift) & 0x1fff) << 16) | - ((ySrc + soff) & 0x1fff); + ((ySrc + pPnozz->srcoff) & 0x1fff); dst = (((xDst << pPnozz->depthshift) & 0x1fff) << 16) | ((yDst + doff) & 0x1fff); - srcw = ((((xSrc + w) << pPnozz->depthshift) - 1) << 16) | - ((ySrc + soff + h) & 0x1fff); + srcw = ((((xSrc + w) << pPnozz->depthshift) - 1) << 16) | + ((ySrc + pPnozz->srcoff + h - 1) & 0x1fff); dstw = ((((xDst + w) << pPnozz->depthshift) - 1) << 16) | - ((yDst + doff + h) & 0x1fff); + ((yDst + doff + h - 1) & 0x1fff); waitReady(pPnozz); + pnozz_write_4(pPnozz, ABS_XY0, src); pnozz_write_4(pPnozz, ABS_XY1, srcw); pnozz_write_4(pPnozz, ABS_XY2, dst); pnozz_write_4(pPnozz, ABS_XY3, dstw); - pnozz_read_4(pPnozz, COMMAND_BLIT); - + junk = pnozz_read_4(pPnozz, COMMAND_BLIT); exaMarkSync(pDstPixmap->drawable.pScreen); } @@ -172,8 +173,7 @@ PnozzPrepareSolid( waitReady(pPnozz); pnozz_write_colour(pPnozz, FOREGROUND_COLOR, fg); - pnozz_write_colour(pPnozz, BACKGROUND_COLOR, fg); - pnozz_write_4(pPnozz, RASTER_OP, ROP_PAT); + pnozz_write_4(pPnozz, RASTER_OP, PnozzDrawROP[alu] & 0xff); pnozz_write_4(pPnozz, PLANE_MASK, planemask); pnozz_write_4(pPnozz, COORD_INDEX, 0); @@ -190,18 +190,15 @@ PnozzSolid( { ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn); - int doff = exaGetPixmapOffset(pPixmap); + int w = x2 - x - 1; + int h = y2 - y - 1; waitReady(pPnozz); - pnozz_write_4(pPnozz, ABS_XY0, (((x + doff) & 0x1fff) << 16) | - (y & 0x1fff)); - pnozz_write_4(pPnozz, ABS_XY1, (((x + doff) & 0x1fff) << 16) | - (y2 & 0x1fff)); - pnozz_write_4(pPnozz, ABS_XY2, (((x2 + doff) & 0x1fff) << 16) | - (y2 & 0x1fff)); - pnozz_write_4(pPnozz, ABS_XY3, (((x2 + doff) & 0x1fff) << 16) | - (y & 0x1fff)); - pnozz_read_4(pPnozz, COMMAND_QUAD); + pnozz_write_4(pPnozz, RECT_RTW_XY, ((x & 0x1fff) << 16) | + (y & 0x1fff)); + pnozz_write_4(pPnozz, RECT_RTP_XY, (((w & 0x1fff) << 16) | + (h & 0x1fff))); + junk = pnozz_read_4(pPnozz, COMMAND_QUAD); exaMarkSync(pPixmap->drawable.pScreen); } @@ -212,6 +209,8 @@ PnozzEXAInit(ScreenPtr pScreen) PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn); ExaDriverPtr pExa; + PnozzInitEngine(pPnozz); + pExa = exaDriverAlloc(); if (!pExa) return FALSE; @@ -225,8 +224,7 @@ PnozzEXAInit(ScreenPtr pScreen) /* round to multiple of pixmap pitch */ pExa->memorySize = (pPnozz->vidmem / pPnozz->width) * pPnozz->width; - pExa->offScreenBase = pPnozz->width * pPnozz->height * - (pScrn->bitsPerPixel / 8); + pExa->offScreenBase = pPnozz->width * pPnozz->height; /* * our blitter can't deal with variable pitches @@ -234,10 +232,10 @@ PnozzEXAInit(ScreenPtr pScreen) pExa->pixmapOffsetAlign = pPnozz->width; pExa->pixmapPitchAlign = pPnozz->width; - pExa->flags = EXA_MIXED_PIXMAPS | EXA_OFFSCREEN_PIXMAPS | EXA_SUPPORTS_OFFSCREEN_OVERLAPS; + pExa->flags = EXA_MIXED_PIXMAPS; - pExa->maxX = 1600; - pExa->maxY = 1200; + pExa->maxX = 4096; + pExa->maxY = 4096; pExa->WaitMarker = PnozzWaitMarker; @@ -249,18 +247,5 @@ PnozzEXAInit(ScreenPtr pScreen) pExa->Copy = PnozzCopy; pExa->DoneCopy = PnozzDoneCopy; - /* Drawing engine defaults */ - pnozz_write_4(pPnozz, DRAW_MODE, 0); - pnozz_write_4(pPnozz, PLANE_MASK, 0xffffffff); - pnozz_write_4(pPnozz, PATTERN0, 0xffffffff); - pnozz_write_4(pPnozz, PATTERN1, 0xffffffff); - pnozz_write_4(pPnozz, PATTERN2, 0xffffffff); - pnozz_write_4(pPnozz, PATTERN3, 0xffffffff); - pnozz_write_4(pPnozz, WINDOW_OFFSET, 0); - pnozz_write_4(pPnozz, WINDOW_MIN, 0); - pnozz_write_4(pPnozz, WINDOW_MAX, CLIP_MAX); - pnozz_write_4(pPnozz, BYTE_CLIP_MIN, 0); - pnozz_write_4(pPnozz, BYTE_CLIP_MAX, CLIP_MAX); - return exaDriverInit(pScreen, pExa);; }