xf86-video-intel: 2 commits - src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jan 27 10:50:19 PST 2016


 src/sna/sna_display.c |   47 +++++++++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 20 deletions(-)

New commits:
commit 2bee35a86b77bc7371a81dfa1586398edde56917
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 27 11:00:04 2016 +0000

    sna: Restrict TearFree damage discarding to straightforward copies
    
    If we have a rotation, it is beneficial to keep the amount of work we
    need to do to a minimum. So restrict
    
    commit 9a311f9da612ba02b24458f6a40b6a5445ad4869
    Author: Chris Wilson <chris at chris-wilson.co.uk>
    Date:   Fri Feb 13 14:03:16 2015 +0000
    
        sna: Throw away the TearFree damage if it grows too big
    
    to only apply to TearFree and not if we have active RandR transforms.
    
    Reported-by: Frank Delache <franck.delache at grassvalley.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93864
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 77dd3be..9215b23 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1733,6 +1733,11 @@ bool sna_pixmap_discard_shadow_damage(struct sna_pixmap *priv,
 
 static void sna_mode_damage(DamagePtr damage, RegionPtr region, void *closure)
 {
+	struct sna *sna = closure;
+
+	if (sna->mode.rr_active)
+		return;
+
 	/* Throw away the rectangles if the region grows too big */
 	region = DamageRegion(damage);
 	if (region->data) {
commit 43fffc8ea93bef012928f077981d9bf7bb7c3023
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jan 27 10:42:47 2016 +0000

    sna: Perform composite rotation on the individual damage elements
    
    As the rotation may need to perform intermediate copies (e.g. displays
    larger than the render pipeline), we can reduce the amount of overdraw
    by using the damage boxes rather than preparing to redraw the entire
    output.
    
    Reported-by: Frank Delache <franck.delache at grassvalley.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93864
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 511aa84..77dd3be 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -8215,36 +8215,38 @@ sna_crtc_redisplay__composite(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo
 	ValidatePicture(src);
 	ValidatePicture(dst);
 
-	if (!sna->render.composite(sna,
-				   PictOpSrc, src, NULL, dst,
-				   sx, sy,
-				   0, 0,
-				   0, 0,
-				   crtc->mode.HDisplay, crtc->mode.VDisplay,
-				   COMPOSITE_PARTIAL, memset(&tmp, 0, sizeof(tmp)))) {
-		DBG(("%s: unsupported operation!\n", __FUNCTION__));
-		sna_crtc_redisplay__fallback(crtc, region, bo);
-		goto free_dst;
-	}
-
+	/* Composite each box individually as if we are dealing with a rotation
+	 * on a large display, we may have to perform intermediate copies. We
+	 * can then minimise the overdraw by looking at individual boxes rather
+	 * than the bbox.
+	 */
 	n = region_num_rects(region);
 	b = region_rects(region);
 	do {
-		BoxRec box;
-
-		box = *b++;
+		BoxRec box = *b;
 		transformed_box(&box, crtc);
 
 		DBG(("%s: (%d, %d)x(%d, %d) -> (%d, %d), (%d, %d)\n",
 		     __FUNCTION__,
-		     b[-1].x1, b[-1].y1, b[-1].x2-b[-1].x1, b[-1].y2-b[-1].y1,
+		     b->x1, b->y1, b->x2-b->x1, b->y2-b->y1,
 		     box.x1, box.y1, box.x2, box.y2));
 
-		tmp.box(sna, &tmp, &box);
-	} while (--n);
-	tmp.done(sna, &tmp);
+		if (!sna->render.composite(sna,
+					   PictOpSrc, src, NULL, dst,
+					   sx + box.x1, sy + box.y1,
+					   0, 0,
+					   box.x1, box.y1,
+					   box.x2 - box.x1, box.y2 - box.y1,
+					   0, memset(&tmp, 0, sizeof(tmp)))) {
+			DBG(("%s: unsupported operation!\n", __FUNCTION__));
+			sna_crtc_redisplay__fallback(crtc, region, bo);
+			break;
+		} else {
+			tmp.box(sna, &tmp, &box);
+			tmp.done(sna, &tmp);
+		}
+	} while (b++, --n);
 
-free_dst:
 	FreePicture(dst, None);
 free_src:
 	FreePicture(src, None);


More information about the xorg-commit mailing list