nv2a: Grab lock before marking pending download

This commit is contained in:
Matt Borgerson 2020-12-30 03:28:51 -07:00 committed by mborgerson
parent e431cbff82
commit 996f3d4dc3
1 changed files with 1 additions and 2 deletions

View File

@ -3847,10 +3847,9 @@ static void pgraph_wait_for_surface_download(SurfaceBinding *e)
NV2AState *d = g_nv2a;
if (atomic_read(&e->draw_dirty)) {
qemu_mutex_lock(&d->pfifo.lock);
atomic_set(&e->download_pending, true);
atomic_set(&d->pgraph.downloads_pending, true);
qemu_mutex_lock(&d->pfifo.lock);
do {
qemu_cond_broadcast(&d->pfifo.fifo_cond);
qemu_cond_wait(&d->pfifo.fifo_idle_cond, &d->pfifo.lock);