Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drm/panfrost: Enable GPU_PM_RT for RK3399
@ 2026-11-23 17:33 Igor Velkov via B4 Relay
  2026-11-23 17:43 ` Adrián Larumbe
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Velkov via B4 Relay @ 2026-11-23 17:33 UTC (permalink / raw)
  To: Boris Brezillon, Rob Herring, Steven Price, Adrián Larumbe,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Heiko Stuebner
  Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
	Daniel Stone, Igor Velkov

From: Igor Velkov <iav@iav.lv>

The RK3399 Mali-T860 matches arm,mali-t860 and gets default_data, so
panfrost enables aclk_gpu at probe and keeps it enabled until unbind;
runtime suspend powers the GPU off but leaves the clock on.

On ROCK Pi 4A restore from hibernation hangs in genpd_restore_noirq()
of the GPU when the hibernated kernel had panfrost bound and the
kernel that loads the image does not. There clk_disable_unused()
gates aclk_gpu, while the restored image still holds an enable count
on it, so powering the GPU domain back on does not ungate the clock.
With the clock gated in runtime suspend, as on the Allwinner H616 and
the Renesas RZ/G3L and RZ/G3E, restore completes.

Match rockchip,rk3399-mali to default_pm_rt_data, which differs from
default_data only in GPU_PM_RT.

Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Igor Velkov <iav@iav.lv>
---
Tested on ROCK Pi 4A, drm-misc-next c408466a4dfa with the rkvdec fix [1]
applied: hibernation restores 9 of 9 with this patch (3 with an HDMI
mode held, 3 right after glmark2-es2-drm, 3 idle), and the GPU renders
after restore. With the GPU node left with arm,mali-t860 only, restore
hangs 2 of 2, in genpd_restore_noirq() of the GPU.
[1] fixes the same kind of hang in rkvdec, which otherwise hits first;
this patch applies and builds without it.

[1] https://lore.kernel.org/r/20261030-rkvdec-runtime-pm-clocks-v2-1-8ff510a231de@iav.lv

Changes in v3:
- Retitle as Steven suggested, say what GPU_PM_RT changes
- Add Steven's Reviewed-by, given on v1 (same code)
- Link to v2: https://lore.kernel.org/r/20261122-panfrost-rk3399-pm-rt-v2-1-40f1791aa1a8@iav.lv

Changes in v2:
- Name the SoCs that already use default_pm_rt_data
- Say why restore hangs
- Rebase onto drm-misc-next
- Link to v1: https://lore.kernel.org/r/20261030-panfrost-rk3399-pm-rt-v1-1-e94437159a9d@iav.lv
---
 drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index eeda113037fe..91acfa13ef42 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -983,6 +983,7 @@ static const struct of_device_id dt_match[] = {
 	  .data = &amlogic_data, },
 	{ .compatible = "renesas,r9a08g046-mali", .data = &default_pm_rt_data },
 	{ .compatible = "renesas,r9a09g047-mali", .data = &default_pm_rt_data },
+	{ .compatible = "rockchip,rk3399-mali", .data = &default_pm_rt_data },
 	{ .compatible = "arm,mali-t604", .data = &default_data, },
 	{ .compatible = "arm,mali-t624", .data = &default_data, },
 	{ .compatible = "arm,mali-t628", .data = &default_data, },

---
base-commit: c408466a4dfaee4b12587e926c5b85e68c8b3c40
change-id: 20261030-panfrost-rk3399-pm-rt-cea3fc1790d9

Best regards,
-- 
Igor Velkov <iav@iav.lv>




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-23 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 17:33 [PATCH v3] drm/panfrost: Enable GPU_PM_RT for RK3399 Igor Velkov via B4 Relay
2026-11-23 17:43 ` Adrián Larumbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox