summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-04-06 13:58:35 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-04-06 13:58:35 +0100
commite74ff581449e92d7933da1b5df6680cb880fc454 (patch)
tree9e22502bb1d8784feb233aae0909ee9a5048adfb
parenta00ed98131d0316d8be1c6c850667d04be397e5a (diff)
sna: Force the TearFree redisplay when populating a rotated configuration
We have to disable the "shadow idle; skipping" test if the CRTCs are showing stale content following a sna_crtc_attach(). Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=89904 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index eacfe146..03595da0 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1995,9 +1995,9 @@ get_scanout_bo(struct sna *sna, PixmapPtr pixmap)
return priv->gpu_bo;
}
-static void clear(struct sna *sna,
- PixmapPtr front, struct kgem_bo *bo,
- xf86CrtcPtr crtc)
+static void shadow_clear(struct sna *sna,
+ PixmapPtr front, struct kgem_bo *bo,
+ xf86CrtcPtr crtc)
{
bool ok = false;
if (!wedged(sna))
@@ -2009,6 +2009,12 @@ static void clear(struct sna *sna,
if (ptr)
memset(ptr, 0, bo->pitch * crtc->mode.HDisplay);
}
+ sna->mode.shadow_dirty = true;
+}
+
+static bool rr_active(xf86CrtcPtr crtc)
+{
+ return crtc->transformPresent || crtc->rotation != RR_Rotate_0;
}
static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
@@ -2082,7 +2088,7 @@ force_shadow:
}
front = sna_crtc->slave_pixmap ?: sna->front;
- if (__sna_pixmap_get_bo(front) && !crtc->transformPresent) {
+ if (__sna_pixmap_get_bo(front) && !rr_active(crtc)) {
BoxRec b;
b.x1 = crtc->x;
@@ -2100,7 +2106,7 @@ force_shadow:
b.y2 = scrn->virtualY;
if (b.x2 - b.x1 < crtc->mode.HDisplay ||
b.y2 - b.y1 < crtc->mode.VDisplay)
- clear(sna, front, bo, crtc);
+ shadow_clear(sna, front, bo, crtc);
if (b.y2 > b.y1 && b.x2 > b.x1) {
DrawableRec tmp;
@@ -2120,11 +2126,11 @@ force_shadow:
if (!sna->render.copy_boxes(sna, GXcopy,
&front->drawable, __sna_pixmap_get_bo(front), 0, 0,
&tmp, bo, -crtc->x, -crtc->y,
- &b, 1, 0))
- clear(sna, front, bo, crtc);
+ &b, 1, COPY_LAST))
+ shadow_clear(sna, front, bo, crtc);
}
} else
- clear(sna, front, bo, crtc);
+ shadow_clear(sna, front, bo, crtc);
sna_crtc->shadow_bo_width = crtc->mode.HDisplay;
sna_crtc->shadow_bo_height = crtc->mode.VDisplay;