1nr=$(adb shell cat /proc/cpuinfo | grep processor | wc -l) 2cpubase=/sys/devices/system/cpu 3 4adb root 5adb wait-for-device 6adb shell stop vendor.perfd 7adb shell stop thermal-engine 8 9S=1036800 10cpu=0 11# Changing governor and frequency in one core will be automatically applied 12# to other cores in the cluster 13while [ $((cpu < 4)) -eq 1 ]; do 14 echo "Setting cpu ${cpu} to $S hz" 15 adb shell "echo userspace > $cpubase/cpu${cpu}/cpufreq/scaling_governor" 16 adb shell "echo 1 > $cpubase/cpu${cpu}/online" 17 adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_max_freq" 18 adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_min_freq" 19 cpu=$(($cpu + 1)) 20done 21 22while [ $((cpu < $nr)) -eq 1 ]; do 23 echo "disable cpu $cpu" 24 adb shell "echo 0 > $cpubase/cpu${cpu}/online" 25 cpu=$(($cpu + 1)) 26done 27 28echo "setting GPU bus and idle timer" 29adb shell "echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split" 30adb shell "echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on" 31adb shell "echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer" 32 33#0 762 1144 1525 2288 3143 4173 5195 5859 7759 9887 11863 13763 34adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,gpubw/min_freq" 35adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,gpubw/max_freq" 36adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,cpubw/min_freq" 37adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,cpubw/max_freq" 38adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,mincpubw/min_freq" 39adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,mincpubw/max_freq" 40adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,memlat-cpu0/min_freq" 41adb shell "echo 7759 > /sys/class/devfreq/soc\:qcom,memlat-cpu0/max_freq" 42 43# 180000000 257000000 342000000 414000000 515000000 596000000 670000000 710000000 44echo "performance mode, 342 MHz" 45adb shell "echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor" 46adb shell "echo 342000000 > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq" 47adb shell "echo 342000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq" 48 49adb shell "echo 4 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel" 50adb shell "echo 4 > /sys/class/kgsl/kgsl-3d0/max_pwrlevel" 51