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

Chris Wilson ickle at kemper.freedesktop.org
Tue Aug 28 13:32:09 PDT 2012


 src/sna/kgem.c    |   11 ++++++++---
 src/sna/kgem.h    |    5 ++---
 src/sna/sna_dri.c |    2 ++
 3 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit f3e122554e88da0351bfb9a7a722f0715553689b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Aug 28 21:27:04 2012 +0100

    sna: Propagate the request to flush rather than directly submit the batch
    
    The subtly is that we need to reset the mode correctly after
    submitting the batch which was not handled by kgem_flush(). If we fail
    to set the appropriate mode then the next operation will be on a random
    ring, which can prove fatal with SandyBridge+.
    
    Reported-by: Reinis Danne <reinis.danne at gmail.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 520f0b2..ba8b0b9 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3480,7 +3480,8 @@ bool kgem_check_bo(struct kgem *kgem, ...)
 	int num_exec = 0;
 	int num_pages = 0;
 
-	kgem_flush(kgem);
+	if (kgem_flush(kgem))
+		return false;
 
 	va_start(ap, kgem);
 	while ((bo = va_arg(ap, struct kgem_bo *))) {
@@ -3516,7 +3517,8 @@ bool kgem_check_bo_fenced(struct kgem *kgem, struct kgem_bo *bo)
 {
 	uint32_t size;
 
-	kgem_flush(kgem);
+	if (kgem_flush(kgem))
+		return false;
 
 	while (bo->proxy)
 		bo = bo->proxy;
@@ -3561,7 +3563,8 @@ bool kgem_check_many_bo_fenced(struct kgem *kgem, ...)
 	int num_pages = 0;
 	int fenced_size = 0;
 
-	kgem_flush(kgem);
+	if (kgem_flush(kgem))
+		return false;
 
 	va_start(ap, kgem);
 	while ((bo = va_arg(ap, struct kgem_bo *))) {
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index a72fe42..d72db55 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -279,10 +279,9 @@ static inline void kgem_submit(struct kgem *kgem)
 		_kgem_submit(kgem);
 }
 
-static inline void kgem_flush(struct kgem *kgem)
+static inline bool kgem_flush(struct kgem *kgem)
 {
-	if (kgem->flush && kgem_is_idle(kgem))
-		_kgem_submit(kgem);
+	return kgem->flush && kgem_is_idle(kgem);
 }
 
 static inline void kgem_bo_submit(struct kgem *kgem, struct kgem_bo *bo)
commit b5c8efe4309248e62d94d80b37a70775284ae985
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Aug 28 08:33:00 2012 +0100

    sna: Make sure we reset the domain tracking when exporting DRI bo
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index cd16ffe..520f0b2 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3905,6 +3905,8 @@ uint32_t kgem_bo_flink(struct kgem *kgem, struct kgem_bo *bo)
 
 	/* The bo is outside of our control, so presume it is written to */
 	bo->needs_flush = true;
+	if (bo->domain != DOMAIN_GPU)
+		bo->domain = DOMAIN_NONE;
 
 	/* Henceforth, we need to broadcast all updates to clients and
 	 * flush our rendering before doing so.
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 8967ed9..06a940b 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -426,6 +426,8 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 
 	kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
 	priv->gpu_bo = ref(bo);
+	if (bo->domain != DOMAIN_GPU)
+		bo->domain = DOMAIN_NONE;
 
 	/* Post damage on the new front buffer so that listeners, such
 	 * as DisplayLink know take a copy and shove it over the USB.


More information about the xorg-commit mailing list