diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-04 14:14:19 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-04 14:15:53 +0100 |
commit | 22557b88d3c0bb8f883db7d0d0bf85f1255c65c9 (patch) | |
tree | e6e6129a0a96d7dbea6e48bd61e5e3d25cbf0dfa | |
parent | 394b2ce51d8378893f14896e600713544d473925 (diff) |
sna/dri: Only move the scanout to the flip cache if destroyed
Under certain circumstances, we can retire the pageflip before the
client has updated its back buffers. This leads us to pre-emptively
moving the scanout to the cache, when all we need to do (and will do) is
report the same back buffer back to the client.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_dri.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 5fa92f7f..e7b98dae 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -1623,14 +1623,14 @@ static void sna_dri_flip_event(struct sna *sna, if (flip->scanout[1].bo) { struct dri_bo *c = NULL; - DBG(("%s: retiring previous scanout handle=%d,name=%d\n", + DBG(("%s: retiring previous scanout handle=%d, name=%d, refcnt=%d\n", __FUNCTION__, flip->scanout[1].bo->handle, - flip->scanout[1].name)); - - if (flip->scanout[1].bo != flip->scanout[0].bo) { - assert(flip->scanout[1].bo->refcnt == 1); + flip->scanout[1].name, + flip->scanout[1].bo->refcnt)); + if (flip->scanout[1].bo != flip->scanout[0].bo && + flip->scanout[1].bo->refcnt == 1) { if (!list_is_empty(&flip->cache)) c = list_last_entry(&flip->cache, struct dri_bo, link); if (c) { |