From d9bf46e45cff7122765d096c2b6dc1c3c88d1c69 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 4 Apr 2018 15:20:01 +0100 Subject: [PATCH] sna: Discard the per-crtc TearFree back buffer on resize When we mix TearFree and per-crtc pixmaps (e.g. for RandR transformations), we stash the old buffer on the CRTC for double buffering. However, this buffer needs to be reallocated when we change output resolutions, as the CRTC size may change. Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index a611b46d..cf5a96f5 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2586,6 +2586,11 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc) } sna_crtc->rotation = RR_Rotate_0; + if (sna_crtc->cache_bo) { + kgem_bo_destroy(&sna->kgem, sna_crtc->cache_bo); + sna_crtc->cache_bo = NULL; + } + if (use_shadow(sna, crtc)) { PixmapPtr front; unsigned long tiled_limit;