]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/msm: Add a6xx+ perfcntr tables
authorRob Clark <robin.clark@oss.qualcomm.com>
Tue, 26 May 2026 14:50:40 +0000 (07:50 -0700)
committerRob Clark <robin.clark@oss.qualcomm.com>
Fri, 29 May 2026 14:07:28 +0000 (07:07 -0700)
Wire up the generated perfcntr tables for a6xx+.  The PERFCNTR_CONFIG
ioctl will use this information to assign counters.

Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Anna Maniscalco <anna.maniscalco2000@gmail.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/728213/
Message-ID: <20260526145137.160554-7-robin.clark@oss.qualcomm.com>

drivers/gpu/drm/msm/adreno/a6xx_gpu.c
drivers/gpu/drm/msm/msm_gpu.h
drivers/gpu/drm/msm/msm_perfcntr.h

index 1c5ad3e83cc2c229fd08472601cecf240d7364e5..e9424d20277ce1a6179b4c06f04343c7c1c38ec4 100644 (file)
@@ -5,6 +5,7 @@
 #include "msm_gem.h"
 #include "msm_mmu.h"
 #include "msm_gpu_trace.h"
+#include "msm_perfcntr.h"
 #include "a6xx_gpu.h"
 #include "a6xx_gmu.xml.h"
 
@@ -2559,6 +2560,20 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
        adreno_gpu = &a6xx_gpu->base;
        gpu = &adreno_gpu->base;
 
+       if ((ADRENO_6XX_GEN1 <= config->info->family) &&
+           (config->info->family <= ADRENO_6XX_GEN4)) {
+               gpu->perfcntr_groups = a6xx_perfcntr_groups;
+               gpu->num_perfcntr_groups = a6xx_num_perfcntr_groups;
+       } else if ((ADRENO_7XX_GEN1 <= config->info->family) &&
+                  (config->info->family <= ADRENO_7XX_GEN3)) {
+               gpu->perfcntr_groups = a7xx_perfcntr_groups;
+               gpu->num_perfcntr_groups = a7xx_num_perfcntr_groups;
+       } else if ((ADRENO_8XX_GEN1 <= config->info->family) &&
+                  (config->info->family <= ADRENO_8XX_GEN2)) {
+               gpu->perfcntr_groups = a8xx_perfcntr_groups;
+               gpu->num_perfcntr_groups = a8xx_num_perfcntr_groups;
+       }
+
        mutex_init(&a6xx_gpu->gmu.lock);
        spin_lock_init(&a6xx_gpu->aperture_lock);
 
index 4b16b8069617f66132f1f19c579ec916a13bf20b..9b91d79dc277f7e07052b1b2f94b80aa1139f9e4 100644 (file)
@@ -24,6 +24,7 @@ struct msm_gem_submit;
 struct msm_gem_vm_log_entry;
 struct msm_gpu_state;
 struct msm_context;
+struct msm_perfcntr_group;
 
 struct msm_gpu_config {
        const char *ioname;
@@ -262,6 +263,9 @@ struct msm_gpu {
        bool allow_relocs;
 
        struct thermal_cooling_device *cooling;
+
+       const struct msm_perfcntr_group *perfcntr_groups;
+       unsigned num_perfcntr_groups;
 };
 
 static inline struct msm_gpu *dev_to_gpu(struct device *dev)
index 75300bd69e8025cb882b09c89a1cbe224a907133..8b0d627b2779c467cada33c0d5b3fd3b2dce5086 100644 (file)
@@ -35,6 +35,15 @@ struct msm_perfcntr_group {
        const struct msm_perfcntr_counter *counters;
 };
 
+extern const struct msm_perfcntr_group a6xx_perfcntr_groups[];
+extern const unsigned a6xx_num_perfcntr_groups;
+
+extern const struct msm_perfcntr_group a7xx_perfcntr_groups[];
+extern const unsigned a7xx_num_perfcntr_groups;
+
+extern const struct msm_perfcntr_group a8xx_perfcntr_groups[];
+extern const unsigned a8xx_num_perfcntr_groups;
+
 #define GROUP(_name, _pipe, _counters, _countables) {                          \
       .name = _name,                                                           \
       .pipe = _pipe,                                                           \