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

Chris Wilson ickle at kemper.freedesktop.org
Sat Jul 21 06:33:29 PDT 2012


 src/sna/kgem.c      |   11 ++++-------
 src/sna/sna_accel.c |    3 ++-
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit c5e6b5874f334b9124a17f017c6eb175cf88f115
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jul 21 14:26:52 2012 +0100

    sna: Fix the reversed not SHM assertion
    
    Should be double checking that we are not about to free a CPU bo pinned
    to a SHM pixmap.
    
    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 74db52e..16f0c4e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1208,7 +1208,7 @@ _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned int flags)
 			priv->cpu = false;
 			list_del(&priv->list);
 			if (priv->cpu_bo) {
-				assert(priv->shm);
+				assert(!priv->shm);
 				assert(!priv->cpu_bo->flush);
 				sna_pixmap_free_cpu(sna, priv);
 			}
commit f36b656ab2bc16ec8849cadb0afb574bb742c3a3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jul 21 13:18:40 2012 +0100

    sna: Avoid marking io/snoop buffers as unreusable unnecessarily
    
    As they are kept in special caches, we can reserve the unreusable flags
    for exceptional buffers.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index dbe6423..ab78e51 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1431,14 +1431,14 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 			     __FUNCTION__, bo->handle));
 			/* transfer the handle to a minimum bo */
 			memcpy(base, bo, sizeof(*base));
-			base->reusable = true;
 			base->io = false;
 			list_init(&base->list);
 			list_replace(&bo->request, &base->request);
 			list_replace(&bo->vma, &base->vma);
 			free(bo);
 			bo = base;
-		}
+		} else
+			bo->reusable = false;
 	}
 
 	if (!bo->reusable) {
@@ -1749,7 +1749,8 @@ static void kgem_commit(struct kgem *kgem)
 		bo->presumed_offset = bo->exec->offset;
 		bo->exec = NULL;
 
-		if (!bo->refcnt && !bo->reusable && !bo->snoop) {
+		if (!bo->refcnt && !bo->reusable) {
+			assert(!bo->snoop);
 			kgem_bo_free(kgem, bo);
 			continue;
 		}
@@ -3801,7 +3802,6 @@ struct kgem_bo *kgem_create_map(struct kgem *kgem,
 		return NULL;
 	}
 
-	bo->reusable = false;
 	bo->snoop = true;
 
 	debug_alloc__bo(kgem, bo);
@@ -4040,7 +4040,6 @@ create_snoopable_buffer(struct kgem *kgem, unsigned alloc)
 		assert(bo->mmapped == true);
 		assert(bo->need_io == false);
 
-		bo->base.reusable = false;
 		bo->base.snoop = true;
 
 		bo->mem = kgem_bo_map__cpu(kgem, &bo->base);
@@ -4080,7 +4079,6 @@ create_snoopable_buffer(struct kgem *kgem, unsigned alloc)
 
 		bo->base.refcnt = 1;
 		bo->base.snoop = true;
-		bo->base.reusable = false;
 		bo->base.map = MAKE_USER_MAP(bo->mem);
 
 		return bo;
@@ -4408,7 +4406,6 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
 	}
 init:
 	bo->base.io = true;
-	bo->base.reusable = false;
 	assert(bo->base.refcnt == 1);
 	assert(num_pages(&bo->base) == alloc);
 	assert(!bo->need_io || !bo->base.needs_flush);
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 32f7007..74db52e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -461,6 +461,7 @@ static void sna_pixmap_free_cpu(struct sna *sna, struct sna_pixmap *priv)
 #endif
 		if (priv->cpu_bo->flush) {
 			kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
+			priv->cpu_bo->reusable = false;
 			sna_accel_watch_flush(sna, -1);
 		}
 		kgem_bo_destroy(&sna->kgem, priv->cpu_bo);


More information about the xorg-commit mailing list