Mesa (main): util/cpu_detect: add/guess support for next Zen CPUs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 31 22:52:44 UTC 2021


Module: Mesa
Branch: main
Commit: 386e5371a79b8fe5a8610447b5d91bcf610bfcc3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=386e5371a79b8fe5a8610447b5d91bcf610bfcc3

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Aug 10 12:09:57 2021 -0400

util/cpu_detect: add/guess support for next Zen CPUs

so that we don't have to update this anymore

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

---

 src/util/u_cpu_detect.c | 3 +++
 src/util/u_cpu_detect.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/util/u_cpu_detect.c b/src/util/u_cpu_detect.c
index df52ad4f4b2..ae711aae14f 100644
--- a/src/util/u_cpu_detect.c
+++ b/src/util/u_cpu_detect.c
@@ -709,6 +709,9 @@ util_cpu_detect_once(void)
          case 0x19:
             util_cpu_caps.family = CPU_AMD_ZEN3;
             break;
+         default:
+            if (util_cpu_caps.x86_cpu_type > 0x19)
+               util_cpu_caps.family = CPU_AMD_ZEN_NEXT;
          }
 
          /* general feature flags */
diff --git a/src/util/u_cpu_detect.h b/src/util/u_cpu_detect.h
index 9fd4dd289df..59dd2304e10 100644
--- a/src/util/u_cpu_detect.h
+++ b/src/util/u_cpu_detect.h
@@ -50,6 +50,7 @@ enum cpu_family {
    CPU_AMD_ZEN1_ZEN2,
    CPU_AMD_ZEN_HYGON,
    CPU_AMD_ZEN3,
+   CPU_AMD_ZEN_NEXT,
    CPU_AMD_LAST,
 };
 



More information about the mesa-commit mailing list