xf86-video-intel: 2 commits - src/sna/sna_accel.c src/sna/sna_composite.c src/sna/sna_glyphs.c src/sna/sna_render_inline.h

Chris Wilson ickle at kemper.freedesktop.org
Sun Nov 9 23:48:07 PST 2014


 src/sna/sna_accel.c         |    3 ++-
 src/sna/sna_composite.c     |    8 ++++----
 src/sna/sna_glyphs.c        |    8 ++++----
 src/sna/sna_render_inline.h |   24 ++++++++++++++++++++++++
 4 files changed, 34 insertions(+), 9 deletions(-)

New commits:
commit 0267f5902ddaceced870dcd8451ef8729e33e5c2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Nov 10 07:42:42 2014 +0000

    sna: Check after filtering points before submitting boxes to be drawn
    
    As we clip the points when converting them into GPU boxes, check that we
    have something to draw before submitting the commands.
    
    Reported-by: Ian Gay <gay at sfu.ca>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=86075
    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 0ef56fb..13f52e4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -7251,7 +7251,8 @@ sna_poly_point__gpu(DrawablePtr drawable, GCPtr gc,
 				b++;
 			}
 		} while (--nbox);
-		fill.boxes(data->sna, &fill, box, b - box);
+		if (b != box)
+			fill.boxes(data->sna, &fill, box, b - box);
 	}
 	fill.done(data->sna, &fill);
 }
commit 9ea242c275a70351abcfbc0f8f3233c122abecbe
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Nov 9 08:59:08 2014 +0000

    sna: Check picture format on destination before beginning a GPU operation
    
    This is more important in the multiple stage operations like glyph
    rendering where we do not want to initiate an operation on the GPU only
    then to fallback due to an incompatible destination.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index d19dc42..f01f020 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -696,8 +696,8 @@ sna_composite(CARD8 op,
 		goto fallback;
 	}
 
-	if (dst->alphaMap) {
-		DBG(("%s: fallback due to unhandled alpha-map\n", __FUNCTION__));
+	if (!can_render_to_picture(dst)) {
+		DBG(("%s: fallback due to unhandled picture\n", __FUNCTION__));
 		goto fallback;
 	}
 
@@ -956,8 +956,8 @@ sna_composite_rectangles(CARD8		 op,
 	if (wedged(sna))
 		goto fallback;
 
-	if (dst->alphaMap) {
-		DBG(("%s: fallback, dst has an alpha-map\n", __FUNCTION__));
+	if (!can_render_to_picture(dst)) {
+		DBG(("%s: fallback, dst has an incompatible picture\n", __FUNCTION__));
 		goto fallback;
 	}
 
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index a4052c6..a5dfb06 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1971,8 +1971,8 @@ sna_glyphs(CARD8 op,
 		goto fallback;
 	}
 
-	if (dst->alphaMap) {
-		DBG(("%s: fallback -- dst alpha map\n", __FUNCTION__));
+	if (!can_render_to_picture(dst)) {
+		DBG(("%s: fallback -- dst incompatible picture\n", __FUNCTION__));
 		goto fallback;
 	}
 
@@ -2301,8 +2301,8 @@ sna_glyphs__shared(CARD8 op,
 		goto fallback;
 	}
 
-	if (dst->alphaMap) {
-		DBG(("%s: fallback -- dst alpha map\n", __FUNCTION__));
+	if (!can_render_to_picture(dst)) {
+		DBG(("%s: fallback -- incompatible picture\n", __FUNCTION__));
 		goto fallback;
 	}
 
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index 3d24c5c..10fbbfe 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -113,6 +113,30 @@ too_small(struct sna_pixmap *priv)
 }
 
 static inline bool
+can_render_to_picture(PicturePtr dst)
+{
+	if (dst->alphaMap) {
+		DBG(("%s(pixmap=%ld) -- no, has alphamap\n", __FUNCTION__,
+		     get_drawable_pixmap(dst->pDrawable)->drawable.serialNumber));
+		return false;
+	}
+
+	switch (PICT_FORMAT_TYPE(dst->format)) {
+	case PICT_TYPE_COLOR:
+	case PICT_TYPE_GRAY:
+	case PICT_TYPE_OTHER:
+		DBG(("%s(pixmap=%ld) -- no, has palette\n", __FUNCTION__,
+		     get_drawable_pixmap(dst->pDrawable)->drawable.serialNumber));
+		return false;
+	default:
+		break;
+	}
+
+	return true;
+}
+
+
+static inline bool
 is_gpu_dst(struct sna_pixmap *priv)
 {
 	assert(priv);


More information about the xorg-commit mailing list