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

Chris Wilson ickle at kemper.freedesktop.org
Fri Oct 4 06:16:41 PDT 2013


 src/sna/sna_accel.c |    5 ++++-
 src/sna/sna_dri.c   |   13 ++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 22557b88d3c0bb8f883db7d0d0bf85f1255c65c9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Oct 4 14:14:19 2013 +0100

    sna/dri: Only move the scanout to the flip cache if destroyed
    
    Under certain circumstances, we can retire the pageflip before the
    client has updated its back buffers. This leads us to pre-emptively
    moving the scanout to the cache, when all we need to do (and will do) is
    report the same back buffer back to the client.
    
    Reported-by: Jiri Slaby <jirislaby at gmail.com>
    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 5fa92f7..e7b98da 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1623,14 +1623,14 @@ static void sna_dri_flip_event(struct sna *sna,
 	if (flip->scanout[1].bo) {
 		struct dri_bo *c = NULL;
 
-		DBG(("%s: retiring previous scanout handle=%d,name=%d\n",
+		DBG(("%s: retiring previous scanout handle=%d, name=%d, refcnt=%d\n",
 		     __FUNCTION__,
 		     flip->scanout[1].bo->handle,
-		     flip->scanout[1].name));
-
-		if (flip->scanout[1].bo != flip->scanout[0].bo) {
-			assert(flip->scanout[1].bo->refcnt == 1);
+		     flip->scanout[1].name,
+		     flip->scanout[1].bo->refcnt));
 
+		if (flip->scanout[1].bo != flip->scanout[0].bo &&
+		    flip->scanout[1].bo->refcnt == 1) {
 			if (!list_is_empty(&flip->cache))
 				c = list_last_entry(&flip->cache, struct dri_bo, link);
 			if (c) {
commit 394b2ce51d8378893f14896e600713544d473925
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Oct 4 14:13:50 2013 +0100

    sna: Add a few more DBG to track refcnts
    
    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 21cd342..7891a5f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1616,10 +1616,12 @@ sna_pixmap_undo_cow(struct sna *sna, struct sna_pixmap *priv, unsigned flags)
 {
 	struct sna_cow *cow = COW(priv->cow);
 
-	DBG(("%s: pixmap=%ld, handle=%d, flags=%x\n",
+	DBG(("%s: pixmap=%ld, handle=%d [refcnt=%d], cow refcnt=%d, flags=%x\n",
 	     __FUNCTION__,
 	     priv->pixmap->drawable.serialNumber,
 	     priv->gpu_bo->handle,
+	     priv->gpu_bo->refcnt,
+	     cow->refcnt,
 	     flags));
 
 	assert(priv->gpu_bo == cow->bo);
@@ -1628,6 +1630,7 @@ sna_pixmap_undo_cow(struct sna *sna, struct sna_pixmap *priv, unsigned flags)
 	list_del(&priv->cow_list);
 
 	if (!--cow->refcnt) {
+		DBG(("%s: freeing cow\n", __FUNCTION__));
 		assert(list_is_empty(&cow->list));
 		free(cow);
 	} else if (IS_COW_OWNER(priv->cow) && priv->pinned) {
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 00a65a9..5fa92f7 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -488,6 +488,9 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 	struct sna_pixmap *priv = sna_pixmap(pixmap);
 	RegionRec region;
 
+	DBG(("%s: pixmap=%ld, handle=%d\n",
+	     __FUNCTION__, pixmap->drawable.serialNumber, bo->handle));
+
 	assert(pixmap->drawable.width * pixmap->drawable.bitsPerPixel <= 8*bo->pitch);
 	assert(pixmap->drawable.height * bo->pitch <= kgem_bo_size(bo));
 	assert(bo->proxy == NULL);


More information about the xorg-commit mailing list