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

Chris Wilson ickle at kemper.freedesktop.org
Sun Aug 4 01:53:22 PDT 2013


 src/sna/kgem.c      |    1 +
 src/sna/kgem.h      |    5 ++++-
 src/sna/sna_accel.c |    6 +-----
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit a5bf389908934aa4f9493a4a35b18e4aec9c8103
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Aug 3 14:54:31 2013 +0100

    sna: Mark the entire userptr proxy chain as flush/non-reusable
    
    Fixes cache bookkeepping when mixing userptr uploads.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 29a5dfc..8d59a2e 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1909,6 +1909,7 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
 		assert(bo->refcnt == 0);
 		assert(bo->snoop);
 		assert(!bo->scanout);
+		assert(!bo->purged);
 		assert(bo->proxy == NULL);
 		assert(bo->tiling == I915_TILING_NONE);
 		assert(bo->rq == NULL);
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 95f0f7b..4ea8596 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -647,8 +647,11 @@ static inline bool __kgem_bo_is_busy(struct kgem *kgem, struct kgem_bo *bo)
 
 static inline void kgem_bo_mark_unreusable(struct kgem_bo *bo)
 {
-	while (bo->proxy)
+	while (bo->proxy) {
+		bo->flush = true;
 		bo = bo->proxy;
+	}
+	bo->flush = true;
 	bo->reusable = false;
 }
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 7fef4f2..040c009 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -874,9 +874,8 @@ fallback:
 		sna_pixmap_destroy(pixmap);
 		goto fallback;
 	}
-	priv->cpu_bo->flush = true;
 	priv->cpu_bo->pitch = pitch;
-	priv->cpu_bo->reusable = false;
+	kgem_bo_mark_unreusable(priv->cpu_bo);
 	sna_accel_watch_flush(sna, 1);
 #ifdef DEBUG_MEMORY
 	sna->debug_memory.cpu_bo_allocs++;
@@ -4036,7 +4035,6 @@ try_upload_blt(PixmapPtr pixmap, RegionRec *region,
 	if (src_bo == NULL)
 		return false;
 
-	src_bo->flush = true;
 	src_bo->pitch = stride;
 	kgem_bo_mark_unreusable(src_bo);
 
@@ -5300,7 +5298,6 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 						 src_pixmap->devKind * src_pixmap->drawable.height,
 						 true);
 			if (src_bo) {
-				src_bo->flush = true;
 				src_bo->pitch = src_pixmap->devKind;
 				kgem_bo_mark_unreusable(src_bo);
 
@@ -14512,7 +14509,6 @@ sna_get_image_blt(PixmapPtr pixmap,
 				 pitch * (region->extents.y2 - region->extents.y1),
 				 false);
 	if (dst_bo) {
-		dst_bo->flush = true;
 		dst_bo->pitch = pitch;
 		kgem_bo_mark_unreusable(dst_bo);
 


More information about the xorg-commit mailing list