From 3b363d5b552d4acca40251254edf5848654ea7bc Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 23 Mar 2021 13:58:12 -0500 Subject: [PATCH] anv: Assume syncobj support Sync object for i915 support has been in upstream Linux since 4.14 which is 3.5 years old at this point and, as far as we can tell, it also exists in all the ChromeOS kernels. Assuming it allows us to drop some of our more gnarly synchronization fall-back paths. At the time of merge, ChromeOS was on the following kernels: - kernel 3.18: SKL - kernel 4.4: BYT, KBL, APL - Kernel 4.14: BDW, GLK All of the pre-4.14 kernels have had syncobj support back-ported. Reviewed-by: Lionel Landwerlin Acked-by: Emma Anholt Part-of: --- src/intel/vulkan/anv_device.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 9aeabc9b381..e68ed136d86 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -810,12 +810,18 @@ anv_physical_device_try_create(struct anv_instance *instance, goto fail_alloc; } + if (!anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_FENCE_ARRAY)) { + result = vk_errorfi(device->instance, NULL, + VK_ERROR_INITIALIZATION_FAILED, + "kernel missing syncobj support"); + goto fail_base; + } + device->has_exec_async = anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_ASYNC); device->has_exec_capture = anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_CAPTURE); device->has_exec_fence = anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_FENCE); - device->has_syncobj = anv_gem_get_param(fd, I915_PARAM_HAS_EXEC_FENCE_ARRAY); - device->has_syncobj_wait = device->has_syncobj && - anv_gem_supports_syncobj_wait(fd); + device->has_syncobj = true; + device->has_syncobj_wait = anv_gem_supports_syncobj_wait(fd); device->has_syncobj_wait_available = anv_gem_get_drm_cap(fd, DRM_CAP_SYNCOBJ_TIMELINE) != 0;