summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-24 07:54:39 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-24 07:56:31 +0100
commitfe6ab444ad9d138aa011df6cee9f2cee65dbf493 (patch)
treea5a53e31341ca2e74c7eb6f3b8c3a857e2ac496b
parent1e403716d387be1d741537e02db207416080dbeb (diff)
sna: Initialise the per-CRTC shadow bo on first use
When we create the shadow pixmap for the CRTC, we should copy the framebuffer contents into the shadow before we show it the first time. This saves us from showing stale contents until the next redrawn in the BlockHandler - with the proviso that we can do the copy on the GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 2a98fb94..3ca56f1f 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1872,6 +1872,29 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
return NULL;
}
+ if (__sna_pixmap_get_bo(sna->front)) {
+ DrawableRec tmp;
+
+ DBG(("%s: copying onto shadow CRTC: (%d, %d), (%d, %d), handle=%d\n",
+ __FUNCTION__,
+ crtc->bounds.x1,
+ crtc->bounds.y1,
+ crtc->bounds.x2,
+ crtc->bounds.y2,
+ bo->handle));
+
+ tmp.width = crtc->mode.HDisplay;
+ tmp.height = crtc->mode.VDisplay;
+ tmp.depth = sna->front->drawable.depth;
+ tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel;
+
+ (void)sna->render.copy_boxes(sna, GXcopy,
+ &sna->front->drawable, __sna_pixmap_get_bo(sna->front), 0, 0,
+ &tmp, bo, -crtc->bounds.x1, -crtc->bounds.y1,
+ &crtc->bounds, 1,
+ 0);
+ }
+
sna_crtc->transform = true;
return bo;
} else {