From f91de58818173b8ab2120a57f2cbdb81995d1ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 11 Nov 2025 09:25:51 -0800 Subject: [PATCH] anv: Add support to DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When this flag is set, it gives a hint to KMD to skip some operations around compressed buffers, like copying the auxiliary buffer to smem during eviction. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/dev/intel_device_info.py | 1 + src/intel/dev/xe/intel_device_info.c | 2 ++ src/intel/vulkan/xe/anv_kmd_backend.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/intel/dev/intel_device_info.py b/src/intel/dev/intel_device_info.py index fe6288976e2..bb24cca6535 100644 --- a/src/intel/dev/intel_device_info.py +++ b/src/intel/dev/intel_device_info.py @@ -310,6 +310,7 @@ Struct("intel_device_info", Member("bool", "has_set_pat_uapi"), Member("bool", "has_indirect_unroll"), Member("bool", "supports_low_latency_hint"), + Member("bool", "xe2_has_no_compression_hint"), Member("bool", "has_coarse_pixel_primitive_and_cb", compiler_field=True, comment=dedent("""\ diff --git a/src/intel/dev/xe/intel_device_info.c b/src/intel/dev/xe/intel_device_info.c index 6137124b28a..6382333b946 100644 --- a/src/intel/dev/xe/intel_device_info.c +++ b/src/intel/dev/xe/intel_device_info.c @@ -75,6 +75,8 @@ xe_query_config(int fd, struct intel_device_info *devinfo) devinfo->has_local_mem = true; if (config->info[DRM_XE_QUERY_CONFIG_FLAGS] & DRM_XE_QUERY_CONFIG_FLAG_HAS_LOW_LATENCY) devinfo->supports_low_latency_hint = true; + if (config->info[DRM_XE_QUERY_CONFIG_FLAGS] & DRM_XE_QUERY_CONFIG_FLAG_HAS_NO_COMPRESSION_HINT) + devinfo->xe2_has_no_compression_hint = true; if (!has_gmd_ip_version(devinfo)) devinfo->revision = (config->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] >> 16) & 0xFFFF; diff --git a/src/intel/vulkan/xe/anv_kmd_backend.c b/src/intel/vulkan/xe/anv_kmd_backend.c index bba284f16e0..cd4f67bfc16 100644 --- a/src/intel/vulkan/xe/anv_kmd_backend.c +++ b/src/intel/vulkan/xe/anv_kmd_backend.c @@ -66,6 +66,10 @@ xe_gem_create(struct anv_device *device, device->physical->vram_non_mappable.size > 0) flags |= DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM; + if ((alloc_flags & ANV_BO_ALLOC_COMPRESSED) == 0 && + device->info->xe2_has_no_compression_hint) + flags |= DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION; + struct drm_xe_gem_create gem_create = { /* From xe_drm.h: If a VM is specified, this BO must: * 1. Only ever be bound to that VM.