Mesa (staging/20.1): radv: Fix host->host signalling with legacy timeline semaphores.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 29 11:33:13 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 10dc6dcfafa1f4c0327d8d1b4d0c32696b6aadf1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=10dc6dcfafa1f4c0327d8d1b4d0c32696b6aadf1

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Tue Jul 28 04:14:23 2020 +0200

radv: Fix host->host signalling with legacy timeline semaphores.

Fixes: 88d41367b8a "radv: Add timelines with a VK_KHR_timeline_semaphore impl."
Reviewed-by: Dave Airlie <airlied at redhat.com>
Tested-by: Andres Rodriguez <andresx7 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6097>
(cherry picked from commit 05b278327066304d8822eb6414a89120c816e14a)

---

 .pick_status.json            |  2 +-
 src/amd/vulkan/radv_device.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index fe4260b1e59..a7ae4d96040 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -382,7 +382,7 @@
         "description": "radv: Fix host->host signalling with legacy timeline semaphores.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "88d41367b8aee961e6c47173a1e8848009e2215a"
     },
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index d131f3d39b4..803f48e6664 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -6215,7 +6215,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_NONE:
 	case RADV_SEMAPHORE_SYNCOBJ:



More information about the mesa-commit mailing list