summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-01-21 10:17:03 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-01-21 10:38:56 +0000
commit2c441079cbd52902d356b652659e2be84726940e (patch)
tree7997f3de8ae09769c23c7a040c17408827aa6766
parentac22dd4292841e27bb6147cf1aa7867f36bb2118 (diff)
sna: Initialise the TearFree shadow output from the current front buffer
Otherwise we may end up in a sitation where we show stale contents for a (sometimes signification) fraction of a second before it is refreshed with the correct contents. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73842 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index f2748693..9e811ca1 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1423,6 +1423,8 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
DBG(("%s: attaching to single shadow pixmap\n", __FUNCTION__));
if (sna->mode.shadow == NULL) {
+ BoxRec box;
+
bo = kgem_create_2d(&sna->kgem,
sna->scrn->virtualX,
sna->scrn->virtualY,
@@ -1432,6 +1434,18 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
if (bo == NULL)
return NULL;
+ box.x1 = box.y1 = 0;
+ box.x2 = sna->scrn->virtualX;
+ box.y2 = sna->scrn->virtualY;
+
+ if (!sna->render.copy_boxes(sna, GXcopy,
+ sna->front, sna_pixmap(sna->front)->gpu_bo, 0, 0,
+ sna->front, bo, 0, 0,
+ &box, 1, COPY_LAST)) {
+ kgem_bo_destroy(&sna->kgem, bo);
+ return NULL;
+ }
+
if (!get_fb(sna, bo,
sna->scrn->virtualX,
sna->scrn->virtualY)) {