anv: Fix deadlock in anv_timelines_wait

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2945
Fixes: 34f32a6d66
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5005>
(cherry picked from commit 06b6c687e2)
This commit is contained in:
Danylo Piliaiev 2020-05-12 12:27:58 +03:00 committed by Dylan Baker
parent 6b4950f2d3
commit 3705ec33a5
2 changed files with 3 additions and 2 deletions

View file

@ -229,7 +229,7 @@
"description": "anv: Fix deadlock in anv_timelines_wait",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "34f32a6d6648073e2fda3fb78377124fb32bb288"
},

View file

@ -2229,9 +2229,10 @@ anv_timelines_wait(struct anv_device *device,
uint64_t abs_timeout_ns)
{
if (!wait_all && n_timelines > 1) {
pthread_mutex_lock(&device->mutex);
while (1) {
VkResult result;
pthread_mutex_lock(&device->mutex);
for (uint32_t i = 0; i < n_timelines; i++) {
result =
anv_timeline_wait_locked(device, timelines[i], serials[i], 0);