From 1996970773a323533e1cc1b6b97f00a95d675f32 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Thu, 19 Mar 2020 21:34:27 +0100 Subject: drm/lima: Add optional devfreq and cooling device support Most platforms with a Mali-400 or Mali-450 GPU also have support for changing the GPU clock frequency. Add devfreq support so the GPU clock rate is updated based on the actual GPU usage when the "operating-points-v2" property is present in the board.dts. The actual devfreq code is taken from panfrost_devfreq.c and modified so it matches what the lima hardware needs: - a call to dev_pm_opp_set_clkname() during initialization because there are two clocks on Mali-4x0 IPs. "core" is the one that actually clocks the GPU so we need to control it using devfreq. - locking when reading or writing the devfreq statistics because (unlike than panfrost) we have multiple PP and GP IRQs which may finish jobs concurrently. Signed-off-by: Martin Blumenstingl Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20200319203427.2259891-3-martin.blumenstingl@googlemail.com --- drivers/gpu/drm/lima/lima_sched.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/drm/lima/lima_sched.h') diff --git a/drivers/gpu/drm/lima/lima_sched.h b/drivers/gpu/drm/lima/lima_sched.h index 02dfa14d7083..90f03c48ef4a 100644 --- a/drivers/gpu/drm/lima/lima_sched.h +++ b/drivers/gpu/drm/lima/lima_sched.h @@ -8,6 +8,7 @@ #include #include +struct lima_device; struct lima_vm; struct lima_sched_error_task { @@ -52,6 +53,8 @@ struct lima_sched_pipe { u32 fence_seqno; spinlock_t fence_lock; + struct lima_device *ldev; + struct lima_sched_task *current_task; struct lima_vm *current_vm; -- cgit v1.2.3