diff options
author | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2019-11-22 01:51:36 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-12-03 10:23:24 -0800 |
commit | 0ca8b506a467551a7f643083085dd1215792e081 (patch) | |
tree | ffc25552582cf4f8e13e57b78d21a68251db3372 | |
parent | a26064534501fe9857252367a8d593f0c7b8cee3 (diff) | |
download | mesa-0ca8b506a467551a7f643083085dd1215792e081.tar.gz mesa-0ca8b506a467551a7f643083085dd1215792e081.tar.bz2 mesa-0ca8b506a467551a7f643083085dd1215792e081.zip |
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 <samuel.pitoiset@gmail.com>
(cherry picked from commit 48fc65413c8607390b2ed8cdaccac490d8c8fdae)
-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 3cd8cedbbef..b499a4e71dd 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -3856,8 +3856,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); } } @@ -3866,11 +3865,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); } @@ -5459,8 +5456,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); |