diff options
author | Konrad Dybcio <konrad.dybcio@linaro.org> | 2023-02-23 11:52:01 +0100 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2023-03-20 11:04:59 -0700 |
commit | a9cf6e7fc3f1aa1e7754e8169701e91d50ad8468 (patch) | |
tree | c295185c50f9635ae412375c7d9533391bd36497 /drivers/gpu/drm/msm/adreno/a3xx_gpu.c | |
parent | 9f251f934012bf07d31c695f770ecfeacbfdb296 (diff) | |
download | lwn-a9cf6e7fc3f1aa1e7754e8169701e91d50ad8468.tar.gz lwn-a9cf6e7fc3f1aa1e7754e8169701e91d50ad8468.zip |
drm/msm/a3xx: Implement .gpu_busy
Add support for gpu_busy on a3xx, which is required for devfreq
support.
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> #ifc6410
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/523789/
Link: https://lore.kernel.org/r/20230223-topic-opp-v3-5-5f22163cd1df@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a3xx_gpu.c')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c index 948785ed07bb..c86b377f6f0d 100644 --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c @@ -477,6 +477,16 @@ static struct msm_gpu_state *a3xx_gpu_state_get(struct msm_gpu *gpu) return state; } +static u64 a3xx_gpu_busy(struct msm_gpu *gpu, unsigned long *out_sample_rate) +{ + u64 busy_cycles; + + busy_cycles = gpu_read64(gpu, REG_A3XX_RBBM_PERFCTR_RBBM_1_LO); + *out_sample_rate = clk_get_rate(gpu->core_clk); + + return busy_cycles; +} + static u32 a3xx_get_rptr(struct msm_gpu *gpu, struct msm_ringbuffer *ring) { ring->memptrs->rptr = gpu_read(gpu, REG_AXXX_CP_RB_RPTR); @@ -498,6 +508,7 @@ static const struct adreno_gpu_funcs funcs = { #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) .show = adreno_show, #endif + .gpu_busy = a3xx_gpu_busy, .gpu_state_get = a3xx_gpu_state_get, .gpu_state_put = adreno_gpu_state_put, .create_address_space = adreno_create_address_space, |