-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a2xx/a3xx/a4xx: gpu fixes / opp table Samsung J5 #332
base: msm8916/6.6-rc5
Are you sure you want to change the base?
Conversation
|
Well, at least it works. My devices shows up: adreno 1c00000.gpu: speed-bin version: 1 value: 0 I was looking at an LineageOS-custom ROM I 'm using and I realized they are happily overclocking CPU and GPU .... wtf?
It's a hint for devfreq_suspend_device / resume handlers, they will call then devfreq_set_target() And I must hotfix that ... bug: with my patch the gpu may not ramp up at all from suspend |
Note that implementing/extending frequency scaling does not necessarily result in power saving. It's always a balance between powering off [the GPU] completely when it is idle vs. keeping it on at a lower frequency. When [the GPU] is powered off (suspended), the frequency shouldn't matter because the clock should get disabled entirely. In powered off/suspended state it should also consume the least amount of power (ideally none). This means there are two possibilities if you consider a lightly loaded system (with not much to do for the CPU or GPU):
It's hard to generalize which one of these is better. I would expect (2) is better if you have a lightly loaded system with frequent small periodic tasks, which makes it too expensive to power off the GPU inbetween. Otherwise (1) could also be better in many cases. If you want to be sure that you are actually improving power consumption I would strongly recommend that you try to measure the power consumption with and without your changes. Otherwise you might end up making power consumption worse. :')
BTW, given ^, I'm still not sure why you need the |
Hi, thanks for the comments
True, this is why I had to make brightness control working because it's consuming the most power: Actually lowering freq seems to reduce power consumption a bit: 200MHz are ok for 60fps glxgears (synced).
True, but even beforehand the clock was set without opp-suspend in suspend/resume handlers. So I just kept it that way. And the mistake was that setting the freq on a disabled clock locks up. Remember, this is a draft, I'm still not 100% happy with that ;) |
Good news! The busy counter is broken and I found out why and got it fixed! Meanwhile my 2 cents on this:
Thats the way it's implemented. Also the governor on_demand wasn't made for this. To cheat around is ugly.
And I assume this will make a better power saving. My rought measures seems to prove -99mW. |
Signed-off-by: Christoph Rudorff <chris@rudorff.com>
On my device that calc. was always >100% load got this from upstream, and a4xx may be bugged aswell the /sys/kernel/debug/dri/0/perf does work ... Signed-off-by: Christoph Rudorff <chris@rudorff.com>
Signed-off-by: Christoph Rudorff <chris@rudorff.com>
adreno 1c00000.gpu: _opp_config_clk_single: failed to set clock rate: -22 EINVAL
a3xx_set_supported_hw() set opp-supported-hw from fuse value, defaults to 0x1 in case the value wasn't set. Signed-off-by: Christoph Rudorff <chris@rudorff.com>
gfx3d_clk_src rcg didn't update its configuration. set clk_enable before set_rate set "suspend rate" before clk_disable Signed-off-by: Christoph Rudorff <chris@rudorff.com>
Signed-off-by: Christoph Rudorff <chris@rudorff.com>
for fine tuning: /sys/kernel/debug/dri/0/devfreq/ Signed-off-by: Christoph Rudorff <chris@rudorff.com>
Ok, here is my state of the art, tested and works very well on my device, finally. So, the impact is greater than I expected. All in all this reverts msm_gpu_devfreq pretty down to some "more cleverness", according to the logs. Am I? |
Nice! I'm afraid at this point you would need to convince the upstream freedreno people about this though, since the changes are a bit too extensive to maintain downstream. There are some minor cosmetic things I could point out but aside from that I don't have enough experience with the Adreno GPU drivers to review this properly. |
Well, most convincing would be having more positive test reports. I do see power savings. |
Add a test case which replaces an active ingress qdisc while keeping the miniq in-tact during the transition period to the new clsact qdisc. # ./vmtest.sh -- ./test_progs -t tc_link [...] ./test_progs -t tc_link [ 3.412871] bpf_testmod: loading out-of-tree module taints kernel. [ 3.413343] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel #332 tc_links_after:OK #333 tc_links_append:OK #334 tc_links_basic:OK #335 tc_links_before:OK #336 tc_links_chain_classic:OK #337 tc_links_chain_mixed:OK #338 tc_links_dev_chain0:OK #339 tc_links_dev_cleanup:OK #340 tc_links_dev_mixed:OK #341 tc_links_ingress:OK #342 tc_links_invalid:OK #343 tc_links_prepend:OK #344 tc_links_replace:OK #345 tc_links_revision:OK Summary: 14/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Martin KaFai Lau <martin.lau@kernel.org> Link: https://lore.kernel.org/r/20240708133130.11609-2-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Hi,
My aim was simply to pretty up the gpu frequencies table. That raised bugs.
Need more testing on other devices. May uncover or fix bugs on other devices:
Please check if your device gpu ever uses the between frequencies:
Apply devfreq patch, for the load meter!
The gpu busy counter was broken for me, wrong reg.
I fixed it for a3xx
a4xx may be broken aswell?
a5xx ... pls test
a6xx ... pls test
Before I got:
after:
The overclocking is optional ;)
testing cheat sheet:
Setting bus speed "opp-peak-kBps" needs interconnect frame work, which is broken. I dropped the settings as comments.