From 44f848f9b2f2a2dcd9087210ea46bc4fdb63c057 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 11 Aug 2012 19:44:15 +0100 Subject: [PATCH] sna: Fix typo in computation of texel offsets for tiled 8x8 blts Reported-by: Clemens Eisserer Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53353 Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 4e3e9eb5..660c17a3 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -9458,10 +9458,10 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable, sna_damage_add_rectangles(damage, r, n, dx, dy); if (n == 1) { tx = (r->x - origin->x) % 8; - if (tx < 8) + if (tx < 0) tx = 8 - tx; ty = (r->y - origin->y) % 8; - if (ty < 8) + if (ty < 0) ty = 8 - ty; assert(r->x + dx >= 0); @@ -9520,10 +9520,10 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable, assert(r->y + dy + r->height <= pixmap->drawable.height); tx = (r->x - origin->x) % 8; - if (tx < 8) + if (tx < 0) tx = 8 - tx; ty = (r->y - origin->y) % 8; - if (ty < 8) + if (ty < 0) ty = 8 - ty; b[0] = br00 | tx << 12 | ty << 8;