Mesa (master): radv: Start signalling semaphores in WSI acquire.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 30 18:56:52 UTC 2019


Module: Mesa
Branch: master
Commit: 780c937a5ded1a4586ba4160020200eebe57b311
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=780c937a5ded1a4586ba4160020200eebe57b311

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Wed Oct 30 14:51:17 2019 +0100

radv: Start signalling semaphores in WSI acquire.

Winsys semaphores without signal operation get silently ignored.

Not so for syncobjs, so actually signal them.

Fixes: 84d9551b232 "radv: Always enable syncobj when supported for all fences/semaphores."
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2030
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/amd/vulkan/radv_wsi.c | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index fadb68a9504..a2b0afa48c3 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -231,19 +231,39 @@ VkResult radv_AcquireNextImage2KHR(
 	RADV_FROM_HANDLE(radv_device, device, _device);
 	struct radv_physical_device *pdevice = device->physical_device;
 	RADV_FROM_HANDLE(radv_fence, fence, pAcquireInfo->fence);
+	RADV_FROM_HANDLE(radv_semaphore, semaphore, pAcquireInfo->semaphore);
 
 	VkResult result = wsi_common_acquire_next_image2(&pdevice->wsi_device,
 							 _device,
                                                          pAcquireInfo,
 							 pImageIndex);
 
-	if (fence && (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR)) {
-		if (fence->fence)
-			device->ws->signal_fence(fence->fence);
-		if (fence->temp_syncobj) {
-			device->ws->signal_syncobj(device->ws, fence->temp_syncobj);
-		} else if (fence->syncobj) {
-			device->ws->signal_syncobj(device->ws, fence->syncobj);
+	if (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR) {
+		if (fence) {
+			if (fence->fence)
+				device->ws->signal_fence(fence->fence);
+			if (fence->temp_syncobj) {
+				device->ws->signal_syncobj(device->ws, fence->temp_syncobj);
+			} else if (fence->syncobj) {
+				device->ws->signal_syncobj(device->ws, fence->syncobj);
+			}
+		}
+		if (semaphore) {
+			struct radv_semaphore_part *part =
+				semaphore->temporary.kind != RADV_SEMAPHORE_NONE ?
+					&semaphore->temporary : &semaphore->permanent;
+
+			switch (part->kind) {
+			case RADV_SEMAPHORE_NONE:
+			case RADV_SEMAPHORE_WINSYS:
+				/* Do not need to do anything. */
+				break;
+			case RADV_SEMAPHORE_TIMELINE:
+				unreachable("WSI only allows binary semaphores.");
+			case RADV_SEMAPHORE_SYNCOBJ:
+				device->ws->signal_syncobj(device->ws, part->syncobj);
+				break;
+			}
 		}
 	}
 	return result;




More information about the mesa-commit mailing list