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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2018-04-04 15:20:01 +01:00
parent 4953aa13b9
commit d9bf46e45c
1 changed files with 5 additions and 0 deletions

View File

@ -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;