xf86-video-intel: 2 commits - src/sna/sna_blt.c src/sna/sna_composite.c src/sna/sna_io.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Sep 22 00:59:32 PDT 2012


 src/sna/sna_blt.c       |   29 +++++++++++++++++++----------
 src/sna/sna_composite.c |    6 +++++-
 src/sna/sna_io.c        |    3 +++
 3 files changed, 27 insertions(+), 11 deletions(-)

New commits:
commit 92dbedc6138b923aa473935013ecb0346280c4d3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Sep 22 08:56:49 2012 +0100

    sna: Force the stall before trying to upload into a busy CPU bo
    
    Under the circumstances where we can not instead stream the write into
    the GPU bo, we need to use the busy CPU bo.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54978
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index b97df22..6685549 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1614,6 +1614,7 @@ prepare_blt_put(struct sna *sna,
 	assert(src->devPrivate.ptr);
 
 	if (op->dst.bo) {
+		assert(op->dst.bo == sna_pixmap(op->dst.pixmap)->gpu_bo);
 		if (alpha_fixup) {
 			op->u.blt.pixel = alpha_fixup;
 			op->blt   = blt_put_composite_with_alpha;
@@ -1870,25 +1871,33 @@ clear:
 				goto put;
 		}
 	} else {
+		struct sna_pixmap *priv;
+
 put:
-		if (!tmp->dst.bo) {
+		priv = sna_pixmap(tmp->dst.pixmap);
+		if (tmp->dst.bo == priv->cpu_bo) {
+			assert(kgem_bo_is_busy(tmp->dst.bo));
+			tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable,
+							  FORCE_GPU | PREFER_GPU,
+							  &dst_box,
+							  &tmp->damage);
+			if (tmp->dst.bo == priv->cpu_bo) {
+				DBG(("%s: forcing the stall to overwrite a busy CPU bo\n", __FUNCTION__));
+				tmp->dst.bo = NULL;
+			}
+		}
+
+		if (tmp->dst.bo == NULL) {
 			RegionRec region;
 
 			region.extents = dst_box;
 			region.data = NULL;
 
 			if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
-							MOVE_INPLACE_HINT | MOVE_WRITE))
+							MOVE_INPLACE_HINT | MOVE_READ | MOVE_WRITE))
 				return false;
-		} else {
-			if (tmp->dst.bo == sna_pixmap(tmp->dst.pixmap)->cpu_bo) {
-				assert(kgem_bo_is_busy(tmp->dst.bo));
-				tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable,
-								  FORCE_GPU | PREFER_GPU,
-								  &dst_box,
-								  &tmp->damage);
-			}
 		}
+
 		ret = prepare_blt_put(sna, tmp, alpha_fixup);
 	}
 
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index d3df17d..60d39cd 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -527,7 +527,7 @@ sna_composite(CARD8 op,
 	     get_drawable_dx(dst->pDrawable),
 	     get_drawable_dy(dst->pDrawable)));
 
-	if (op <= PictOpSrc) {
+	if (op <= PictOpSrc && priv->cpu_damage) {
 		int16_t x, y;
 
 		get_drawable_deltas(dst->pDrawable, pixmap, &x, &y);
@@ -535,6 +535,10 @@ sna_composite(CARD8 op,
 			pixman_region_translate(&region, x, y);
 
 		sna_damage_subtract(&priv->cpu_damage, &region);
+		if (priv->cpu_damage == NULL) {
+			list_del(&priv->list);
+			priv->cpu = false;
+		}
 
 		if (x|y)
 			pixman_region_translate(&region, -x, -y);
commit 3e1be265cf950976b5929b14a9dad0664deaa2c1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 21 17:37:58 2012 +0100

    sna: Force an inplace upload if already wedged
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index cdaadc0..60ea517 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -587,6 +587,9 @@ static bool upload_inplace(struct kgem *kgem,
 {
 	unsigned int bytes;
 
+	if (kgem->wedged)
+		return true;
+
 	if (!kgem_bo_can_map(kgem, bo) && !upload_inplace__tiled(kgem, bo))
 		return false;
 


More information about the xorg-commit mailing list