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

Chris Wilson ickle at kemper.freedesktop.org
Fri Jul 20 06:57:32 PDT 2012


 src/sna/gen6_render.c |   21 +--------------------
 src/sna/sna_dri.c     |   12 ++++++++----
 src/sna/sna_io.c      |    6 ++++--
 src/sna/sna_render.c  |    2 +-
 4 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit 8b4cf24f1403bf3d929cc0725de66b3d0e08ebaf
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 20 14:46:32 2012 +0100

    sna: Also check whether the first upload box can use the BLT
    
    No point checking boxes 1..n if box 0 is the troublemaker!
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index b53143f..733e542 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -170,7 +170,8 @@ fallback:
 		return;
 	}
 
-	can_blt = kgem_bo_can_blt(kgem, src_bo);
+	can_blt = kgem_bo_can_blt(kgem, src_bo) &&
+		(box[0].x2 - box[0].x1) * dst->drawable.bitsPerPixel < 8 * (MAXSHORT - 4);
 	extents = box[0];
 	for (n = 1; n < nbox; n++) {
 		if (box[n].x1 < extents.x1)
@@ -575,7 +576,8 @@ fallback:
 					   box, nbox);
 	}
 
-	can_blt = kgem_bo_can_blt(kgem, dst_bo);
+	can_blt = kgem_bo_can_blt(kgem, dst_bo) &&
+		(box[0].x2 - box[0].x1) * dst->drawable.bitsPerPixel < 8 * (MAXSHORT - 4);
 	extents = box[0];
 	for (n = 1; n < nbox; n++) {
 		if (box[n].x1 < extents.x1)
commit df14b285be44f0c40a718bb8ae09a9558b1eb2c7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 20 14:35:28 2012 +0100

    sna/gen6: Prefer the more flexible render ring for large surfaces
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 044a9f9..d4783e0 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2397,27 +2397,8 @@ try_blt(struct sna *sna,
 		return true;
 	}
 
-	if (too_large(dst->pDrawable->width, dst->pDrawable->height)) {
-		DBG(("%s: dst too large for 3D pipe (%d, %d)\n",
-		     __FUNCTION__,
-		     dst->pDrawable->width, dst->pDrawable->height));
-		return true;
-	}
-
-	if (src->pDrawable &&
-	    too_large(src->pDrawable->width, src->pDrawable->height)) {
-		DBG(("%s: src too large for 3D pipe (%d, %d)\n",
-		     __FUNCTION__,
-		     src->pDrawable->width, src->pDrawable->height));
+	if (can_switch_rings(sna) && sna_picture_is_solid(src, NULL))
 		return true;
-	}
-
-	if (can_switch_rings(sna)) {
-		if (sna_picture_is_solid(src, NULL))
-			return true;
-		if (src->pDrawable)
-			return true;
-	}
 
 	return false;
 }
commit 578ff11c3753ede2c81afc47302991e3d3b316f2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 20 14:24:06 2012 +0100

    sna: Just use composite.box() when we only have one box
    
    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 e503586..1db8958 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -791,7 +791,7 @@ static int sna_render_picture_downsample(struct sna *sna,
 						   &op))
 				goto cleanup_src;
 
-			op.boxes(sna, &op, &b, 1);
+			op.box(sna, &op, &b);
 			op.done(sna, &op);
 		}
 	}
commit fb7987fc0b51cf3b83dcf78bcefe65ec3af32ccf
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jul 20 13:12:27 2012 +0100

    sna/dri: Cleanup ring selection for SNB+ CopyRegion
    
    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 4ced0eb..da2f358 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -426,6 +426,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 static void sna_dri_select_mode(struct sna *sna, struct kgem_bo *src, bool sync)
 {
 	struct drm_i915_gem_busy busy;
+	int mode;
 
 	if (sna->kgem.gen < 60)
 		return;
@@ -463,11 +464,14 @@ static void sna_dri_select_mode(struct sna *sna, struct kgem_bo *src, bool sync)
 	 * our operation on the same ring, and ideally on the same
 	 * ring as we will flip from (which should be the RENDER ring
 	 * as well).
+	 *
+	 * The ultimate question is whether preserving the ring outweighs
+	 * the cost of the query.
 	 */
-	if ((busy.busy & 0xffff0000) == 0 || busy.busy & (1 << 16))
-		kgem_set_mode(&sna->kgem, KGEM_RENDER);
-	else
-		kgem_set_mode(&sna->kgem, KGEM_BLT);
+	mode = KGEM_RENDER;
+	if (busy.busy & (1 << 16))
+		mode = KGEM_BLT;
+	_kgem_set_mode(&sna->kgem, mode);
 }
 
 static struct kgem_bo *


More information about the xorg-commit mailing list