diff options
author | Bas Nieuwenhuizen <[email protected]> | 2019-11-22 01:51:36 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-11-28 23:46:09 +0100 |
commit | 48fc65413c8607390b2ed8cdaccac490d8c8fdae (patch) | |
tree | 0a6fd6ef787094d97b4cc09cd76fdfead9dae3e6 /src | |
parent | 3fe3bde4f2c8813e13fa2992212ca46a894e68b6 (diff) |
radv: Fix timeline semaphore refcounting.
Was totally broken ...
Removed two if(point) {} because point is always non-NULL and we
were counting on that already for counting, since we NULL our
references to semaphores without active point earlier.
Fixes: 4aa75bb3bdd "radv: Add wait-before-submit support for timelines."
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2137
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 9add671998e..e33f80aa5e4 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -3973,8 +3973,7 @@ radv_finalize_timelines(struct radv_device *device, pthread_mutex_lock(&wait_sems[i]->timeline.mutex); struct radv_timeline_point *point = radv_timeline_find_point_at_least_locked(device, &wait_sems[i]->timeline, wait_values[i]); - if (point) - --point->wait_count; + point->wait_count -= 2; pthread_mutex_unlock(&wait_sems[i]->timeline.mutex); } } @@ -3983,11 +3982,9 @@ radv_finalize_timelines(struct radv_device *device, pthread_mutex_lock(&signal_sems[i]->timeline.mutex); struct radv_timeline_point *point = radv_timeline_find_point_at_least_locked(device, &signal_sems[i]->timeline, signal_values[i]); - if (point) { - signal_sems[i]->timeline.highest_submitted = - MAX2(signal_sems[i]->timeline.highest_submitted, point->value); - point->wait_count--; - } + signal_sems[i]->timeline.highest_submitted = + MAX2(signal_sems[i]->timeline.highest_submitted, point->value); + point->wait_count -= 2; radv_timeline_trigger_waiters_locked(&signal_sems[i]->timeline, processing_list); pthread_mutex_unlock(&signal_sems[i]->timeline.mutex); } @@ -5581,8 +5578,6 @@ radv_timeline_wait_locked(struct radv_device *device, if (!point) return VK_SUCCESS; - point->wait_count++; - pthread_mutex_unlock(&timeline->mutex); bool success = device->ws->wait_syncobj(device->ws, &point->syncobj, 1, true, abs_timeout); |