mirror of
https://github.com/yshui/picom.git
synced 2025-04-14 17:53:25 -04:00
vblank: be more defensive against NVIDIA
There is a bug in the NVIDIA driver that it sometimes does not store msc into the pointer we passed to glXWaitVideoSyncSGI, leaving `last_msc` uninitialized. This change makes sure `last_msc` is always initialized regardless of this bug. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
e65ebd7d53
commit
01b6766519
1 changed files with 3 additions and 2 deletions
|
@ -214,6 +214,8 @@ static void *sgi_video_sync_thread(void *data) {
|
|||
pthread_cond_signal(&args->start_cnd);
|
||||
pthread_mutex_unlock(&args->start_mtx);
|
||||
|
||||
unsigned int last_msc = 0;
|
||||
|
||||
pthread_mutex_lock(&self->vblank_requested_mtx);
|
||||
while (self->running) {
|
||||
if (!self->vblank_requested) {
|
||||
|
@ -223,10 +225,9 @@ static void *sgi_video_sync_thread(void *data) {
|
|||
}
|
||||
pthread_mutex_unlock(&self->vblank_requested_mtx);
|
||||
|
||||
unsigned int last_msc;
|
||||
glXWaitVideoSyncSGI(1, 0, &last_msc);
|
||||
|
||||
struct timespec now;
|
||||
struct timespec now = {};
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
atomic_store(&self->current_msc, last_msc);
|
||||
atomic_store(&self->current_ust,
|
||||
|
|
Loading…
Add table
Reference in a new issue