loader/dri3: Use dri3_find_back in loader_dri3_swap_buffers_msc
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 4 Jul 2017 03:55:15 +0000 (12:55 +0900)
committerMichel Dänzer <michel@daenzer.net>
Thu, 13 Jul 2017 07:49:28 +0000 (16:49 +0900)
commit81fb1547772d42c527318837d4207ecdb6899e5d
treed16fb1db42d1522a7d49440b4da452aa5b000605
parentc3b5c2ca19717b139c7de25b98827ec3efd4811c
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: mesa-stable@lists.freedesktop.org
[Michel Dänzer: Make Thomas' fix from bugzilla actually work as
 intended, write commit log]
src/loader/loader_dri3_helper.c