xf86-video-intel: 2 commits - src/sna/sna_accel.c src/sna/sna_damage.h

Chris Wilson ickle at kemper.freedesktop.org
Mon Jan 23 03:14:20 PST 2012


 src/sna/sna_accel.c  |   12 +++++++++---
 src/sna/sna_damage.h |    3 +++
 2 files changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 803f6558c665c16ba2d20415e778b5bd1d308c2f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 23 11:05:50 2012 +0000

    sna: Only subtract the fillrect from the CPU damage if it covers the drawable
    
    The idea behind that optimisation is for the inactive pixmap to be
    refreshed and allowed to be transfered back to the GPU when it is
    entirely redrawn. As such performing the subtraction when it does not
    completely remove it only incurs additional overhead.
    
    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 f9b3a48..86b8dfe 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -8735,11 +8735,17 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
 	if (!PM_IS_SOLID(draw, gc->planemask))
 		goto fallback;
 
-	if (n == 1 &&
-	    region_is_singular(gc->pCompositeClip) &&
+	/* Clear the cpu damage so that we refresh the GPU status of the
+	 * pixmap upon a redraw after a period of inactivity.
+	 */
+	if (priv->cpu_damage &&
+	    n == 1 && region_is_singular(gc->pCompositeClip) &&
 	    gc->fillStyle != FillStippled && alu_overwrites(gc->alu)) {
 		region.data = NULL;
-		sna_damage_subtract(&priv->cpu_damage, &region);
+		if (region_subsumes_damage(&region, priv->cpu_damage)) {
+			sna_damage_destroy(&priv->cpu_damage);
+			list_del(&priv->list);
+		}
 	}
 
 	if (gc->fillStyle == FillSolid ||
commit 267493f39137704bd52df65b7605be30d2a062b2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 23 10:54:13 2012 +0000

    sna: Assert that the subtract operation does reduce an all-damaged
    
    Somewhere somewhen it appears that I am discarding the all-damaged flag
    on the pointer. The only possibility I can see is for a no-op
    subtraction, so put an assert there just in case the impossible is
    happening.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h
index 5c003ca..dc0962f 100644
--- a/src/sna/sna_damage.h
+++ b/src/sna/sna_damage.h
@@ -101,6 +101,7 @@ static inline bool sna_damage_is_all(struct sna_damage **_damage,
 	case DAMAGE_SUBTRACT:
 		return false;
 	default:
+		assert(0);
 	case DAMAGE_ADD:
 		if (damage->extents.x2 < width  || damage->extents.x1 > 0)
 			return false;
@@ -140,6 +141,7 @@ static inline void sna_damage_subtract(struct sna_damage **damage,
 				       RegionPtr region)
 {
 	*damage = _sna_damage_subtract(DAMAGE_PTR(*damage), region);
+	assert(*damage == NULL || (*damage)->mode != DAMAGE_ALL);
 }
 
 fastcall struct sna_damage *_sna_damage_subtract_box(struct sna_damage *damage,
@@ -148,6 +150,7 @@ static inline void sna_damage_subtract_box(struct sna_damage **damage,
 					   const BoxRec *box)
 {
 	*damage = _sna_damage_subtract_box(DAMAGE_PTR(*damage), box);
+	assert(*damage == NULL || (*damage)->mode != DAMAGE_ALL);
 }
 
 Bool _sna_damage_intersect(struct sna_damage *damage,


More information about the xorg-commit mailing list