xf86-video-intel: src/sna/sna_blt.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Nov 27 03:31:17 PST 2012


 src/sna/sna_blt.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit b2c9e9da639a134577485f83e0f66f54e2371b98
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Nov 27 11:32:11 2012 +0000

    sna/blt: Avoid clobbering common state before converting to a BLT
    
    In case we need to continue on with the render operation, we need to
    preserve the existing state.
    
    Reported-by: Jiri Slaby <jirislaby at gmail.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=57601
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index ea11d00..a260423 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1961,6 +1961,7 @@ sna_blt_composite__convert(struct sna *sna,
 			   struct sna_composite_op *tmp)
 {
 	uint32_t alpha_fixup;
+	int sx, sy;
 	uint8_t op;
 
 #if DEBUG_NO_BLT || NO_BLT_COMPOSITE
@@ -2011,12 +2012,11 @@ sna_blt_composite__convert(struct sna *sna,
 		return false;
 	}
 
-	tmp->u.blt.src_pixmap = NULL;
-	tmp->u.blt.sx = tmp->src.offset[0];
-	tmp->u.blt.sy = tmp->src.offset[1];
+	sx = tmp->src.offset[0];
+	sy = tmp->src.offset[1];
 
-	x += tmp->src.offset[0];
-	y += tmp->src.offset[1];
+	x += sx;
+	y += sy;
 	if (x < 0 || y < 0 ||
 	    x + width  > tmp->src.width ||
 	    y + height > tmp->src.height) {
@@ -2034,8 +2034,8 @@ sna_blt_composite__convert(struct sna *sna,
 			    yy + height > tmp->src.height)
 				return false;
 
-			tmp->u.blt.sx += xx - x;
-			tmp->u.blt.sy += yy - y;
+			sx += xx - x;
+			sy += yy - y;
 		} else
 			return false;
 	}
@@ -2054,6 +2054,10 @@ sna_blt_composite__convert(struct sna *sna,
 	     __FUNCTION__,
 	     tmp->dst.x, tmp->dst.y, tmp->u.blt.sx, tmp->u.blt.sy, alpha_fixup));
 
+	tmp->u.blt.src_pixmap = NULL;
+	tmp->u.blt.sx = sx;
+	tmp->u.blt.sy = sy;
+
 	if (alpha_fixup) {
 		tmp->blt   = blt_composite_copy_with_alpha;
 		tmp->box   = blt_composite_copy_box_with_alpha;


More information about the xorg-commit mailing list