summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-09-27 13:08:41 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-09-27 13:08:41 +0200
commitdc37f91d94b1b580f589cefe40630017bb4d8bb8 (patch)
treec7f1e89f4ce22926f99bff8ca9a37592fa007541
parent820bc604389f0a9eb7de0864766dcb0e977e099a (diff)
EXA: Make sure tile offsets passed to drivers are never negative.no-pci-rework
Thanks to Björn Steinbrink for pointing out the problem on IRC.
-rw-r--r--exa/exa_accel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 3732f88c7..a29f3d082 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1238,7 +1238,8 @@ exaFillRegionTiled (DrawablePtr pDrawable,
int dstY = pBox->y1;
int tileY;
- tileY = (dstY - yoff - pDrawable->y - pPatOrg->y) % tileHeight;
+ modulus(dstY - yoff - pDrawable->y - pPatOrg->y, tileHeight, tileY);
+
while (height > 0) {
int width = pBox->x2 - pBox->x1;
int dstX = pBox->x1;
@@ -1249,7 +1250,9 @@ exaFillRegionTiled (DrawablePtr pDrawable,
h = height;
height -= h;
- tileX = (dstX - xoff - pDrawable->x - pPatOrg->x) % tileWidth;
+ modulus(dstX - xoff - pDrawable->x - pPatOrg->x, tileWidth,
+ tileX);
+
while (width > 0) {
int w = tileWidth - tileX;
if (w > width)