Mesa (main): turnip: Use the common AcquireNextImage implementation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 10 02:14:01 UTC 2022


Module: Mesa
Branch: main
Commit: 513d73b160e5f5a47d98db7978b3b43893a720c5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=513d73b160e5f5a47d98db7978b3b43893a720c5

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Wed Jun  8 18:29:09 2022 -0500

turnip: Use the common AcquireNextImage implementation

The only reason for the wrapper was so that we could dummy signal the
semaphore and fence.  Now that the WSI code always dos this for us, we
can drop our wrapper.

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>

---

 src/freedreno/vulkan/tu_drm.c     | 19 -------------------
 src/freedreno/vulkan/tu_kgsl.c    |  8 --------
 src/freedreno/vulkan/tu_private.h |  5 -----
 src/freedreno/vulkan/tu_wsi.c     | 22 ----------------------
 4 files changed, 54 deletions(-)

diff --git a/src/freedreno/vulkan/tu_drm.c b/src/freedreno/vulkan/tu_drm.c
index c485a128f62..4e70c684deb 100644
--- a/src/freedreno/vulkan/tu_drm.c
+++ b/src/freedreno/vulkan/tu_drm.c
@@ -1198,25 +1198,6 @@ tu_queue_submit(struct vk_queue *vk_queue, struct vk_queue_submit *submit)
    return VK_SUCCESS;
 }
 
-VkResult
-tu_signal_syncs(struct tu_device *device,
-                struct vk_sync *sync1, struct vk_sync *sync2)
-{
-   VkResult ret = VK_SUCCESS;
-
-   if (sync1) {
-      ret = vk_sync_signal(&device->vk, sync1, 0);
-
-      if (ret != VK_SUCCESS)
-         return ret;
-   }
-
-   if (sync2)
-      ret = vk_sync_signal(&device->vk, sync2, 0);
-
-   return ret;
-}
-
 int
 tu_syncobj_to_fd(struct tu_device *device, struct vk_sync *sync)
 {
diff --git a/src/freedreno/vulkan/tu_kgsl.c b/src/freedreno/vulkan/tu_kgsl.c
index 35699d3127a..0943e09c63a 100644
--- a/src/freedreno/vulkan/tu_kgsl.c
+++ b/src/freedreno/vulkan/tu_kgsl.c
@@ -686,14 +686,6 @@ tu_GetFenceStatus(VkDevice _device, VkFence _fence)
    return VK_SUCCESS;
 }
 
-int
-tu_signal_syncs(struct tu_device *device,
-                struct vk_sync *sync1, struct vk_sync *sync2)
-{
-   tu_finishme("tu_signal_syncs");
-   return 0;
-}
-
 int
 tu_syncobj_to_fd(struct tu_device *device, struct vk_sync *sync)
 {
diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h
index 2f7444c6d46..c38eb756a17 100644
--- a/src/freedreno/vulkan/tu_private.h
+++ b/src/freedreno/vulkan/tu_private.h
@@ -103,8 +103,6 @@ typedef uint32_t xcb_window_t;
 #include "vk_queue.h"
 #include "vk_object.h"
 #include "vk_sync.h"
-#include "vk_fence.h"
-#include "vk_semaphore.h"
 #include "vk_drm_syncobj.h"
 #include "vk_sync_timeline.h"
 
@@ -1991,9 +1989,6 @@ tu_drm_submitqueue_new(const struct tu_device *dev,
 void
 tu_drm_submitqueue_close(const struct tu_device *dev, uint32_t queue_id);
 
-int
-tu_signal_syncs(struct tu_device *device, struct vk_sync *sync1, struct vk_sync *sync2);
-
 int
 tu_syncobj_to_fd(struct tu_device *device, struct vk_sync *sync);
 
diff --git a/src/freedreno/vulkan/tu_wsi.c b/src/freedreno/vulkan/tu_wsi.c
index f7861ec69f7..19a17093d1e 100644
--- a/src/freedreno/vulkan/tu_wsi.c
+++ b/src/freedreno/vulkan/tu_wsi.c
@@ -77,28 +77,6 @@ tu_wsi_finish(struct tu_physical_device *physical_device)
                      &physical_device->instance->vk.alloc);
 }
 
-VKAPI_ATTR VkResult VKAPI_CALL
-tu_AcquireNextImage2KHR(VkDevice _device,
-                        const VkAcquireNextImageInfoKHR *pAcquireInfo,
-                        uint32_t *pImageIndex)
-{
-   TU_FROM_HANDLE(tu_device, device, _device);
-   VK_FROM_HANDLE(vk_fence, fence, pAcquireInfo->fence);
-   VK_FROM_HANDLE(vk_semaphore, semaphore, pAcquireInfo->semaphore);
-
-   struct tu_physical_device *pdevice = device->physical_device;
-
-   VkResult result = wsi_common_acquire_next_image2(
-      &pdevice->wsi_device, _device, pAcquireInfo, pImageIndex);
-
-   /* signal fence/semaphore - image is available immediately */
-   tu_signal_syncs(device,
-                   fence ? vk_fence_get_active_sync(fence) : NULL,
-                   semaphore ? vk_semaphore_get_active_sync(semaphore) : NULL);
-
-   return result;
-}
-
 VKAPI_ATTR VkResult VKAPI_CALL
 tu_QueuePresentKHR(VkQueue _queue, const VkPresentInfoKHR *pPresentInfo)
 {



More information about the mesa-commit mailing list