diff options
author | Neil Armstrong <neil.armstrong@linaro.org> | 2024-12-17 15:51:14 +0100 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2025-01-03 16:20:27 +0100 |
commit | 5b0619539c109325cdc516a2c1aded57262ec51b (patch) | |
tree | 9930e7ee916fcd81d0901ac5d33c08bf34be46f7 /drivers/gpu/drm/msm/adreno/a6xx_gmu.h | |
parent | drm/msm/a6xx: Print GMU core firmware version at boot (diff) | |
download | linux-5b0619539c109325cdc516a2c1aded57262ec51b.tar.xz linux-5b0619539c109325cdc516a2c1aded57262ec51b.zip |
drm/msm: adreno: add defines for gpu & gmu frequency table sizes
Even if the code uses ARRAY_SIZE() to fill those tables,
it's still a best practice to not use magic values for
tables in structs.
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/629393/
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a6xx_gmu.h')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h index b4a79f88ccf4..88f18ea6a38a 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h @@ -19,6 +19,9 @@ struct a6xx_gmu_bo { u64 iova; }; +#define GMU_MAX_GX_FREQS 16 +#define GMU_MAX_CX_FREQS 4 + /* * These define the different GMU wake up options - these define how both the * CPU and the GMU bring up the hardware @@ -79,12 +82,12 @@ struct a6xx_gmu { int current_perf_index; int nr_gpu_freqs; - unsigned long gpu_freqs[16]; - u32 gx_arc_votes[16]; + unsigned long gpu_freqs[GMU_MAX_GX_FREQS]; + u32 gx_arc_votes[GMU_MAX_GX_FREQS]; int nr_gmu_freqs; - unsigned long gmu_freqs[4]; - u32 cx_arc_votes[4]; + unsigned long gmu_freqs[GMU_MAX_CX_FREQS]; + u32 cx_arc_votes[GMU_MAX_CX_FREQS]; unsigned long freq; |