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

Chris Wilson ickle at kemper.freedesktop.org
Tue Jul 30 04:46:51 PDT 2013


 src/sna/sna_dri.c |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

New commits:
commit 7e3445a330340c1aa2ca5a13d838344438336749
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jul 30 11:17:52 2013 +0100

    sna/dri: Tidy up applying damage to the Pixmap when copying regions
    
    Now that we are doing a true move-to-gpu first, we can drop the hacks
    from damage().
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 8d0b424..a48c8d0 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -482,19 +482,9 @@ static void sna_dri_reference_buffer(DRI2Buffer2Ptr buffer)
 	get_private(buffer)->refcnt++;
 }
 
-static void damage(PixmapPtr pixmap, RegionPtr region)
+static void damage(PixmapPtr pixmap, struct sna_pixmap *priv, RegionPtr region)
 {
-	struct sna_pixmap *priv;
-
-	priv = sna_pixmap(pixmap);
-	assert(priv != NULL);
 	assert(priv->gpu_bo);
-
-	if (priv->cow) {
-		sna_pixmap_undo_cow(to_sna_from_pixmap(pixmap), priv,
-				    region ? MOVE_READ : 0);
-	}
-
 	if (DAMAGE_IS_ALL(priv->gpu_damage))
 		return;
 
@@ -779,6 +769,8 @@ __sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
 		priv = sna_pixmap_move_to_gpu(pixmap, flags);
 		if (priv)
 			dst_bo = priv->gpu_bo;
+
+		damage(pixmap, priv, region);
 	} else
 		sync = false;
 
@@ -795,8 +787,6 @@ __sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
 					      &clip.extents));
 	}
 
-	if (dst->attachment == DRI2BufferFrontLeft)
-		damage(pixmap, region);
 	if (region) {
 		boxes = REGION_RECTS(region);
 		n = REGION_NUM_RECTS(region);
@@ -807,6 +797,7 @@ __sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
 		n = 1;
 	}
 	DamageRegionAppend(&pixmap->drawable, region);
+
 	if (wedged(sna)) {
 		sna_dri_copy_fallback(sna, draw->bitsPerPixel,
 				      src_bo, sx, sy,


More information about the xorg-commit mailing list