xf86-video-intel: src/sna/sna_blt.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Aug 20 03:50:52 PDT 2012


 src/sna/sna_blt.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 74f998136bac441d782faf779616af6f7bdcadad
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 20 11:07:55 2012 +0100

    sna: Avoid migrating the BLT composite src to the GPU if the dst is not
    
    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 99671a9..750d749 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1641,6 +1641,15 @@ prepare_blt_put(struct sna *sna,
 	return true;
 }
 
+static bool source_is_gpu(PixmapPtr pixmap, const BoxRec *box)
+{
+	struct sna_pixmap *priv = sna_pixmap(pixmap);
+	if (priv == NULL)
+		return false;
+	return sna_damage_contains_box(priv->gpu_damage,
+				       box) != PIXMAN_REGION_OUT;
+}
+
 #define alphaless(format) PICT_FORMAT(PICT_FORMAT_BPP(format),		\
 				      PICT_FORMAT_TYPE(format),		\
 				      0,				\
@@ -1839,7 +1848,9 @@ clear:
 	src_box.y1 = y;
 	src_box.x2 = x + width;
 	src_box.y2 = y + height;
-	bo = __sna_render_pixmap_bo(sna, src_pixmap, &src_box, true);
+	bo = NULL;
+	if (tmp->dst.bo || source_is_gpu(src_pixmap, &src_box))
+		bo = __sna_render_pixmap_bo(sna, src_pixmap, &src_box, true);
 	if (bo) {
 		if (!tmp->dst.bo)
 			tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable,


More information about the xorg-commit mailing list