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

Chris Wilson ickle at kemper.freedesktop.org
Mon Nov 14 02:33:48 PST 2011


 src/sna/kgem.c       |   46 ++++++++++++++++++++++++++++++++--------------
 src/sna/sna_damage.c |    5 +++++
 2 files changed, 37 insertions(+), 14 deletions(-)

New commits:
commit 571457e9a4b0941ec956ef98391e96fe90fb4abc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Nov 14 10:31:21 2011 +0000

    sna: Be more thorough discarding fences for large objects
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 2d6760f..c854846 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1345,28 +1345,52 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
 				return I915_TILING_NONE;
 			}
 
-			if (width > 2048 || height > 2048) {
+			if ((width > 2048 || height > 2048) &&
+			    kgem_surface_size(kgem, false,
+					      width, height, bpp, I915_TILING_X,
+					      &pitch) < kgem->max_object_size) {
 				DBG(("%s: large buffer (%dx%d), forcing TILING_X\n",
 				     __FUNCTION__, width, height));
 				return -I915_TILING_X;
 			}
 		}
 	} else {
-		if (width*bpp > (MAXSHORT-512) * 8) {
+		if (width*bpp > (MAXSHORT-512) * 8 &&
+		    kgem_surface_size(kgem, false,
+				      width, height, bpp, I915_TILING_X,
+				      &pitch) < kgem->max_object_size) {
 			DBG(("%s: large pitch [%d], forcing TILING_X\n",
 			     __FUNCTION__, width*bpp/8));
 			return -I915_TILING_X;
 		}
 
-		if (tiling && (width > 8192 || height > 8192)) {
+		if (tiling && (width > 8192 || height > 8192) &&
+		    kgem_surface_size(kgem, false,
+				      width, height, bpp, I915_TILING_X,
+				      &pitch) < kgem->max_object_size) {
 			DBG(("%s: large tiled buffer [%dx%d], forcing TILING_X\n",
 			     __FUNCTION__, width, height));
 			return -I915_TILING_X;
 		}
 	}
 
-	if (tiling < 0)
+	if (tiling < 0) {
+		assert(kgem_surface_size(kgem, false,
+					 width, height, bpp, -tiling,
+					 &pitch) < kgem->max_object_size);
 		return tiling;
+	}
+
+	/* First check that we can fence the whole object */
+	if (tiling &&
+	    kgem_surface_size(kgem, false,
+			      width, height, bpp, tiling,
+			      &pitch) >= kgem->max_object_size) {
+		DBG(("%s: too large (%dx%d) to be fenced, discarding tiling\n",
+		     __FUNCTION__, width, height));
+		tiling = I915_TILING_NONE;
+		goto done;
+	}
 
 	if (tiling == I915_TILING_Y && height <= 16) {
 		DBG(("%s: too short [%d] for TILING_Y\n",
@@ -1384,6 +1408,7 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
 		DBG(("%s: too short [%d] for TILING_X\n",
 		     __FUNCTION__, height));
 		tiling = I915_TILING_NONE;
+		goto done;
 	}
 
 	/* Before the G33, we only have a small GTT to play with and tiled
@@ -1395,24 +1420,17 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
 			DBG(("%s: too thin [%d] for TILING_X\n",
 			     __FUNCTION__, width));
 			tiling = I915_TILING_NONE;
+			goto done;
 		}
 		if (tiling == I915_TILING_Y && width * bpp < 8*32/2) {
 			DBG(("%s: too thin [%d] for TILING_Y\n",
 			     __FUNCTION__, width));
 			tiling = I915_TILING_NONE;
+			goto done;
 		}
 	}
 
-	/* And finally check that we can fence the whole object */
-	if (tiling &&
-	    kgem_surface_size(kgem, false,
-			      width, height, bpp, tiling,
-			      &pitch) >= kgem->max_object_size) {
-		DBG(("%s: too large (%dx%d) to be fenced, discarding tiling\n",
-		     __FUNCTION__, width, height));
-		tiling = I915_TILING_NONE;
-	}
-
+done:
 	DBG(("%s: %dx%d -> %d\n", __FUNCTION__, width, height, tiling));
 	return tiling;
 }
commit e33dfbe3c00e634328adc7319261e5501f4c7a7a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Nov 14 09:41:53 2011 +0000

    sna/damage: Verify that all-damage covers the entire pixmap after reduction
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index 5a4d67c..03bb881 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -947,6 +947,11 @@ struct sna_damage *_sna_damage_is_all(struct sna_damage *damage,
 	if (damage->region.data)
 		return damage;
 
+	assert(damage->extents.x1 == 0 &&
+	       damage->extents.y1 == 0 &&
+	       damage->extents.x2 == width &&
+	       damage->extents.y2 == height);
+
 	return _sna_damage_all(damage, width, height);
 }
 


More information about the xorg-commit mailing list