diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-07-24 14:10:24 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-07-24 14:12:50 +0100 |
commit | 6f4972d5c368c30e971a23c1dc370d3e43761282 (patch) | |
tree | e1204ce954893048f5002c5ba0a0eae4b6109c93 /src/sna | |
parent | fffb1f52b61fd4983e4a1ff29c4673481ea63f17 (diff) | |
download | xorg-driver-xf86-video-intel-6f4972d5c368c30e971a23c1dc370d3e43761282.tar.gz |
sna/dri2: Relinquish back-buffer cache on change of scanout status
If we change scanout status (i.e. whether or not this flip chain may be
presented directly on the CRTC), throwaway the previous back buffer
cache as those buffers may not be suitable for presentation.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=111197
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna_dri2.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 0cbc7599..6426a386 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -198,6 +198,7 @@ struct dri2_window { int64_t msc_delta; struct list cache; uint32_t cache_size; + bool cache_scanout; }; static struct dri2_window *dri2_window(WindowPtr win) @@ -229,8 +230,9 @@ sna_dri2_get_back(struct sna *sna, struct kgem_bo *bo; struct dri_bo *c; uint32_t name; - int flags; + bool scanout; bool reuse; + int flags; DBG(("%s: draw size=%dx%d, back buffer handle=%d size=%dx%d, is-scanout? %d, active?=%d, pitch=%d, front pitch=%d\n", __FUNCTION__, draw->width, draw->height, @@ -241,8 +243,9 @@ sna_dri2_get_back(struct sna *sna, back->pitch, front_pitch(draw))); assert(priv); + scanout = use_scanout(sna, draw, priv); size = draw->height << 16 | draw->width; - if (size != priv->cache_size) { + if (size != priv->cache_size || scanout != priv->cache_scanout) { while (!list_is_empty(&priv->cache)) { c = list_first_entry(&priv->cache, struct dri_bo, link); list_del(&c->link); @@ -254,11 +257,12 @@ sna_dri2_get_back(struct sna *sna, free(c); } priv->cache_size = size; + priv->cache_scanout = scanout; } reuse = size == get_private(back)->size; if (reuse) - reuse = get_private(back)->bo->scanout == use_scanout(sna, draw, priv); + reuse = get_private(back)->bo->scanout >= scanout; DBG(("%s: reuse backbuffer? %d\n", __FUNCTION__, reuse)); if (reuse) { bo = get_private(back)->bo; |