diff options
author | Benno Schulenberg <bensberg@justemail.net> | 2007-02-16 18:52:42 +0000 |
---|---|---|
committer | Benno Schulenberg <bensberg@justemail.net> | 2007-02-16 18:52:42 +0000 |
commit | d5a078321aa241f20a85104ca6733a527fcb1766 (patch) | |
tree | 0457aefc4017e600d9d9bdc451380c5fe1f672ec | |
parent | dcdbab5efb5801504b1ca9eeb54ad4cece35c9c1 (diff) |
Limit x value to sixteen bits to fix a rendering glitch.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | unichrome/via_accel.c | 20 |
2 files changed, 22 insertions, 10 deletions
@@ -1,3 +1,15 @@ +2007-02-16 Benno Schulenberg <bensberg-at-justemail-dot-net> + + * unichrome/via_accel.c: (viaSetClippingRectangle), + (viaAccelSolidHelper), (viaAccelCopyHelper), + (viaSubsequentMono8x8PatternFillRect), + (viaSubsequentColor8x8PatternFillRect), + (viaSubsequentSolidTwoPointLine), (viaSubsequentSolidHorVertLine): + + Limit x value to sixteen bits. Fixes a rendering glitch reported + by Marg Huijgen <mark-dot-sf-dot-net-at-huijgen-dot-tk>; solution + found by Thomas. + 2007-02-10 Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> * unichrome/via_accel.c: (viaFlushDRIEnabled), diff --git a/unichrome/via_accel.c b/unichrome/via_accel.c index 3a27da3..e4cf82e 100644 --- a/unichrome/via_accel.c +++ b/unichrome/via_accel.c @@ -389,9 +389,9 @@ viaSetClippingRectangle(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2) ViaTwodContext *tdc = &pVia->td; tdc->clipping = TRUE; - tdc->clipX1 = x1; + tdc->clipX1 = (x1 & 0xFFFF); tdc->clipY1 = y1; - tdc->clipX2 = x2; + tdc->clipX2 = (x2 & 0xFFFF); tdc->clipY2 = y2; } @@ -443,7 +443,7 @@ viaAccelSolidHelper(ViaCommandBuffer * cb, int x, int y, int w, int h, OUT_RING_H1(VIA_REG_GEMODE, mode); OUT_RING_H1(VIA_REG_DSTBASE, fbBase >> 3); OUT_RING_H1(VIA_REG_PITCH, VIA_PITCH_ENABLE | (pitch >> 3) << 16); - OUT_RING_H1(VIA_REG_DSTPOS, (y << 16) | x); + OUT_RING_H1(VIA_REG_DSTPOS, (y << 16) | (x & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, ((h - 1) << 16) | (w - 1)); OUT_RING_H1(VIA_REG_FGCOLOR, fg); OUT_RING_H1(VIA_REG_GECMD, cmd); @@ -537,8 +537,8 @@ viaAccelCopyHelper(ViaCommandBuffer * cb, int xs, int ys, int xd, int yd, OUT_RING_H1(VIA_REG_DSTBASE, dstFbBase >> 3); OUT_RING_H1(VIA_REG_PITCH, VIA_PITCH_ENABLE | ((dstPitch >> 3) << 16) | (srcPitch >> 3)); - OUT_RING_H1(VIA_REG_SRCPOS, (ys << 16) | xs); - OUT_RING_H1(VIA_REG_DSTPOS, (yd << 16) | xd); + OUT_RING_H1(VIA_REG_SRCPOS, (ys << 16) | (xs & 0xFFFF)); + OUT_RING_H1(VIA_REG_DSTPOS, (yd << 16) | (xd & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, ((h - 1) << 16) | (w - 1)); OUT_RING_H1(VIA_REG_GECMD, cmd); } @@ -691,7 +691,7 @@ viaSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int patOffx, OUT_RING_H1(VIA_REG_GEMODE, tdc->mode); OUT_RING_H1(VIA_REG_DSTBASE, dstBase >> 3); OUT_RING_H1(VIA_REG_PITCH, VIA_PITCH_ENABLE | ((pVia->Bpl >> 3) << 16)); - OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | x); + OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | (x & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, (((h - 1) << 16) | (w - 1))); OUT_RING_H1(VIA_REG_PATADDR, patOffset); OUT_RING_H1(VIA_REG_FGCOLOR, tdc->fgColor); @@ -741,7 +741,7 @@ viaSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patOffx, OUT_RING_H1(VIA_REG_GEMODE, tdc->mode); OUT_RING_H1(VIA_REG_DSTBASE, dstBase >> 3); OUT_RING_H1(VIA_REG_PITCH, VIA_PITCH_ENABLE | ((pVia->Bpl >> 3) << 16)); - OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | x); + OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | (x & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, (((h - 1) << 16) | (w - 1))); OUT_RING_H1(VIA_REG_PATADDR, patAddr); OUT_RING_H1(VIA_REG_GECMD, tdc->cmd); @@ -923,7 +923,7 @@ viaSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, OUT_RING_H1(VIA_REG_LINE_K1K2, ((((dy << 1) & 0x3fff) << 16) | (((dy - dx) << 1) & 0x3fff))); - OUT_RING_H1(VIA_REG_LINE_XY, ((y1 << 16) | x1)); + OUT_RING_H1(VIA_REG_LINE_XY, ((y1 << 16) | (x1 & 0xFFFF))); OUT_RING_H1(VIA_REG_DIMENSION, dx); OUT_RING_H1(VIA_REG_LINE_ERROR, (((dy << 1) - dx - error) & 0x3fff) | ((tdc->dashed) ? 0xFF0000 : 0)); @@ -951,11 +951,11 @@ viaSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, int x, int y, int len, OUT_RING_H1(VIA_REG_PITCH, VIA_PITCH_ENABLE | ((pVia->Bpl >> 3) << 16)); if (dir == DEGREES_0) { - OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | x); + OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | (x & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, (len - 1)); OUT_RING_H1(VIA_REG_GECMD, tdc->cmd | VIA_GEC_BLT); } else { - OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | x); + OUT_RING_H1(VIA_REG_DSTPOS, ((y - sub) << 16) | (x & 0xFFFF)); OUT_RING_H1(VIA_REG_DIMENSION, ((len - 1) << 16)); OUT_RING_H1(VIA_REG_GECMD, tdc->cmd | VIA_GEC_BLT); } |