diff options
author | Thomas Hellstrom <[email protected]> | 2017-07-04 12:55:15 +0900 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-08-03 00:19:05 +0100 |
commit | fc41e3b74a0195118989289f7f1dff53079ce643 (patch) | |
tree | bce9792561c36a4951f07e6361f96d4de32783b8 | |
parent | a1cb12b0a3ab8881bf1b7c8a8375b6bac3f7c71e (diff) |
loader/dri3: Use dri3_find_back in loader_dri3_swap_buffers_msc
If the application hasn't done any drawing since the last call, we
would reuse the same back buffer which was used for the previous swap,
which may not have completed yet. This could result in various issues
such as tearing or application hangs.
In the normal case, the behaviour is unchanged.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97957
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101683
Cc: [email protected]
[Michel Dänzer: Make Thomas' fix from bugzilla actually work as
intended, write commit log]
(cherry picked from commit 81fb1547772d42c527318837d4207ecdb6899e5d)
-rw-r--r-- | src/loader/loader_dri3_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index 493a7f5218c..1c93e7a96d3 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -640,7 +640,7 @@ loader_dri3_swap_buffers_msc(struct loader_dri3_drawable *draw, draw->vtable->flush_drawable(draw, flush_flags); - back = draw->buffers[LOADER_DRI3_BACK_ID(draw->cur_back)]; + back = draw->buffers[dri3_find_back(draw)]; if (draw->is_different_gpu && back) { /* Update the linear buffer before presenting the pixmap */ draw->ext->image->blitImage(dri_context, |