mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 05:10:23 +01:00
st/wgl: check for negative delta in wait_swap_interval()
This can happen because of rollover. See bug report for details.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102241
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit d90e05ad48)
This commit is contained in:
parent
c7c6ba44ca
commit
e452ed26ff
1 changed files with 5 additions and 2 deletions
|
|
@ -601,8 +601,11 @@ wait_swap_interval(struct stw_framebuffer *fb)
|
|||
int64_t min_swap_period =
|
||||
1.0e6 / stw_dev->refresh_rate * stw_dev->swap_interval;
|
||||
|
||||
/* if time since last swap is less than wait period, wait */
|
||||
if (delta < min_swap_period) {
|
||||
/* If time since last swap is less than wait period, wait.
|
||||
* Note that it's possible for the delta to be negative because of
|
||||
* rollover. See https://bugs.freedesktop.org/show_bug.cgi?id=102241
|
||||
*/
|
||||
if ((delta >= 0) && (delta < min_swap_period)) {
|
||||
float fudge = 1.75f; /* emperical fudge factor */
|
||||
int64_t wait = (min_swap_period - delta) * fudge;
|
||||
os_time_sleep(wait);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue