RK3576 GPU OPP Investigation
According to Kwiboo on IRC:
<Kwiboo> CounterPillow: did you manage to get gpu freq to work on rk3576? if I understand correctly tf-a will mostly configure the gpu to use pvtpll and not a normal pll, instead ft-a set a ring length depending on requested freq and the voltage in opp affect how fast gpu will run
<CounterPillow> It appears to work with the fixed scmi clk IDs, yes. I no longer get panfrost job timeouts and glmark runs at an acceptable framerate
<CounterPillow> I didn't look in detail into whether the GPU is at the fastest speed it can be, just that it no longer is stuck at the lowest
<Kwiboo> cool, looked like the tk3576 use the cru CLK_GPU as core clock so was wondering if it has any affect, maybe because the scmi clock is set to ~200MHz tf-a disable use of pvtpll and the CLK_GPU is one really used
<CounterPillow> do we not have any OPPs for the GPU or something?
<CounterPillow> oh, we do.
<CounterPillow> With no GPU load atm:
<CounterPillow> root@trixie:~# cat /sys/class/drm/renderD128/device/devfreq/27800000.gpu/cur_freq
<CounterPillow> 800000000
<CounterPillow> So doesn't appear to use the highest clock rate, nor does it appear to be idling properly or something
<Kwiboo> if I understand the ft-a code correctly, the rate must match the rate table, and anythine beside 200MHz will enable use of pvtpll: https://github.com/TrustedFirmware-A/trusted-firmware-a/blob/main/plat/rockchip/rk3576/scmi/rk3576_clk.c#L306-L317
<Kwiboo> and when pvtpll is enabled the rate or CLK_GPU does not matter
<CounterPillow> can I check whether pvtpll is enabled from within linux?
<Kwiboo> I am also not sure that all rates can be achieved with current int plls, i.e. 1188 MHz with div=2 -> 594 MHz
<Kwiboo> for rk3528 I use the scmi clock as the gpu core clock, and I am wondering if rk3588 and rk3576 should really be using something like that to work as intended, or at least to be able to reach top performance
<Kwiboo> I do not think the pvtpll regs is in normal device mem and not in secure mem, so should probably be possible to check from Linux
<CounterPillow> Possibly, I've done zero investigations into performance atm because I'm still at the stage where random things are just straight up broken like eMMC :|
<Kwiboo> BIT(8) of CRU_CLKSEL_CON(165) seem to determin if pvtpll is used for gpu or normal pll, if I understand the tf-a code correctly
There appears to be something potentially wrong going on here.
- Why is the GPU not clocking down when idle?
- Are we in pvtpll mode? If so, is that okay?