From fd368f5521129731d2aa91f0f14603d9e05c32cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Thu, 18 Apr 2024 13:49:40 -0700 Subject: [PATCH] anv: Set maxComputeSharedMemorySize value for Xe2 platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xe2 platforms allows for a larger compute shared memory(SLM). For LNL this limit is 160KB but due to a workaround the limit is 128K. BSpec: 71053 Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/dev/intel_device_info.c | 30 ++++++++++++++++++++++++++++++ src/intel/dev/intel_device_info.h | 3 +++ src/intel/vulkan/anv_device.c | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/intel/dev/intel_device_info.c b/src/intel/dev/intel_device_info.c index b104110df56..5289ef4c9d2 100644 --- a/src/intel/dev/intel_device_info.c +++ b/src/intel/dev/intel_device_info.c @@ -1981,3 +1981,33 @@ intel_device_info_wa_stepping(struct intel_device_info *devinfo) return INTEL_STEPPING_RELEASE; } +uint32_t +intel_device_info_get_max_slm_size(const struct intel_device_info *devinfo) +{ + uint32_t k_bytes = 0; + + if (devinfo->verx10 >= 200) { + k_bytes = intel_device_info_get_max_preferred_slm_size(devinfo); + } else { + k_bytes = 64; + } + + return k_bytes * 1024; +} + +uint32_t +intel_device_info_get_max_preferred_slm_size(const struct intel_device_info *devinfo) +{ + uint32_t k_bytes = 0; + + if (devinfo->verx10 >= 200) { + if (intel_needs_workaround(devinfo, 16018610683)) + k_bytes = 128; + else + k_bytes = 160; + } else { + k_bytes = 128; + } + + return k_bytes * 1024; +} diff --git a/src/intel/dev/intel_device_info.h b/src/intel/dev/intel_device_info.h index b96f7a2e638..c3079d29c1a 100644 --- a/src/intel/dev/intel_device_info.h +++ b/src/intel/dev/intel_device_info.h @@ -211,6 +211,9 @@ void intel_device_info_update_after_hwconfig(struct intel_device_info *devinfo); enum intel_wa_steppings intel_device_info_wa_stepping(struct intel_device_info *devinfo); +uint32_t intel_device_info_get_max_slm_size(const struct intel_device_info *devinfo); +uint32_t intel_device_info_get_max_preferred_slm_size(const struct intel_device_info *devinfo); + #ifdef __cplusplus } #endif diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 8ad497da043..e3fa5b45b79 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1338,7 +1338,7 @@ get_properties(const struct anv_physical_device *pdevice, .maxFragmentOutputAttachments = 8, .maxFragmentDualSrcAttachments = 1, .maxFragmentCombinedOutputResources = MAX_RTS + max_ssbos + max_images, - .maxComputeSharedMemorySize = 64 * 1024, + .maxComputeSharedMemorySize = intel_device_info_get_max_slm_size(&pdevice->info), .maxComputeWorkGroupCount = { 65535, 65535, 65535 }, .maxComputeWorkGroupInvocations = max_workgroup_size, .maxComputeWorkGroupSize = {