From 92f40084732311d4448b56a945e2c177706dcc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 9 Aug 2024 07:36:35 -0700 Subject: [PATCH] anv: Disable sparse even on Xe KMD with ANV_SPARSE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ANV_SPARSE had no effect on Xe KMD. Reviewed-by: Paulo Zanoni Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_physical_device.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index 6b361ce57cf..653aaac08f6 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -2397,22 +2397,21 @@ anv_physical_device_try_create(struct vk_instance *vk_instance, device->uses_relocs = device->info.kmd_type != INTEL_KMD_TYPE_XE; /* While xe.ko can use both vm_bind and TR-TT, i915.ko only has TR-TT. */ - if (device->info.kmd_type == INTEL_KMD_TYPE_XE) { - if (debug_get_bool_option("ANV_SPARSE_USE_TRTT", false)) - device->sparse_type = ANV_SPARSE_TYPE_TRTT; - else - device->sparse_type = ANV_SPARSE_TYPE_VM_BIND; - } else { - if (device->info.ver >= 12 && - device->has_exec_timeline && - debug_get_bool_option("ANV_SPARSE", true)) { - device->sparse_type = ANV_SPARSE_TYPE_TRTT; - } else if (instance->has_fake_sparse) { - device->sparse_type = ANV_SPARSE_TYPE_FAKE; + if (debug_get_bool_option("ANV_SPARSE", true)) { + if (device->info.kmd_type == INTEL_KMD_TYPE_XE) { + if (debug_get_bool_option("ANV_SPARSE_USE_TRTT", false)) + device->sparse_type = ANV_SPARSE_TYPE_TRTT; + else + device->sparse_type = ANV_SPARSE_TYPE_VM_BIND; } else { - device->sparse_type = ANV_SPARSE_TYPE_NOT_SUPPORTED; + if (device->info.ver >= 12 && device->has_exec_timeline) + device->sparse_type = ANV_SPARSE_TYPE_TRTT; } } + if (device->sparse_type == ANV_SPARSE_TYPE_NOT_SUPPORTED) { + if (instance->has_fake_sparse) + device->sparse_type = ANV_SPARSE_TYPE_FAKE; + } device->always_flush_cache = INTEL_DEBUG(DEBUG_STALL) || driQueryOptionb(&instance->dri_options, "always_flush_cache");