diff options
author | Marek Olšák <marek.olsak@amd.com> | 2020-12-24 06:14:11 -0500 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-01-05 02:43:55 +0000 |
commit | b94626d3eea1dac8c8fc234e3f0e9be502510dff (patch) | |
tree | bc95447cd972d7ac9771a9e043b0d6c7d55d6bab /src/amd/common | |
parent | e4fa7c440d273aad6cb9b9a6ee42a78810c9c2c2 (diff) |
ac,radeonsi: limit Smart Access Memory to Zen 3 and GFX10.3 due to perf issues
Many people experience performance degradation on some systems.
There will be a driconf option to enable SAM on other chips as well as
disable it on enabled systems.
Fixes: d3d6d381450 - ac: add radeon_info::all_vram_visible for Smart Access Memory
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3982
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8225>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_gpu_info.c | 8 | ||||
-rw-r--r-- | src/amd/common/ac_gpu_info.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index 1ea04abd8b0..22eebe4370b 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -29,6 +29,7 @@ #include "drm-uapi/amdgpu_drm.h" #include "sid.h" #include "util/macros.h" +#include "util/u_cpu_detect.h" #include "util/u_math.h" #include <stdio.h> @@ -506,6 +507,12 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, /* Add some margin of error, though this shouldn't be needed in theory. */ info->all_vram_visible = info->vram_size * 0.9 < info->vram_vis_size; + util_cpu_detect(); + info->smart_access_memory = info->all_vram_visible && + info->chip_class >= GFX10_3 && + util_cpu_caps.family >= CPU_AMD_ZEN3 && + util_cpu_caps.family < CPU_AMD_LAST; + /* Set chip identification. */ info->pci_id = amdinfo->asic_id; /* TODO: is this correct? */ info->pci_rev_id = amdinfo->pci_rev_id; @@ -1048,6 +1055,7 @@ void ac_print_gpu_info(struct radeon_info *info, FILE *f) fprintf(f, " address32_hi = %u\n", info->address32_hi); fprintf(f, " has_dedicated_vram = %u\n", info->has_dedicated_vram); fprintf(f, " all_vram_visible = %u\n", info->all_vram_visible); + fprintf(f, " smart_access_memory = %u\n", info->smart_access_memory); fprintf(f, " num_sdp_interfaces = %u\n", info->num_sdp_interfaces); fprintf(f, " num_tcc_blocks = %i\n", info->num_tcc_blocks); fprintf(f, " tcc_cache_line_size = %u\n", info->tcc_cache_line_size); diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h index 0904f125ea4..ed11d739058 100644 --- a/src/amd/common/ac_gpu_info.h +++ b/src/amd/common/ac_gpu_info.h @@ -99,6 +99,7 @@ struct radeon_info { uint32_t address32_hi; bool has_dedicated_vram; bool all_vram_visible; + bool smart_access_memory; bool has_l2_uncached; bool r600_has_virtual_memory; uint32_t num_sdp_interfaces; |