Nicolas Frattaroli
3668133e11
drm/panthor: Use existing OPP table if present
...
On SoCs where the GPU's power-domain is in charge of setting performance
levels, the OPP table of the GPU node will have already been populated
during said power-domain's attach_dev operation.
To avoid initialising an OPP table twice, only set the OPP regulator and
the OPPs from DT if there's no OPP table present.
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com >
Link: https://patch.msgid.link/20251017-mt8196-gpufreq-v8-4-98fc1cc566a1@collabora.com
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
2025-11-03 15:28:39 +00:00
Nicolas Frattaroli
3dd4844ba0
drm/panthor: call into devfreq for current frequency
...
As it stands, panthor keeps a cached current frequency value for when it
wants to retrieve it. This doesn't work well for when things might
switch frequency without panthor's knowledge.
Instead, implement the get_cur_freq operation, and expose it through a
helper function to the rest of panthor.
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: Karunika Choo <karunika.choo@arm.com >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com >
Link: https://patch.msgid.link/20251017-mt8196-gpufreq-v8-3-98fc1cc566a1@collabora.com
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com >
2025-11-03 15:27:25 +00:00
Jani Nikula
f6e8dc9edf
drm: include drm_print.h where needed
...
There are a gazillion files that depend on drm_print.h being indirectly
included via drm_buddy.h, drm_mm.h, or ttm/ttm_resource.h. In
preparation for removing those includes, explicitly include drm_print.h
where needed.
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://lore.kernel.org/r/5fe67395907be33eb5199ea6d540e29fddee71c8.1761734313.git.jani.nikula@intel.com
2025-10-31 10:34:52 +02:00
Rain Yang
a8cb5ca536
drm/panthor: skip regulator setup if no such prop
...
The regulator is optional, skip the setup instead of returning an
error if it is not present
Signed-off-by: Rain Yang <jiyu.yang@nxp.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Signed-off-by: Steven Price <steven.price@arm.com >
Link: https://lore.kernel.org/r/20250928090334.35389-2-jiyu.yang@oss.nxp.com
2025-10-09 13:57:12 +01:00
Boris Brezillon
b0758224e5
drm/panthor: Ignore devfreq_{suspend, resume}_device() failures
...
devfreq_{resume,suspend}_device() don't bother undoing the suspend_count
modifications if something fails, so either it assumes failures are
harmless, or it's super fragile/buggy. In either case it's not something
we can address at the driver level, so let's just assume failures are
harmless for now, like is done in panfrost.
v3:
- Add R-b
v2:
- Add R-b
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Reviewed-by: Adrian Larumbe <adrian.larumbe@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20241211075419.2333731-4-boris.brezillon@collabora.com
2024-12-11 10:03:59 +01:00
Adrián Larumbe
21c23e4b64
drm/panthor: Fix OPP refcnt leaks in devfreq initialisation
...
Rearrange lookup of recommended OPP for the Mali GPU device and its refcnt
decremental to make sure no OPP object leaks happen in the error path.
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com >
Fixes: fac9b22df4 ("drm/panthor: Add the devfreq logical block")
Reviewed-by: Steven Price <steven.price@arm.com >
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Steven Price <steven.price@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20241105205458.1318989-2-adrian.larumbe@collabora.com
2024-11-06 15:41:47 +00:00
Adrián Larumbe
37591ae11f
drm/panthor: record current and maximum device clock frequencies
...
In order to support UM in calculating rates of GPU utilisation, the current
operating and maximum GPU clock frequencies must be recorded during device
initialisation, and also during OPP state transitions.
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com >
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240923230912.2207320-3-adrian.larumbe@collabora.com
2024-10-02 10:55:16 +02:00
Boris Brezillon
9c86b03863
drm/panthor: Fix panthor_devfreq kerneldoc
...
Missing '*' to have a valid kerneldoc prefix.
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202403031019.6jvrOqGT-lkp@intel.com/
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240304090812.3941084-2-boris.brezillon@collabora.com
2024-03-11 10:50:37 +01:00
Boris Brezillon
fac9b22df4
drm/panthor: Add the devfreq logical block
...
Every thing related to devfreq in placed in panthor_devfreq.c, and
helpers that can be called by other logical blocks are exposed through
panthor_devfreq.h.
This implementation is loosely based on the panfrost implementation,
the only difference being that we don't count device users, because
the idle/active state will be managed by the scheduler logic.
v6:
- Add Maxime's and Heiko's acks
- Keep header inclusion alphabetically ordered
v4:
- Add Clément's A-b for the relicensing
v3:
- Add acks for the MIT/GPL2 relicensing
v2:
- Added in v2
Cc: Clément Péron <peron.clem@gmail.com > # MIT+GPL2 relicensing
Reviewed-by: Steven Price <steven.price@arm.com >
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com >
Acked-by: Steven Price <steven.price@arm.com > # MIT+GPL2 relicensing,Arm
Acked-by: Grant Likely <grant.likely@linaro.org > # MIT+GPL2 relicensing,Linaro
Acked-by: Boris Brezillon <boris.brezillon@collabora.com > # MIT+GPL2 relicensing,Collabora
Acked-by: Clément Péron <peron.clem@gmail.com > # MIT+GPL2 relicensing
Acked-by: Maxime Ripard <mripard@kernel.org >
Acked-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20240229162230.2634044-7-boris.brezillon@collabora.com
2024-03-01 10:04:07 +01:00