From 5346442e74ab93a3250b1f34421d0fd4c73a5a2d Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Wed, 27 Mar 2024 16:22:50 -0700 Subject: [PATCH] anv/xe: assert we're using drm_syncobjs only once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Everything on our xe.ko backend is built on top of this assertion. Assert it during driver initialization and just don't bother with it anymore later. Reviewed-by: José Roberto de Souza Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_device.c | 1 + src/intel/vulkan/xe/anv_batch_chain.c | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index b5b9a5f9af4..142ca21cf44 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2406,6 +2406,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance, device->sync_types[st_idx++] = &device->sync_timeline_type.sync; } } else { + assert(vk_sync_type_is_drm_syncobj(&device->sync_syncobj_type)); assert(device->sync_syncobj_type.features & VK_SYNC_FEATURE_TIMELINE); assert(device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT); } diff --git a/src/intel/vulkan/xe/anv_batch_chain.c b/src/intel/vulkan/xe/anv_batch_chain.c index bafc637fa7d..8624593b970 100644 --- a/src/intel/vulkan/xe/anv_batch_chain.c +++ b/src/intel/vulkan/xe/anv_batch_chain.c @@ -91,12 +91,8 @@ static void xe_exec_fill_sync(struct drm_xe_sync *xe_sync, struct vk_sync *vk_sync, uint64_t value, bool signal) { - if (unlikely(!vk_sync_type_is_drm_syncobj(vk_sync->type))) { - unreachable("Unsupported sync type"); - return; - } - const struct vk_drm_syncobj *syncobj = vk_sync_as_drm_syncobj(vk_sync); + assert(syncobj); xe_sync->handle = syncobj->syncobj; if (value) {