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

Chris Wilson ickle at kemper.freedesktop.org
Tue Feb 26 07:08:50 PST 2013


 src/sna/sna_accel.c      |   35 +++++++++++++++++++----------------
 src/sna/sna_render.c     |    8 +++++---
 src/sna/sna_trapezoids.c |    6 +++---
 3 files changed, 27 insertions(+), 22 deletions(-)

New commits:
commit aa7e11a1a451c54d5cbff9a6c242075b08c590ae
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 26 15:07:12 2013 +0000

    sna: Improve handling of migrated userptr bo
    
    Superficially fixes gimp-2.9
    
    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 6015ab6..f991ebb 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2438,22 +2438,26 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
 	}
 
 	if (priv->gpu_bo == NULL) {
-		unsigned create, tiling;
-
 		assert(priv->gpu_damage == NULL);
 
-		create = CREATE_INACTIVE;
-		if (pixmap->usage_hint == SNA_CREATE_FB)
-			create |= CREATE_EXACT | CREATE_SCANOUT;
+		if (flags & __MOVE_FORCE ||
+		    priv->create & KGEM_CAN_CREATE_GPU) {
+			unsigned create, tiling;
 
-		tiling = (flags & MOVE_SOURCE_HINT) ? I915_TILING_Y : DEFAULT_TILING;
-		tiling = sna_pixmap_choose_tiling(pixmap, tiling);
+			create = CREATE_INACTIVE;
+			if (pixmap->usage_hint == SNA_CREATE_FB)
+				create |= CREATE_EXACT | CREATE_SCANOUT;
+
+			tiling = (flags & MOVE_SOURCE_HINT) ? I915_TILING_Y : DEFAULT_TILING;
+			tiling = sna_pixmap_choose_tiling(pixmap, tiling);
+
+			priv->gpu_bo = kgem_create_2d(&sna->kgem,
+						      pixmap->drawable.width,
+						      pixmap->drawable.height,
+						      pixmap->drawable.bitsPerPixel,
+						      tiling, create);
+		}
 
-		priv->gpu_bo = kgem_create_2d(&sna->kgem,
-					      pixmap->drawable.width,
-					      pixmap->drawable.height,
-					      pixmap->drawable.bitsPerPixel,
-					      tiling, create);
 		if (priv->gpu_bo == NULL)
 			return false;
 
@@ -2516,7 +2520,6 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
 		}
 
 		sna_damage_destroy(&priv->cpu_damage);
-		list_del(&priv->list);
 	} else if (DAMAGE_IS_ALL(priv->cpu_damage) ||
 		   sna_damage_contains_box__no_reduce(priv->cpu_damage, box)) {
 		bool ok = false;
@@ -2594,6 +2597,8 @@ done:
 				       pixmap->drawable.height);
 		}
 	}
+	if (priv->cpu_damage == NULL && priv->flush)
+		list_del(&priv->list);
 
 	assert(!priv->gpu_bo->proxy || (flags & MOVE_WRITE) == 0);
 	return sna_pixmap_mark_active(sna, priv) != NULL;
@@ -3115,7 +3120,6 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
 		if (priv->gpu_bo == NULL) {
 			DBG(("%s: not creating GPU bo\n", __FUNCTION__));
 			assert(priv->gpu_damage == NULL);
-			assert(list_is_empty(&priv->list));
 			return NULL;
 		}
 
@@ -3203,8 +3207,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
 	priv->cpu_damage = NULL;
 
 	/* For large bo, try to keep only a single copy around */
-	if (priv->create & KGEM_CAN_CREATE_LARGE ||
-	    flags & MOVE_SOURCE_HINT) {
+	if (priv->create & KGEM_CAN_CREATE_LARGE || flags & MOVE_SOURCE_HINT) {
 		DBG(("%s: disposing of system copy for large/source\n",
 		     __FUNCTION__));
 		assert(!priv->shm);
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 1073abb..9912baf 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -463,7 +463,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box, bool blt)
 
 	w = box->x2 - box->x1;
 	h = box->y2 - box->y1;
-	if (priv->cpu_bo) {
+	if (priv->cpu_bo && !priv->cpu_bo->flush) {
 		migrate = true;
 	} else if (w == pixmap->drawable.width && h == pixmap->drawable.height) {
 		migrate = priv->source_count++ > SOURCE_BIAS;
@@ -494,10 +494,12 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box, bool blt)
 		return NULL;
 
 	if (blt) {
-		if (!sna_pixmap_move_area_to_gpu(pixmap, box, MOVE_READ))
+		if (!sna_pixmap_move_area_to_gpu(pixmap, box,
+						 __MOVE_FORCE | MOVE_READ))
 			return NULL;
 	} else {
-		if (!sna_pixmap_force_to_gpu(pixmap, MOVE_SOURCE_HINT | MOVE_READ))
+		if (!sna_pixmap_move_to_gpu(pixmap,
+					    __MOVE_FORCE | MOVE_SOURCE_HINT | MOVE_READ))
 			return NULL;
 	}
 
commit 32d8908337d45b9598ce07bc46b633ed5e0c7070
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 26 11:42:03 2013 +0000

    sna: Flatten unaligned box emission
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 89f89db..bed9168 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -2861,7 +2861,7 @@ static inline int grid_coverage(int samples, pixman_fixed_t f)
 	return (samples * pixman_fixed_frac(f) + pixman_fixed_1/2) / pixman_fixed_1;
 }
 
-static void
+inline static void
 composite_unaligned_box(struct sna *sna,
 			struct sna_composite_spans_op *tmp,
 			const BoxRec *box,
@@ -2885,7 +2885,7 @@ composite_unaligned_box(struct sna *sna,
 		tmp->box(sna, tmp, box, opacity);
 }
 
-static void
+inline static void
 composite_unaligned_trap_row(struct sna *sna,
 			     struct sna_composite_spans_op *tmp,
 			     xTrapezoid *trap, int dx,
@@ -2963,7 +2963,7 @@ composite_unaligned_trap_row(struct sna *sna,
 	}
 }
 
-static void
+flatten static void
 composite_unaligned_trap(struct sna *sna,
 			struct sna_composite_spans_op *tmp,
 			xTrapezoid *trap,


More information about the xorg-commit mailing list