Mesa (main): vulkan/wsi: Use HAVE_LIBDRM to detect DRM instead of !_WIN32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 22 01:47:31 UTC 2022


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

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Tue Jun 21 12:08:06 2022 -0500

vulkan/wsi: Use HAVE_LIBDRM to detect DRM instead of !_WIN32

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Acked-by: Danylo Piliaiev <dpiliaiev at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17170>

---

 src/vulkan/wsi/wsi_common.c         | 8 ++++----
 src/vulkan/wsi/wsi_common_private.h | 2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index bfa607c26a7..f3a9361a25c 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -865,7 +865,7 @@ wsi_signal_semaphore_for_image(struct vk_device *device,
 
    vk_semaphore_reset_temporary(device, semaphore);
 
-#ifndef _WIN32
+#ifdef HAVE_LIBDRM
    VkResult result = wsi_create_sync_for_dma_buf_wait(chain, image,
                                                       VK_SYNC_FEATURE_GPU_WAIT,
                                                       &semaphore->temporary);
@@ -897,7 +897,7 @@ wsi_signal_fence_for_image(struct vk_device *device,
 
    vk_fence_reset_temporary(device, fence);
 
-#ifndef _WIN32
+#ifdef HAVE_LIBDRM
    VkResult result = wsi_create_sync_for_dma_buf_wait(chain, image,
                                                       VK_SYNC_FEATURE_CPU_WAIT,
                                                       &fence->temporary);
@@ -1075,7 +1075,7 @@ wsi_common_queue_present(const struct wsi_device *wsi,
       VkFence fence = swapchain->fences[image_index];
 
       bool has_signal_dma_buf = false;
-#ifndef _WIN32
+#ifdef HAVE_LIBDRM
       result = wsi_prepare_signal_dma_buf_from_semaphore(swapchain, image);
       if (result == VK_SUCCESS) {
          assert(submit_info.signalSemaphoreCount == 0);
@@ -1108,7 +1108,7 @@ wsi_common_queue_present(const struct wsi_device *wsi,
       if (result != VK_SUCCESS)
          goto fail_present;
 
-#ifndef _WIN32
+#ifdef HAVE_LIBDRM
       if (has_signal_dma_buf) {
          result = wsi_signal_dma_buf_from_semaphore(swapchain, image);
          if (result != VK_SUCCESS)
diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h
index e5d6bb5204b..b35ee4934b1 100644
--- a/src/vulkan/wsi/wsi_common_private.h
+++ b/src/vulkan/wsi/wsi_common_private.h
@@ -197,6 +197,7 @@ void
 wsi_destroy_image(const struct wsi_swapchain *chain,
                   struct wsi_image *image);
 
+#ifdef HAVE_LIBDRM
 VkResult
 wsi_prepare_signal_dma_buf_from_semaphore(struct wsi_swapchain *chain,
                                           const struct wsi_image *image);
@@ -208,6 +209,7 @@ wsi_create_sync_for_dma_buf_wait(const struct wsi_swapchain *chain,
                                  const struct wsi_image *image,
                                  enum vk_sync_features sync_features,
                                  struct vk_sync **sync_out);
+#endif
 
 struct wsi_interface {
    VkResult (*get_support)(VkIcdSurfaceBase *surface,



More information about the mesa-commit mailing list