From 69a7737abeded6ee923643bd8a80a5a84e6a979c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 14 Apr 2012 12:06:51 +0100 Subject: [PATCH] sna: Align texture subsurfaces to 2x2 texture samples Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 66e078a2..ec2aaadf 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -839,8 +839,15 @@ sna_render_pixmap_partial(struct sna *sna, box.x2 = ALIGN(box.x2, tile_width * 8 / pixmap->drawable.bitsPerPixel); offset = box.x1 * pixmap->drawable.bitsPerPixel / 8 / tile_width * tile_size; - } else + } else { + box.y1 = box.y1 & ~1; + box.y2 = ALIGN(box.y2, 2); + + box.x1 = box.x1 & ~1; + box.x2 = ALIGN(box.x2, 2); + offset = box.x1 * pixmap->drawable.bitsPerPixel / 8; + } if (box.x2 > pixmap->drawable.width) box.x2 = pixmap->drawable.width;