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

Author: José Roberto de Souza <[email protected]>
Date:   Thu Sep 15 06:46:23 2022 -0700

anv: Disable anv_bo_sync_type for Xe kmd

anv_bo_sync_type is only supported with i915, if necessary it will be
implemented for Xe kmd.

Signed-off-by: José Roberto de Souza <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>

---

 src/intel/vulkan/anv_device.c | 20 ++++++++++++++------
 src/intel/vulkan/anv_wsi.c    |  6 ++++--
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 9e411c45144..61949da3234 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -921,12 +921,18 @@ anv_physical_device_try_create(struct vk_instance 
*vk_instance,
       device->sync_syncobj_type.features &= ~VK_SYNC_FEATURE_TIMELINE;
    device->sync_types[st_idx++] = &device->sync_syncobj_type;
 
-   if (!(device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT))
-      device->sync_types[st_idx++] = &anv_bo_sync_type;
-
-   if (!(device->sync_syncobj_type.features & VK_SYNC_FEATURE_TIMELINE)) {
-      device->sync_timeline_type = 
vk_sync_timeline_get_type(&anv_bo_sync_type);
-      device->sync_types[st_idx++] = &device->sync_timeline_type.sync;
+   /* anv_bo_sync_type is only supported with i915 for now  */
+   if (device->info.kmd_type == INTEL_KMD_TYPE_I915) {
+      if (!(device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT))
+         device->sync_types[st_idx++] = &anv_bo_sync_type;
+
+      if (!(device->sync_syncobj_type.features & VK_SYNC_FEATURE_TIMELINE)) {
+         device->sync_timeline_type = 
vk_sync_timeline_get_type(&anv_bo_sync_type);
+         device->sync_types[st_idx++] = &device->sync_timeline_type.sync;
+      }
+   } else {
+      assert(device->sync_syncobj_type.features & VK_SYNC_FEATURE_TIMELINE);
+      assert(device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT);
    }
 
    device->sync_types[st_idx++] = NULL;
@@ -3051,6 +3057,8 @@ VkResult anv_CreateDevice(
 
    device->vk.command_buffer_ops = &anv_cmd_buffer_ops;
    device->vk.create_sync_for_memory = anv_create_sync_for_memory;
+   if (physical_device->info.kmd_type == INTEL_KMD_TYPE_I915)
+      device->vk.create_sync_for_memory = anv_create_sync_for_memory;
    vk_device_set_drm_fd(&device->vk, device->fd);
 
    uint32_t num_queues = 0;
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index b8177924530..0087ab041dc 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -65,9 +65,11 @@ anv_init_wsi(struct anv_physical_device *physical_device)
       return result;
 
    physical_device->wsi_device.supports_modifiers = true;
-   physical_device->wsi_device.signal_semaphore_with_memory = true;
-   physical_device->wsi_device.signal_fence_with_memory = true;
    physical_device->wsi_device.get_blit_queue = anv_wsi_get_prime_blit_queue;
+   if (physical_device->info.kmd_type == INTEL_KMD_TYPE_I915) {
+      physical_device->wsi_device.signal_semaphore_with_memory = true;
+      physical_device->wsi_device.signal_fence_with_memory = true;
+   }
 
    physical_device->vk.wsi_device = &physical_device->wsi_device;
 

Reply via email to