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

Chris Wilson ickle at kemper.freedesktop.org
Thu Jan 5 07:11:30 PST 2012


 src/sna/sna_accel.c |   30 +++++++++++++++++++++++++++++-
 src/sna/sna_io.c    |    4 ++--
 2 files changed, 31 insertions(+), 3 deletions(-)

New commits:
commit 307276d7da99ceb84c175e412452e5d86d615cf4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 5 14:26:05 2012 +0000

    sna: Enable using the render pipeline for uploads to Y-tiled pixmaps
    
    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 494a3bf..1c25b9d 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -318,7 +318,7 @@ void sna_write_boxes(struct sna *sna,
 
 	DBG(("%s x %d\n", __FUNCTION__, nbox));
 
-	if (DEBUG_NO_IO || kgem->wedged || dst_bo->tiling == I915_TILING_Y ||
+	if (DEBUG_NO_IO || kgem->wedged ||
 	    !kgem_bo_map_will_stall(kgem, dst_bo)) {
 fallback:
 		write_boxes_inplace(kgem,
@@ -329,7 +329,7 @@ fallback:
 	}
 
 	/* Try to avoid switching rings... */
-	if (kgem->ring == KGEM_RENDER) {
+	if (dst_bo->tiling == I915_TILING_Y || kgem->ring == KGEM_RENDER) {
 		PixmapRec tmp;
 		BoxRec extents;
 
commit f9451aaa39e1d77b08d2201f5c4a44ab834f2237
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 5 14:22:21 2012 +0000

    sna: Mark the upload as having acquired the GTT mapping
    
    In order for the entire PutImage to be performed inplace, we need to
    maintain the tendency to keep doing inplace operations. This hint is
    provided by tracking whether or not the last operation used the GTT
    mapping. However, that hint was not being provided by zpixmap_blt.
    
    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 396dd9c..b14d2e9 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1901,6 +1901,14 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 			sna_damage_add(&priv->gpu_damage, region);
 		}
 
+		/* And mark as having a valid GTT mapping for future uploads */
+		pixmap->devPrivate.ptr =
+			kgem_bo_map(&sna->kgem, priv->gpu_bo, PROT_WRITE);
+		if (pixmap->devPrivate.ptr) {
+			priv->mapped = 1;
+			pixmap->devKind = priv->gpu_bo->pitch;
+		}
+
 		return true;
 	}
 
commit ce93c00a33a395986ffc0d33aae85d2c23aabc5d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 5 14:20:55 2012 +0000

    sna: Avoid operating inplace if we have pending CPU damage
    
    If the operation does not replace existing CPU damage, we are likely to
    want to reuse the pixmap again on the CPU, so avoid mixing CPU/GPU
    operations.
    
    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 9ecf3c6..396dd9c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -870,9 +870,29 @@ static inline bool region_inplace(struct sna *sna,
 	if (wedged(sna))
 		return false;
 
-	if (priv->mapped)
+	if (priv->mapped) {
+		DBG(("%s: already mapped\n", __FUNCTION__));
 		return true;
+	}
 
+	if (priv->cpu_damage) {
+		const BoxRec *extents = &region->extents;
+		const BoxRec *damage = &priv->cpu_damage->extents;
+		if (extents->x2 < damage->x2 || extents->x1 > damage->x1 ||
+		    extents->y2 < damage->y2 || extents->y1 > damage->y1) {
+			DBG(("%s: uncovered CPU damage pending\n", __FUNCTION__));
+			return false;
+		}
+	}
+
+	DBG(("%s: (%dx%d), inplace? %d\n",
+	     __FUNCTION__,
+	     region->extents.x2 - region->extents.x1,
+	     region->extents.y2 - region->extents.y1,
+	     ((region->extents.x2 - region->extents.x1) *
+	      (region->extents.y2 - region->extents.y1) *
+	      pixmap->drawable.bitsPerPixel >> 12)
+	     >= sna->kgem.half_cpu_cache_pages));
 	return ((region->extents.x2 - region->extents.x1) *
 		(region->extents.y2 - region->extents.y1) *
 		pixmap->drawable.bitsPerPixel >> 12)


More information about the xorg-commit mailing list