xf86-video-intel: src/sna/kgem.c src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 23 07:20:29 PDT 2012


 src/sna/kgem.c      |    1 +
 src/sna/sna_accel.c |   15 ++++++---------
 2 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit fc6b7f564df88ca773ae245b1b4e278b47dffd59
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Aug 23 15:13:14 2012 +0100

    sna: Flush the batch if it contains any DRI pixmaps
    
    This fixes a regression from
    
    commit 02963f489b177d0085006753e91e240545933387
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Sun Aug 19 15:45:35 2012 +0100
    
        sna: Only submit the batch if flushing a DRI client bo
    
    which made the presumption that we called sna_add_flush_pixmap() for
    every DRI pixmap that we used. However, that is only called for the
    dirty pixmaps, any native exported pixmap only marks the batch as
    requiring a flush. So in those cases we always need to submit the batch
    if it contains an exported DRI pixmap.
    
    Reported-by: chr.ohm at gmx.net
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53967
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 077f3e1..1cf7957 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2057,6 +2057,7 @@ void kgem_reset(struct kgem *kgem)
 	kgem->nbatch = 0;
 	kgem->surface = kgem->batch_size;
 	kgem->mode = KGEM_NONE;
+	kgem->flush = 0;
 
 	kgem->next_request = __kgem_request_alloc();
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 72d2d02..0499a1d 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1031,8 +1031,6 @@ void sna_add_flush_pixmap(struct sna *sna,
 		DBG(("%s: flush bo idle, flushing\n", __FUNCTION__));
 		kgem_submit(&sna->kgem);
 	}
-
-	sna->kgem.flush = true;
 }
 
 static void __sna_free_pixmap(struct sna *sna,
@@ -13413,9 +13411,8 @@ sna_accel_flush_callback(CallbackListPtr *list,
 	 * by checking for outgoing damage events or sync replies. Tricky,
 	 * and doesn't appear to mitigate the performance loss.
 	 */
-	DBG(("%s: flush?=%d\n", __FUNCTION__, sna->kgem.flush));
-	if (!sna->kgem.flush)
-		return;
+	DBG(("%s: flush?=%d, dirty?=%d\n", __FUNCTION__,
+	     sna->kgem.flush, list_is_empty(&sna->flush_pixmap)));
 
 	/* flush any pending damage from shadow copies to tfp clients */
 	while (!list_is_empty(&sna->flush_pixmaps)) {
@@ -13435,14 +13432,14 @@ sna_accel_flush_callback(CallbackListPtr *list,
 		} else {
 			DBG(("%s: flushing DRI pixmap=%ld\n", __FUNCTION__,
 			     priv->pixmap->drawable.serialNumber));
-			if (sna_pixmap_move_to_gpu(priv->pixmap,
-						     MOVE_READ | __MOVE_FORCE))
-				kgem_bo_submit(&sna->kgem, priv->gpu_bo);
+			ret = sna_pixmap_move_to_gpu(priv->pixmap,
+						     MOVE_READ | __MOVE_FORCE);
 		}
 		(void)ret;
 	}
 
-	sna->kgem.flush = false;
+	if (sna->kgem.flush)
+		kgem_submit(&sna->kgem);
 }
 
 static struct sna_pixmap *sna_accel_scanout(struct sna *sna)


More information about the xorg-commit mailing list