diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index b97a2aa3099..14c64ceaf19 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -142,9 +142,6 @@ static void get_device_extensions(const struct anv_physical_device *device, struct vk_device_extension_table *ext) { - const bool has_syncobj_wait = - (device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT) != 0; - const bool rt_enabled = ANV_SUPPORT_RT && device->info.has_ray_tracing; const bool video_decode_enabled = device->instance->debug & ANV_DEBUG_VIDEO_DECODE; const bool video_encode_enabled = device->instance->debug & ANV_DEBUG_VIDEO_ENCODE; @@ -170,8 +167,8 @@ get_device_extensions(const struct anv_physical_device *device, .KHR_driver_properties = true, .KHR_dynamic_rendering = true, .KHR_dynamic_rendering_local_read = true, - .KHR_external_fence = has_syncobj_wait, - .KHR_external_fence_fd = has_syncobj_wait, + .KHR_external_fence = true, + .KHR_external_fence_fd = true, .KHR_external_memory = true, .KHR_external_memory_fd = true, .KHR_external_semaphore = true, @@ -2667,28 +2664,13 @@ anv_physical_device_try_create(struct vk_instance *vk_instance, device->has_cooperative_matrix = device->info.cooperative_matrix_configurations[0].scope != INTEL_CMAT_SCOPE_NONE; - unsigned st_idx = 0; - device->sync_syncobj_type = vk_drm_syncobj_get_type(fd); - device->sync_types[st_idx++] = &device->sync_syncobj_type; + 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); - /* 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(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); - } - - device->sync_types[st_idx++] = NULL; - assert(st_idx <= ARRAY_SIZE(device->sync_types)); + device->sync_types[0] = &device->sync_syncobj_type; + device->sync_types[1] = NULL; device->vk.supported_sync_types = device->sync_types; device->vk.pipeline_cache_import_ops = anv_cache_import_ops; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index dd992042dad..a1b8acd67f5 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -99,7 +99,6 @@ #include "vk_sampler.h" #include "vk_shader_module.h" #include "vk_sync.h" -#include "vk_sync_timeline.h" #include "vk_texcompress_astc.h" #include "vk_util.h" #include "vk_query_pool.h" @@ -1280,8 +1279,7 @@ struct anv_physical_device { uint8_t rt_uuid[VK_UUID_SIZE]; struct vk_sync_type sync_syncobj_type; - struct vk_sync_timeline_type sync_timeline_type; - const struct vk_sync_type * sync_types[4]; + const struct vk_sync_type * sync_types[2]; struct wsi_device wsi_device; int local_fd; diff --git a/src/intel/vulkan/i915/anv_device.c b/src/intel/vulkan/i915/anv_device.c index ca9d3500912..a2a3dded0fc 100644 --- a/src/intel/vulkan/i915/anv_device.c +++ b/src/intel/vulkan/i915/anv_device.c @@ -121,6 +121,12 @@ anv_i915_physical_device_get_parameters(struct anv_physical_device *device) return result; } + if (!i915_gem_supports_dma_buf_sync_file(fd)) { + result = vk_errorf(device, VK_ERROR_INCOMPATIBLE_DRIVER, + "kernel missing dma-buf sync file import/export"); + return result; + } + /* Start with medium; sorted low to high */ const VkQueueGlobalPriorityKHR priorities[] = { VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR,