radv: Fix host->host signalling with legacy timeline semaphores.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 28 Jul 2020 02:14:23 +0000 (04:14 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jul 2020 09:33:59 +0000 (09:33 +0000)
Fixes: 88d41367b8a "radv: Add timelines with a VK_KHR_timeline_semaphore impl."
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Andres Rodriguez <andresx7@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6097>

src/amd/vulkan/radv_device.c

index 4dac1be049554c6bd02332548a983fcfae274c6d..2e9cf32aa4b11f992667b998c497f7b35b173c45 100644 (file)
@@ -6143,7 +6143,16 @@ radv_SignalSemaphore(VkDevice _device,
                radv_timeline_trigger_waiters_locked(&part->timeline, &processing_list);
                pthread_mutex_unlock(&part->timeline.mutex);
 
-               return radv_process_submissions(&processing_list);
+               VkResult result = radv_process_submissions(&processing_list);
+
+               /* This needs to happen after radv_process_submissions, so
+                * that any submitted submissions that are now unblocked get
+                * processed before we wake the application. This way we
+                * ensure that any binary semaphores that are now unblocked
+                * are usable by the application. */
+               pthread_cond_broadcast(&device->timeline_cond);
+
+               return result;
        }
        case RADV_SEMAPHORE_TIMELINE_SYNCOBJ: {
                part->timeline_syncobj.max_point = MAX2(part->timeline_syncobj.max_point, pSignalInfo->value);