ac/gpu_info: fix detection of smart access memory
authorMarek Olšák <marek.olsak@amd.com>
Tue, 31 Aug 2021 09:50:54 +0000 (05:50 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Sep 2021 00:42:58 +0000 (00:42 +0000)
chip_class was 0. Move the code after setting chip_class.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5282

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12656>

src/amd/common/ac_gpu_info.c

index 7bb4fbb..b7d04e8 100644 (file)
@@ -553,10 +553,6 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
    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_get_cpu_caps()->family >= CPU_AMD_ZEN3 &&
-                               util_get_cpu_caps()->family < CPU_AMD_LAST;
 
    /* Set chip identification. */
    info->pci_id = amdinfo->asic_id; /* TODO: is this correct? */
@@ -653,6 +649,11 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
       return false;
    }
 
+   info->smart_access_memory = info->all_vram_visible &&
+                               info->chip_class >= GFX10_3 &&
+                               util_get_cpu_caps()->family >= CPU_AMD_ZEN3 &&
+                               util_get_cpu_caps()->family < CPU_AMD_LAST;
+
    info->family_id = amdinfo->family_id;
    info->chip_external_rev = amdinfo->chip_external_rev;
    info->marketing_name = amdgpu_get_marketing_name(dev);