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

Chris Wilson ickle at kemper.freedesktop.org
Thu Jan 31 09:25:51 PST 2013


 src/sna/kgem.c |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 38376b56cfe0dfc603bce48e37432622ef9a0135
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 31 17:29:10 2013 +0000

    sna: Remember to move scanouts to the scanout cache after retiring
    
    Reported-by: Jiri Slaby <jirislaby 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 653a091..e020969 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1506,6 +1506,7 @@ inline static void kgem_bo_move_to_inactive(struct kgem *kgem,
 	assert(bo->domain != DOMAIN_GPU);
 	assert(!bo->proxy);
 	assert(!bo->io);
+	assert(!bo->scanout);
 	assert(!bo->needs_flush);
 	assert(list_is_empty(&bo->vma));
 	ASSERT_IDLE(kgem, bo->handle);
@@ -1594,6 +1595,18 @@ static void _kgem_bo_delete_buffer(struct kgem *kgem, struct kgem_bo *bo)
 		io->used = bo->delta;
 }
 
+static void kgem_bo_move_to_scanout(struct kgem *kgem, struct kgem_bo *bo)
+{
+	assert(bo->refcnt == 0);
+	assert(bo->exec == NULL);
+	assert(bo->scanout);
+	assert(bo->delta);
+
+	DBG(("%s: moving %d [fb %d] to scanout cachee\n", __FUNCTION__,
+	     bo->handle, bo->delta));
+	list_move(&bo->list, &kgem->scanout);
+}
+
 static void kgem_bo_move_to_snoop(struct kgem *kgem, struct kgem_bo *bo)
 {
 	assert(bo->refcnt == 0);
@@ -1723,10 +1736,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 	}
 
 	if (bo->scanout) {
-		assert(bo->delta);
-		DBG(("%s: handle=%d -> scanout\n",
-		     __FUNCTION__, bo->handle));
-		list_add(&bo->list, &kgem->scanout);
+		kgem_bo_move_to_scanout(kgem, bo);
 		return;
 	}
 
@@ -1880,6 +1890,8 @@ static bool kgem_retire__flushing(struct kgem *kgem)
 		if (!bo->refcnt) {
 			if (bo->snoop) {
 				kgem_bo_move_to_snoop(kgem, bo);
+			} else if (bo->scanout) {
+				kgem_bo_move_to_scanout(kgem, bo);
 			} else if (bo->reusable &&
 				   kgem_bo_set_purgeable(kgem, bo)) {
 				kgem_bo_move_to_inactive(kgem, bo);
@@ -1952,7 +1964,9 @@ static bool __kgem_retire_rq(struct kgem *kgem, struct kgem_request *rq)
 		}
 
 		if (!bo->needs_flush) {
-			if (kgem_bo_set_purgeable(kgem, bo)) {
+			if (bo->scanout) {
+				kgem_bo_move_to_scanout(kgem, bo);
+			} else if (kgem_bo_set_purgeable(kgem, bo)) {
 				kgem_bo_move_to_inactive(kgem, bo);
 				retired = true;
 			} else {


More information about the xorg-commit mailing list