xf86-video-intel: 5 commits - src/sna/sna_accel.c src/sna/sna_glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Thu May 31 12:48:34 PDT 2012


 src/sna/sna_accel.c  |   56 ++++++++++++++++++++++++++++++++++++---------------
 src/sna/sna_glyphs.c |   32 ++++++++++++++++++++++++++++-
 2 files changed, 71 insertions(+), 17 deletions(-)

New commits:
commit a65c3b7b45df46ba993af6755b2460aa80fde930
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu May 31 19:15:05 2012 +0100

    sna: Add some more DBG for stippled blts
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index d68c59c..3a9f325 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -9758,8 +9758,8 @@ sna_poly_fill_rect_stippled_n_box(struct sna *sna,
 				  struct kgem_bo *bo,
 				  uint32_t br00, uint32_t br13,
 				  GCPtr gc,
-				  BoxRec *box,
-				  DDXPointRec *origin)
+				  const BoxRec *box,
+				  const DDXPointRec *origin)
 {
 	int x1, x2, y1, y2;
 	uint32_t *b;
@@ -9787,8 +9787,13 @@ sna_poly_fill_rect_stippled_n_box(struct sna *sna,
 			bw = ALIGN(bw, 2);
 			bh = y2 - y1;
 
-			DBG(("%s: box(%d, %d), (%d, %d) pat=(%d, %d), up=(%d, %d)\n",
-			     __FUNCTION__, x1, y1, x2, y2, ox, oy, bx1, bx2));
+			DBG(("%s: box((%d, %d)x(%d, %d)) origin=(%d, %d), pat=(%d, %d), up=(%d, %d), stipple=%dx%d\n",
+			     __FUNCTION__,
+			     x1, y1, x2-x1, y2-y1,
+			     origin->x, origin->y,
+			     ox, oy, bx1, bx2,
+			     gc->stipple->drawable.width,
+			     gc->stipple->drawable.height));
 
 			len = bw*bh;
 			len = ALIGN(len, 8) / 4;
@@ -9846,11 +9851,11 @@ sna_poly_fill_rect_stippled_n_blt(DrawablePtr drawable,
 	int16_t dx, dy;
 	uint32_t br00, br13;
 
-	DBG(("%s: upload (%d, %d), (%d, %d), origin (%d, %d), clipped=%d\n", __FUNCTION__,
+	DBG(("%s: upload (%d, %d), (%d, %d), origin (%d, %d), clipped=%d, alu=%d, opaque=%d\n", __FUNCTION__,
 	     extents->x1, extents->y1,
 	     extents->x2, extents->y2,
 	     origin.x, origin.y,
-	     clipped));
+	     clipped, gc->alu, gc->fillStyle == FillOpaqueStippled));
 
 	if (gc->stipple->drawable.width > 32 ||
 	    gc->stipple->drawable.height > 32)
commit b2cc64253217a90cf2ade9a8d6f1ed21b23fe875
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu May 31 19:45:56 2012 +0100

    sna: And combine the two migrate to CPU clauses
    
    Just a small tidy up to remove a duplicated predicate.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index dfe4c5a..d68c59c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1528,22 +1528,23 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		     region->extents.x2 - region->extents.x1,
 		     region->extents.y2 - region->extents.y1));
 
-		if ((flags & MOVE_WRITE) == 0 && priv->cpu_damage == NULL &&
-		    region->extents.x2 - region->extents.x1 == 1 &&
-		    region->extents.y2 - region->extents.y1 == 1) {
-			/*  Often associated with synchronisation, KISS */
-			sna_read_boxes(sna,
-				       priv->gpu_bo, 0, 0,
-				       pixmap, 0, 0,
-				       &region->extents, 1);
-			goto done;
+		if (priv->cpu_damage == NULL) {
+			if ((flags & MOVE_WRITE) == 0 &&
+			    region->extents.x2 - region->extents.x1 == 1 &&
+			    region->extents.y2 - region->extents.y1 == 1) {
+				/*  Often associated with synchronisation, KISS */
+				sna_read_boxes(sna,
+					       priv->gpu_bo, 0, 0,
+					       pixmap, 0, 0,
+					       &region->extents, 1);
+				goto done;
+			}
+		} else {
+			if (sna_damage_contains_box__no_reduce(priv->cpu_damage,
+							       &region->extents))
+				goto done;
 		}
 
-		if (priv->cpu_damage &&
-		    sna_damage_contains_box__no_reduce(priv->cpu_damage,
-						       &region->extents))
-			goto done;
-
 		if (sna_damage_contains_box(priv->gpu_damage,
 					    &region->extents) != PIXMAN_REGION_OUT) {
 			RegionRec want, *r = region;
commit bd1dd4cf663ca230724dc6beb329b7eb270ea9d5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu May 31 17:57:56 2012 +0100

    sna: If the CPU damage already contains the migration region, we are done
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4f4b7b3..dfe4c5a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1539,6 +1539,11 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 			goto done;
 		}
 
+		if (priv->cpu_damage &&
+		    sna_damage_contains_box__no_reduce(priv->cpu_damage,
+						       &region->extents))
+			goto done;
+
 		if (sna_damage_contains_box(priv->gpu_damage,
 					    &region->extents) != PIXMAN_REGION_OUT) {
 			RegionRec want, *r = region;
commit a2d92ade3911e62f950c85b5650fb13da1279ced
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu May 31 17:49:01 2012 +0100

    sna: Prevent readback of 1x1 if it lies inside CPU damage
    
    If the pixel exists only in the CPU damage, attempting to read it back
    from the GPU only results in garbage.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4511ec8..4f4b7b3 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1528,7 +1528,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		     region->extents.x2 - region->extents.x1,
 		     region->extents.y2 - region->extents.y1));
 
-		if ((flags & MOVE_WRITE) == 0 &&
+		if ((flags & MOVE_WRITE) == 0 && priv->cpu_damage == NULL &&
 		    region->extents.x2 - region->extents.x1 == 1 &&
 		    region->extents.y2 - region->extents.y1 == 1) {
 			/*  Often associated with synchronisation, KISS */
@@ -1548,6 +1548,16 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 			     region->extents.x2 - region->extents.x1,
 			     region->extents.y2 - region->extents.y1));
 
+			if ((flags & MOVE_WRITE) == 0 &&
+			    region->extents.x2 - region->extents.x1 == 1 &&
+			    region->extents.y2 - region->extents.y1 == 1) {
+				sna_read_boxes(sna,
+					       priv->gpu_bo, 0, 0,
+					       pixmap, 0, 0,
+					       &region->extents, 1);
+				goto done;
+			}
+
 			/* Expand the region to move 32x32 pixel blocks at a
 			 * time, as we assume that we will continue writing
 			 * afterwards and so aim to coallesce subsequent
@@ -10079,8 +10089,11 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
 		goto fallback;
 	}
 
-	if (!PM_IS_SOLID(draw, gc->planemask))
+	if (!PM_IS_SOLID(draw, gc->planemask)) {
+		DBG(("%s: fallback -- planemask=%#lx (not-solid)\n",
+		     __FUNCTION__, gc->planemask));
 		goto fallback;
+	}
 
 	/* Clear the cpu damage so that we refresh the GPU status of the
 	 * pixmap upon a redraw after a period of inactivity.
commit a34a06c4ba36b21e386b1f6371a4bd3f03ff35a1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu May 31 20:14:38 2012 +0100

    sna/glyphs: Clip the damage to the drawable for unclipped glyphs-to-dst
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 0de1f70..ca70e76 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -415,6 +415,36 @@ static void apply_damage(struct sna_composite_op *op,
 	sna_damage_add_box(op->damage, &box);
 }
 
+static void apply_damage_clipped_to_dst(struct sna_composite_op *op,
+					const struct sna_composite_rectangles *r,
+					DrawablePtr dst)
+{
+	BoxRec box;
+
+	if (op->damage == NULL)
+		return;
+
+	box.x1 = r->dst.x + op->dst.x;
+	box.y1 = r->dst.y + op->dst.y;
+	box.x2 = box.x1 + r->width;
+	box.y2 = box.y1 + r->height;
+
+	if (box.x1 < dst->x)
+		box.x1 = dst->x;
+
+	if (box.x2 > op->dst.width)
+		box.x2 = op->dst.width;
+
+	if (box.y1 < dst->y)
+		box.y1 = dst->y;
+
+	if (box.y2 > op->dst.height)
+		box.y2 = op->dst.height;
+
+	assert_pixmap_contains_box(op->dst.pixmap, &box);
+	sna_damage_add_box(op->damage, &box);
+}
+
 static Bool
 glyphs_to_dst(struct sna *sna,
 	      CARD8 op,
@@ -553,7 +583,7 @@ glyphs_to_dst(struct sna *sna,
 				     r.width, r.height));
 
 				tmp.blt(sna, &tmp, &r);
-				apply_damage(&tmp, &r);
+				apply_damage_clipped_to_dst(&tmp, &r, dst->pDrawable);
 			}
 
 next_glyph:


More information about the xorg-commit mailing list