xf86-video-intel: 4 commits - src/sna/gen7_render.c src/sna/sna_dri.c src/sna/sna_render.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Jul 17 09:34:32 PDT 2012


 src/sna/gen7_render.c |    2 -
 src/sna/sna_dri.c     |   24 +++++++++++++----
 src/sna/sna_render.c  |   70 ++++++++++++++++++++++----------------------------
 3 files changed, 51 insertions(+), 45 deletions(-)

New commits:
commit c29f96d50839388377ad57c6366f9bc7ad8b9d0a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jul 17 13:02:51 2012 +0100

    sna/gen7: Bump the number of pixel shader threads for IVB GT2
    
    Spotted-by: Kilarski, Bernard R" <bernard.r.kilarski at intel.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 1e10cb0..f8036fb 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -83,7 +83,7 @@ static const struct gt_info gt1_info = {
 static const struct gt_info gt2_info = {
 	.max_vs_threads = 128,
 	.max_gs_threads = 128,
-	.max_wm_threads = 86,
+	.max_wm_threads = 172,
 	.urb = { 256, 704, 320 },
 };
 
commit 799bae9e8ff53fb1b5c74f3278d530a58d66de9a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jul 17 17:07:10 2012 +0100

    sna/dri: Do not allow an exchange to take place on invalid buffers
    
    If the SwapBuffers is called after we have resized a Window but before
    the client has processed the Invalidate notification, then the
    SwapBuffers will be referring to a pair of stale buffers. As the buffers
    are no longer attached to the Pixmap, we can not simply exchange them.
    
    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 d369871..65c3550 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1014,6 +1014,12 @@ can_exchange(struct sna * sna,
 		return false;
 	}
 
+	if (sna_pixmap_get_buffer(pixmap) != front) {
+		DBG(("%s: no, DRI2 drawable is no longer attached\n",
+		     __FUNCTION__));
+		return false;
+	}
+
 	return true;
 }
 
@@ -1046,13 +1052,21 @@ sna_dri_exchange_buffers(DrawablePtr draw,
 	back_bo = get_private(back)->bo;
 	front_bo = get_private(front)->bo;
 
-	assert(pixmap->drawable.height * back_bo->pitch <= kgem_bo_size(back_bo));
-	assert(pixmap->drawable.height * front_bo->pitch <= kgem_bo_size(front_bo));
-
-	DBG(("%s: exchange front=%d/%d and back=%d/%d\n",
+	DBG(("%s: exchange front=%d/%d and back=%d/%d, pixmap=%ld %x%d\n",
 	     __FUNCTION__,
 	     front_bo->handle, front->name,
-	     back_bo->handle, back->name));
+	     back_bo->handle, back->name,
+	     pixmap->drawable.serialNumber,
+	     pixmap->drawable.width,
+	     pixmap->drawable.height));
+
+	DBG(("%s: back_bo pitch=%d, size=%d\n",
+	     __FUNCTION__, back_bo->pitch, kgem_bo_size(back_bo)));
+	DBG(("%s: front_bo pitch=%d, size=%d\n",
+	     __FUNCTION__, front_bo->pitch, kgem_bo_size(front_bo)));
+
+	assert(pixmap->drawable.height * back_bo->pitch <= kgem_bo_size(back_bo));
+	assert(pixmap->drawable.height * front_bo->pitch <= kgem_bo_size(front_bo));
 
 	set_bo(pixmap, back_bo);
 
commit 067aeaddb8047f01ae3a20b26ba0acf5ba2d035f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jul 17 15:33:19 2012 +0100

    sna: Rebalance choice of GPU vs CPU bo
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index ae95878..cb40cd3 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -301,6 +301,12 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box, bool blt)
 		return NULL;
 	}
 
+	if (priv->cpu_bo->vmap && priv->source_count > SOURCE_BIAS) {
+		DBG(("%s: promoting snooped CPU bo due to reuse\n",
+		     __FUNCTION__));
+		return NULL;
+	}
+
 	if (priv->gpu_bo) {
 		switch (sna_damage_contains_box(priv->cpu_damage, box)) {
 		case PIXMAN_REGION_OUT:
@@ -321,54 +327,43 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box, bool blt)
 			}
 			break;
 		}
