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

Chris Wilson ickle at kemper.freedesktop.org
Thu Feb 27 00:41:09 PST 2014


 src/sna/sna_accel.c |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

New commits:
commit 37d080929a20bd969749c6c12d1ef4ebe236063f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 27 08:36:40 2014 +0000

    sna: Limit the WHOLE_HINT to large PutImages
    
    The goal here is to predict when we are uploading an entire image though
    multiple PutImage requests. If the image is small enough, then the
    PutImage will be contained within a single request and the damage
    tracking will be accurate.
    
    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 9ead602..6359de1 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4584,7 +4584,7 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 		return true;
 
 	hint = MOVE_WRITE;
-	if (w == pixmap->drawable.width)
+	if (w == pixmap->drawable.width && h*stride > 4096)
 		hint |= MOVE_WHOLE_HINT;
 
 	if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, region, hint))
commit 27ac9f574f65cbd535751c925e9b2e2d7c8a6b3a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 27 08:33:52 2014 +0000

    sna: Avoid promoting region-to-whole migration and discarding damage
    
    Fixes regression from
    commit 1de1104064b5898cbed37e836901694a381c1266
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Fri Feb 21 22:43:04 2014 +0000
    
        sna: Use a hint to do whole image uploads inplace
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75549
    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 abc3b85..9ead602 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2495,10 +2495,10 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		flags |= MOVE_INPLACE_HINT;
 	}
 
-	if (flags & MOVE_WHOLE_HINT)
+	if (flags & MOVE_WHOLE_HINT && priv->gpu_damage == NULL)
 		return _sna_pixmap_move_to_cpu(pixmap, flags);
 
-	if (priv->gpu_bo == NULL &&
+	if (priv->gpu_damage == NULL &&
 	    (priv->create & KGEM_CAN_CREATE_GPU) == 0 &&
 	    flags & MOVE_WRITE)
 		return _sna_pixmap_move_to_cpu(pixmap, flags);
@@ -2522,6 +2522,24 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		return _sna_pixmap_move_to_cpu(pixmap, flags);
 	}
 
+	if ((flags & MOVE_READ) == 0 &&
+	    priv->gpu_damage &&
+	    region_subsumes_damage(region, priv->gpu_damage)) {
+		DBG(("%s: region [(%d, %d), (%d, %d)] subsumes damage [(%d,%d), (%d, %d)]\n",
+		       __FUNCTION__,
+		       region->extents.x1,
+		       region->extents.y1,
+		       region->extents.x2,
+		       region->extents.y2,
+		       priv->gpu_damage->extents.x1,
+		       priv->gpu_damage->extents.y1,
+		       priv->gpu_damage->extents.x2,
+		       priv->gpu_damage->extents.y2));
+		if (dx | dy)
+			RegionTranslate(region, -dx, -dy);
+		return _sna_pixmap_move_to_cpu(pixmap, flags);
+	}
+
 	if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, MOVE_READ)) {
 		DBG(("%s: move-to-gpu override failed\n", __FUNCTION__));
 		if (dx | dy)


More information about the xorg-commit mailing list