From a4f1c2d3461dbd471c88c66ca90d5db3952b10b7 Mon Sep 17 00:00:00 2001 From: ChrisCatto Date: Thu, 11 Dec 2025 07:15:01 +0700 Subject: [PATCH] S666LN: init: Reconfigure utilization clamping for all groups * Based on power tunings of [1]. [1]: https://github.com/mt6878-devs/android_device_xiaomi_malachite Change-Id: I53e5cc5841714cb2c2375d3522e1eb788467987e Signed-off-by: ChrisCatto Signed-off-by: Shirayuki39 Signed-off-by: KimelaZX --- configs/power/powerhint.json | 37 +++++++++++++++--- rootdir/etc/init/hw/init.mt6789.power.rc | 49 +++++++++++++++--------- 2 files changed, 63 insertions(+), 23 deletions(-) diff --git a/configs/power/powerhint.json b/configs/power/powerhint.json index b9cbd17..e3fd54f 100644 --- a/configs/power/powerhint.json +++ b/configs/power/powerhint.json @@ -230,19 +230,34 @@ { "Name": "FGUclampMin", "Path": "/dev/cpuctl/foreground/cpu.uclamp.min", - "Values": ["100", "75", "50", "25", "0"], + "Values": [ + "0", + "10", + "30" + ], + "DefaultIndex": 0, "ResetOnInit": true }, { "Name": "TAUclampMin", "Path": "/dev/cpuctl/top-app/cpu.uclamp.min", - "Values": ["100", "75", "50", "25", "0"], + "Values": [ + "0", + "30", + "100" + ], + "DefaultIndex": 0, "ResetOnInit": true }, { "Name": "CAMUClampBoost", "Path": "/dev/cpuctl/camera-daemon/cpu.uclamp.min", - "Values": ["100", "75", "50", "25", "0"], + "Values": [ + "60", + "80", + "100" + ], + "DefaultIndex": 0, "ResetOnInit": true }, { @@ -381,13 +396,13 @@ "PowerHint": "INTERACTION", "Node": "FGUclampMin", "Duration": 1000, - "Value": "50" + "Value": "10" }, { "PowerHint": "INTERACTION", "Node": "TAUclampMin", "Duration": 1000, - "Value": "50" + "Value": "30" }, { "PowerHint": "INTERACTION", @@ -473,6 +488,18 @@ "Duration": 0, "Value": "50" }, + { + "PowerHint": "EXPENSIVE_RENDERING", + "Node": "FGUclampMin", + "Duration": 0, + "Value": "30" + }, + { + "PowerHint": "EXPENSIVE_RENDERING", + "Node": "TAUclampMin", + "Duration": 0, + "Value": "30" + }, { "PowerHint": "DOUBLE_TAP_TO_WAKE", "Node": "DoubleTapToWake", diff --git a/rootdir/etc/init/hw/init.mt6789.power.rc b/rootdir/etc/init/hw/init.mt6789.power.rc index 4d0c9cd..9851a1d 100644 --- a/rootdir/etc/init/hw/init.mt6789.power.rc +++ b/rootdir/etc/init/hw/init.mt6789.power.rc @@ -110,45 +110,58 @@ on property:sys.boot_completed=1 write /sys/class/devfreq/mtk-dvfsrc-devfreq/userspace/set_freq 0 # Configure clamps for standard task groups. + # rt + write /dev/cpuctl/rt/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/rt/cpu.uclamp.max max + write /dev/cpuctl/rt/cpu.uclamp.min 0 + write /dev/cpuctl/rt/cpu.shares 20480 # system-background # cap the max utilisation for system-background tasks to save power. - write /dev/cpuctl/system/cpu.uclamp.max 40 - write /dev/cpuctl/system/cpu.uclamp.min 0 write /dev/cpuctl/system/cpu.uclamp.latency_sensitive 0 - write /dev/cpuctl/system-background/cpu.uclamp.max 40 + write /dev/cpuctl/system-background/cpu.uclamp.max 60 write /dev/cpuctl/system-background/cpu.uclamp.min 0 - write /dev/cpuctl/system-background/cpu.uclamp.latency_sensitive 0 + write /dev/cpuctl/system-background/cpu.shares 2048 + + # background + write /dev/cpuctl/background/cpu.uclamp.latency_sensitive 0 + write /dev/cpuctl/background/cpu.uclamp.max 40 + write /dev/cpuctl/background/cpu.uclamp.min 0 + write /dev/cpuctl/background/cpu.shares 1024 # foreground write /dev/cpuctl/foreground/cpu.uclamp.max max - write /dev/cpuctl/foreground/cpu.uclamp.min 10 - write /dev/cpuctl/foreground/cpu.uclamp.latency_sensitive 0 + write /dev/cpuctl/foreground/cpu.uclamp.min 0 + write /dev/cpuctl/foreground/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/foreground/cpu.shares 10240 # foreground_window write /dev/cpuctl/foreground_window/cpu.uclamp.max max - write /dev/cpuctl/foreground_window/cpu.uclamp.min 10 - write /dev/cpuctl/foreground_window/cpu.uclamp.latency_sensitive 0 - + write /dev/cpuctl/foreground_window/cpu.uclamp.min 0 + write /dev/cpuctl/foreground_window/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/foreground_window/cpu.shares 10240 + # top-app write /dev/cpuctl/top-app/cpu.uclamp.max max - write /dev/cpuctl/top-app/cpu.uclamp.min 10 + write /dev/cpuctl/top-app/cpu.uclamp.min 0 write /dev/cpuctl/top-app/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/top-app/cpu.shares 20480 - # background - # cap the max utilisation for background tasks to save power. - write /dev/cpuctl/background/cpu.uclamp.max 50 - write /dev/cpuctl/background/cpu.uclamp.min 0 - write /dev/cpuctl/background/cpu.uclamp.latency_sensitive 0 - # nnapi-hal write /dev/cpuctl/nnapi-hal/cpu.uclamp.max max write /dev/cpuctl/nnapi-hal/cpu.uclamp.min 75 write /dev/cpuctl/nnapi-hal/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/nnapi-hal/cpu.shares 20480 # camera-daemon write /dev/cpuctl/camera-daemon/cpu.uclamp.max max - write /dev/cpuctl/camera-daemon/cpu.uclamp.min 50 - write /dev/cpuctl/camera-daemon/cpu.uclamp.latency_sensitive 1 + write /dev/cpuctl/camera-daemon/cpu.uclamp.min 60 + write /dev/cpuctl/camera-daemon/cpu.shares 20480 + + # dex2oat + write /dev/cpuctl/dex2oat/cpu.uclamp.latency_sensitive 0 + write /dev/cpuctl/dex2oat/cpu.uclamp.max 60 + write /dev/cpuctl/dex2oat/cpu.uclamp.min 0 + write /dev/cpuctl/dex2oat/cpu.shares 2048 # Uclamp tuning write /proc/sys/kernel/sched_util_clamp_min_rt_default 96