From 0c93a0cf41cbfe88b18e9e69bd97bd75cf2404bd Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 28 Jun 2013 00:35:14 +0100 Subject: [PATCH] sna: Compensate redirect drawing subrectangle inside an offset pixmap Reported-by: Clemens Eisserer Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66249 Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index db159fd3..dd757dd9 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -1911,10 +1911,15 @@ sna_render_composite_redirect(struct sna *sna, DBG(("%s: dst pitch (%d) fits within render pipeline (%d)\n", __FUNCTION__, op->dst.bo->pitch, sna->render.max_3d_pitch)); - box.x1 = x; - box.x2 = bound(x, width); - box.y1 = y; - box.y2 = bound(y, height); + box.x1 = x + op->dst.x; + box.x2 = bound(box.x1, width); + box.y1 = y + op->dst.y; + box.y2 = bound(box.y1, height); + + if (box.x1 < 0) + box.x1 = 0; + if (box.y1 < 0) + box.y1 = 0; /* Ensure we align to an even tile row */ if (op->dst.bo->tiling) {