From 6b6340fea1731a71e56c156d27d3fd66e05e427e Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 19 Jul 2024 10:18:42 +0200 Subject: [PATCH] radv/virtio: disable syncobj timeline support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The virtio-gpu guest kmd reports timelines as supported, so querying DRM_CAP_SYNCOBJ_TIMELINE as vk_drm_syncobj_get_type() does will return true. The native context code on the other hand doesn't support timelines, and support is disabled in the "ac/virtio: disable timeline_syncobj support" commit. Fix the inconsistency by manually disabling timeline support when info.has_timeline_syncobj is false. Tested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko Reviewed-by: Marek Olšák Part-of: --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index 093ba3e24b3..5202e8fad63 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -274,6 +274,14 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags, if (ws->syncobj_sync_type.features) { /* multi wait is always supported */ ws->syncobj_sync_type.features |= VK_SYNC_FEATURE_GPU_MULTI_WAIT; + + if (!ws->info.has_timeline_syncobj && ws->syncobj_sync_type.features & VK_SYNC_FEATURE_TIMELINE) { + /* Disable timeline feature if it was disabled in the driver. */ + assert(is_virtio); + ws->syncobj_sync_type.get_value = NULL; + ws->syncobj_sync_type.features &= ~VK_SYNC_FEATURE_TIMELINE; + } + ws->sync_types[num_sync_types++] = &ws->syncobj_sync_type; if (!(ws->syncobj_sync_type.features & VK_SYNC_FEATURE_TIMELINE)) { ws->emulated_timeline_sync_type = vk_sync_timeline_get_type(&ws->syncobj_sync_type);