-
-		if (!blt &&
-		    priv->gpu_bo->tiling != I915_TILING_NONE &&
-		    (priv->cpu_bo->vmap || priv->cpu_bo->pitch >= 4096)) {
-			DBG(("%s: GPU bo exists and is tiled [%d], upload\n",
-			     __FUNCTION__, priv->gpu_bo->tiling));
-			return NULL;
-		}
 	}
 
-	if (blt) {
-		if (priv->cpu_bo->vmap && priv->source_count++ > SOURCE_BIAS) {
-			DBG(("%s: promoting snooped CPU bo due to BLT reuse\n",
-			     __FUNCTION__));
-			return NULL;
-		}
-	} else {
+	if (!blt) {
 		int w = box->x2 - box->x1;
 		int h = box->y2 - box->y1;
 
-		if (priv->cpu_bo->pitch >= 4096) {
-			DBG(("%s: promoting snooped CPU bo due to TLB miss\n",
-			     __FUNCTION__));
-			return NULL;
-		}
+		if (w < pixmap->drawable.width ||
+		    h < pixmap->drawable.height ||
+		    priv->source_count != SOURCE_BIAS) {
+			bool want_tiling;
 
-		if (priv->cpu_bo->vmap && priv->source_count > SOURCE_BIAS) {
-			DBG(("%s: promoting snooped CPU bo due to reuse\n",
-			     __FUNCTION__));
-			return NULL;
-		}
+			if (priv->cpu_bo->pitch >= 4096) {
+				DBG(("%s: promoting snooped CPU bo due to TLB miss\n",
+				     __FUNCTION__));
+				return NULL;
+			}
 
-		if (priv->source_count*w*h >= (int)pixmap->drawable.width * pixmap->drawable.height &&
-		     I915_TILING_NONE != kgem_choose_tiling(&sna->kgem,
-							    blt ? I915_TILING_X : I915_TILING_Y,
-							    pixmap->drawable.width,
-							    pixmap->drawable.height,
-							    pixmap->drawable.bitsPerPixel)) {
-			DBG(("%s: pitch (%d) requires tiling\n",
-			     __FUNCTION__, priv->cpu_bo->pitch));
-			return NULL;
+			if (priv->gpu_bo)
+				want_tiling = priv->gpu_bo->tiling != I915_TILING_NONE;
+			else
+				want_tiling = kgem_choose_tiling(&sna->kgem,
+								 I915_TILING_Y,
+								 pixmap->drawable.width,
+								 pixmap->drawable.height,
+								 pixmap->drawable.bitsPerPixel) != I915_TILING_NONE;
+			if (want_tiling &&
+			    priv->source_count*w*h >= (int)pixmap->drawable.width * pixmap->drawable.height) {
+				DBG(("%s: pitch (%d) requires tiling\n",
+				     __FUNCTION__, priv->cpu_bo->pitch));
+				return NULL;
+			}
 		}
-
-		++priv->source_count;
 	}
 
 	DBG(("%s for box=(%d, %d), (%d, %d)\n",
 	     __FUNCTION__, box->x1, box->y1, box->x2, box->y2));
+	++priv->source_count;
 	return priv->cpu_bo;
 }
 
commit 7ebeea3f5c71959773478de44b08a967fe5acc8b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jul 17 15:10:43 2012 +0100

    sna: Avoid the CPU bo readback for render paths
    
    As we exclude using the CPU bo if there is overlapping GPU damage, we
    can forgo the call to keep the transfer the damage.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 6fb9fe3..ae95878 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -369,9 +369,6 @@ use_cpu_bo(struct sna *sna, PixmapPtr pixmap, const BoxRec *box, bool blt)
 
 	DBG(("%s for box=(%d, %d), (%d, %d)\n",
 	     __FUNCTION__, box->x1, box->y1, box->x2, box->y2));
-	if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT))
-		return NULL;
-
 	return priv->cpu_bo;
 }
 


More information about the xorg-commit mailing list