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

Chris Wilson ickle at kemper.freedesktop.org
Thu Apr 24 06:36:10 PDT 2014


 src/sna/kgem.c      |    8 +++++---
 src/sna/sna_accel.c |   18 ++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit b3c5a524965958b5b11a1195e773d10ac9fc6611
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Apr 23 14:23:55 2014 +0100

    sna: Tweak use inplace CPU maps for writing
    
    Allow us to write into a GPU bo without any pending CPU damage.
    
    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 1a42d96..8249e78 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2100,12 +2100,11 @@ skip_inplace_map:
 	sna_pixmap_unmap(pixmap, priv);
 
 	if (USE_INPLACE &&
-	    priv->gpu_damage && priv->cpu_damage == NULL &&
+	    (flags & MOVE_WRITE ? (void *)priv->gpu_bo : (void *)priv->gpu_damage) && priv->cpu_damage == NULL &&
 	    priv->gpu_bo->tiling == I915_TILING_NONE &&
 	    (flags & MOVE_READ || kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE)) &&
 	    ((flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == 0 ||
-	     (!priv->cow && !priv->move_to_gpu &&
-	      !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)))) {
+	     (!priv->cow && !priv->move_to_gpu && !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)))) {
 		void *ptr;
 
 		DBG(("%s: try to operate inplace (CPU)\n", __FUNCTION__));
@@ -2131,8 +2130,8 @@ skip_inplace_map:
 				sna_pixmap_free_cpu(sna, priv, priv->cpu);
 				list_del(&priv->flush_list);
 				priv->clear = false;
+				priv->cpu = true;
 			}
-			priv->cpu = true;
 
 			assert(pixmap->devPrivate.ptr == MAP(priv->gpu_bo->map__cpu));
 			kgem_bo_sync__cpu_full(&sna->kgem, priv->gpu_bo,
commit c872be6cbef3b07dc79fc8f83d719543c0adcdee
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Apr 23 14:23:55 2014 +0100

    sna: INPLACE has early exits in move-to-cpu
    
    We can update the priv->cpu flag more accurately by accounting for the
    early exits for the INPLACE accessors.
    
    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 4c10f1b..1a42d96 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2272,9 +2272,7 @@ done:
 			assert((flags & MOVE_WRITE) == 0 || !kgem_bo_is_busy(priv->cpu_bo));
 		}
 	}
-	priv->cpu =
-		(flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0 &&
-		!DAMAGE_IS_ALL(priv->gpu_damage);
+	priv->cpu |= (flags & (MOVE_WRITE |MOVE_ASYNC_HINT)) == MOVE_WRITE;
 	assert(pixmap->devPrivate.ptr == PTR(priv->ptr));
 	assert(pixmap->devKind);
 	assert_pixmap_damage(pixmap);
@@ -2970,9 +2968,7 @@ out:
 				       FORCE_FULL_SYNC || flags & MOVE_WRITE);
 		assert((flags & MOVE_WRITE) == 0 || !kgem_bo_is_busy(priv->cpu_bo));
 	}
-	priv->cpu =
-		(flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0 &&
-		!DAMAGE_IS_ALL(priv->gpu_damage);
+	priv->cpu |= (flags & (MOVE_WRITE |MOVE_ASYNC_HINT)) == MOVE_WRITE;
 	assert(pixmap->devPrivate.ptr == PTR(priv->ptr));
 	assert(pixmap->devKind);
 	assert_pixmap_damage(pixmap);
commit 05cf93287419992208493f5098fc7b089e95b20c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Apr 23 14:21:39 2014 +0100

    sna: Be more selective of reusing bo for inplace uploads on !LLC
    
    On older architectures, we can only do the inplace upload into a GPU bo
    into a new unused bo (that is still in the GPU domain).
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index d639f6a..5704f9a 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4470,6 +4470,9 @@ large_inactive:
 					continue;
 				}
 
+				if (flags & UNCACHED && !kgem->has_llc && bo->domain != DOMAIN_CPU)
+					continue;
+
 				if (bo->tiling != tiling ||
 				    (tiling != I915_TILING_NONE && bo->pitch != pitch)) {
 					if (bo->map__gtt ||
@@ -4492,7 +4495,6 @@ large_inactive:
 				bo->pitch = pitch;
 				bo->delta = 0;
 				bo->unique_id = kgem_get_unique_id(kgem);
-				bo->domain = DOMAIN_NONE;
 
 				kgem_bo_remove_from_inactive(kgem, bo);
 				assert(list_is_empty(&bo->list));
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 1f1a5a6..4c10f1b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4350,6 +4350,9 @@ create_upload_tiled_x(struct kgem *kgem,
 	tiling = sna_pixmap_choose_tiling(pixmap, I915_TILING_X);
 	assert(tiling != I915_TILING_Y && tiling != -I915_TILING_Y);
 
+	if (!kgem->has_llc && tiling != I915_TILING_NONE)
+		return false;
+
 	assert(priv->gpu_bo == NULL);
 	assert(priv->gpu_damage == NULL);
 
commit cf7efedb32b63901f7e42a90f756899b9ba60e65
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Apr 23 14:20:47 2014 +0100

    sna: Tweak untiled limits
    
    Allow more small pixmaps to use untiled for linear mmappings.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index f982619..d639f6a 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3982,13 +3982,13 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
 		goto done;
 	}
 
-	if (tiling == I915_TILING_X && width * bpp <= 8*512/2) {
+	if (tiling == I915_TILING_X && width * bpp <= 8*8*512/10) {
 		DBG(("%s: too thin [width %d, %d bpp] for TILING_X\n",
 		     __FUNCTION__, width, bpp));
 		tiling = I915_TILING_NONE;
 		goto done;
 	}
-	if (tiling == I915_TILING_Y && width * bpp <= 8*128/2) {
+	if (tiling == I915_TILING_Y && width * bpp <= 8*8*128/10) {
 		DBG(("%s: too thin [%d] for TILING_Y\n",
 		     __FUNCTION__, width));
 		tiling = I915_TILING_NONE;


More information about the xorg-commit mailing list