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

Chris Wilson ickle at kemper.freedesktop.org
Mon Aug 27 11:39:12 PDT 2012


 src/sna/kgem.c       |    7 +++++--
 src/sna/sna_accel.c  |   11 +++++++++--
 src/sna/sna_dri.c    |   10 +++-------
 src/sna/sna_render.c |    4 ++--
 4 files changed, 19 insertions(+), 13 deletions(-)

New commits:
commit 8218e5da2b177ca9cd0e2b1e7dbe114e5ef2ebf0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 27 19:36:03 2012 +0100

    sna: Fix crash with broken DBG missing one of its arguments
    
    Reported-by: Clemens Eisserer <linuxhippy at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54127
    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 4639fc4..06b7e26 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -11638,7 +11638,7 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
 	/* If the source is already on the GPU, keep the operation on the GPU */
 	if (gc->fillStyle == FillTiled) {
 		if (!gc->tileIsPixel && sna_pixmap_is_gpu(gc->tile.pixmap)) {
-			DBG(("%s: source is already on the gpu\n"));
+			DBG(("%s: source is already on the gpu\n", __FUNCTION__));
 			hint |= PREFER_GPU | FORCE_GPU;
 		}
 	}
commit 593f549b45fbb1528472feed51207d84901d142e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 27 16:43:19 2012 +0100

    sna: A little more DBG to try and identify ratelimiting ops
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 0dff41c..92ab02f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2262,7 +2262,7 @@ void _kgem_submit(struct kgem *kgem)
 			if (DEBUG_FLUSH_SYNC) {
 				struct drm_i915_gem_set_domain set_domain;
 
-				DBG(("%s: debug sync\n", __FUNCTION__));
+				DBG(("%s: debug sync, starting\n", __FUNCTION__));
 
 				VG_CLEAR(set_domain);
 				set_domain.handle = handle;
@@ -2274,6 +2274,8 @@ void _kgem_submit(struct kgem *kgem)
 					DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
 					kgem_throttle(kgem);
 				}
+
+				DBG(("%s: debug sync, completed\n", __FUNCTION__));
 			}
 		}
 
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 0d4d706..4493bf6 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -551,7 +551,8 @@ sna_render_pixmap_bo(struct sna *sna,
 	struct sna_pixmap *priv;
 	BoxRec box;
 
-	DBG(("%s (%d, %d)x(%d, %d)/(%d, %d)\n", __FUNCTION__,
+	DBG(("%s pixmap=%ld, (%d, %d)x(%d, %d)/(%d, %d)\n",
+	     __FUNCTION__, pixmap->drawable.serialNumber,
 	     x, y, w,h, pixmap->drawable.width, pixmap->drawable.height));
 
 	channel->width  = pixmap->drawable.width;
@@ -622,7 +623,6 @@ sna_render_pixmap_bo(struct sna *sna,
 	     channel->offset[0], channel->offset[1],
 	     pixmap->drawable.width, pixmap->drawable.height));
 
-
 	channel->bo = __sna_render_pixmap_bo(sna, pixmap, &box, false);
 	if (channel->bo == NULL) {
 		DBG(("%s: uploading CPU box (%d, %d), (%d, %d)\n",
commit 71ac12e9b6ed00c28993637aafd5186a2ba26256
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 27 15:49:59 2012 +0100

    sna: Assert that the bo is marked as 'flush' when exported to DRI clients
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 7495fb9..0dff41c 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4625,8 +4625,9 @@ void kgem_buffer_read_sync(struct kgem *kgem, struct kgem_bo *_bo)
 	struct kgem_buffer *bo;
 	uint32_t offset = _bo->delta, length = _bo->size.bytes;
 
+	/* We expect the caller to have already submitted the batch */
 	assert(_bo->io);
-	assert(_bo->exec == &_kgem_dummy_exec);
+	assert(_bo->exec == NULL);
 	assert(_bo->rq == NULL);
 	assert(_bo->proxy);
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4fbdd70..4639fc4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2022,6 +2022,7 @@ out:
 	if (flags & MOVE_WRITE) {
 		priv->source_count = SOURCE_BIAS;
 		assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL);
+		assert(!priv->flush || !list_is_empty(&priv->list));
 	}
 	if ((flags & MOVE_ASYNC_HINT) == 0 && priv->cpu_bo) {
 		DBG(("%s: syncing cpu bo\n", __FUNCTION__));
@@ -3432,6 +3433,7 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 			sna_add_flush_pixmap(sna, priv, priv->gpu_bo);
 		}
 	}
+	assert(!priv->flush || !list_is_empty(&priv->list));
 	priv->cpu = true;
 
 blt:
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 435d22e..3e8f5f9 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -170,6 +170,7 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna,
 		return NULL;
 	}
 
+	assert(priv->cpu_damage == NULL);
 	if (priv->flush++)
 		return priv->gpu_bo;
 
@@ -189,13 +190,6 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna,
 	/* Don't allow this named buffer to be replaced */
 	priv->pinned = 1;
 
-	if (priv->gpu_bo->exec || priv->cpu_damage) {
-		DBG(("%s: marking pixmap=%ld for flushing\n",
-		     __FUNCTION__, pixmap->drawable.serialNumber));
-		list_move(&priv->list, &sna->flush_pixmaps);
-		sna->kgem.flush = true;
-	}
-
 	return priv->gpu_bo;
 }
 
@@ -340,6 +334,8 @@ sna_dri_create_buffer(DrawablePtr draw,
 		pixmap->refcnt++;
 	}
 
+	assert(bo->flush == true);
+
 	return buffer;
 
 err:
commit cf64c8ce758cfa5d3bcd1b7626ff94cce7a84636
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 27 13:59:56 2012 +0100

    sna: Upload PutImage inplace to a fresh GPU bo if the device doesn't snoop
    
    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 02d4b13..4fbdd70 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3221,7 +3221,12 @@ static bool upload_inplace(struct sna *sna,
 		}
 	}
 
-	DBG(("%s? no\n", __FUNCTION__));
+	if (priv->create & (KGEM_CAN_CREATE_GPU | KGEM_CAN_CREATE_CPU) == KGEM_CAN_CREATE_GPU &&
+	    region_subsumes_drawable(region, &pixmap->drawable)) {
+		DBG(("%s? yes, will fill fresh GPU bo\n", __FUNCTION__));
+		return true;
+	}
+
 	return false;
 }
 


More information about the xorg-commit mailing list