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

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 4 01:56:48 PDT 2014


 src/sna/sna_accel.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit e64d14d7bc72fe7b150e5427feeb1a163ec600a7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 4 09:55:04 2014 +0100

    sna: Tighten assertions for using upload proxies concurrently with CPU reads
    
    After relaxing some of the rules on when to discard the upload proxies,
    we also need to relax some of the complementary asserts.
    
    Reported-by: Zdenek Kabelac <zkabelac at redhat.com>
    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 c58f177..0475f1e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2198,7 +2198,7 @@ skip_inplace_map:
 		}
 	}
 
-	assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL);
+	assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0);
 
 	if (operate_inplace(priv, flags) &&
 	    pixmap_inplace(sna, pixmap, priv, flags) &&
@@ -2206,8 +2206,10 @@ skip_inplace_map:
 		void *ptr;
 
 		DBG(("%s: try to operate inplace (GTT)\n", __FUNCTION__));
+		assert(priv->gpu_bo);
 		assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
 		assert(!priv->move_to_gpu);
+		assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0);
 		assert((flags & MOVE_READ) == 0 || priv->cpu_damage == NULL);
 		/* XXX only sync for writes? */
 		kgem_bo_submit(&sna->kgem, priv->gpu_bo);
@@ -2247,8 +2249,10 @@ skip_inplace_map:
 		void *ptr;
 
 		DBG(("%s: try to operate inplace (CPU)\n", __FUNCTION__));
+		assert(priv->gpu_bo);
 		assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
 		assert(priv->move_to_gpu == NULL || (flags & MOVE_WRITE) == 0);
+		assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0);
 
 		assert(!priv->mapped);
 		assert(priv->gpu_bo->tiling == I915_TILING_NONE);
@@ -2686,6 +2690,8 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		}
 	}
 
+	assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0);
+
 	if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) {
 		DBG(("%s: delta=(%d, %d)\n", __FUNCTION__, dx, dy));
 		RegionTranslate(region, dx, dy);
@@ -2697,8 +2703,10 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 		void *ptr;
 
 		DBG(("%s: try to operate inplace\n", __FUNCTION__));
+		assert(priv->gpu_bo);
 		assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0);
 		assert(priv->move_to_gpu == NULL || (flags & MOVE_WRITE) == 0);
+		assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0);
 
 		/* XXX only sync for writes? */
 		kgem_bo_submit(&sna->kgem, priv->gpu_bo);
@@ -2776,6 +2784,8 @@ move_to_cpu:
 
 		DBG(("%s: try to operate inplace (CPU), read? %d, write? %d\n",
 		     __FUNCTION__, !!(flags & MOVE_READ), !!(flags & MOVE_WRITE)));
+		assert(priv->gpu_bo);
+		assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0);
 		assert(sna_damage_contains_box(&priv->gpu_damage, &region->extents) == PIXMAN_REGION_IN);
 		assert(sna_damage_contains_box(&priv->cpu_damage, &region->extents) == PIXMAN_REGION_OUT);
 
commit 4e12d5ca26bdfafd7b9cd02c36e6d991f068f29b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 4 09:48:53 2014 +0100

    sna: Prevent creating a GPU bo for an inplace read
    
    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 e317e65..c58f177 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2054,7 +2054,7 @@ static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags)
 		return false;
 	}
 
-	if (priv->cpu_damage && flags & MOVE_READ) {
+	if ((priv->gpu_damage == NULL || priv->cpu_damage) && flags & MOVE_READ) {
 		DBG(("%s: no, has CPU damage and requires readback\n", __FUNCTION__));
 		return false;
 	}


More information about the xorg-commit mailing list