Debian Codegraph @

libs/hwui/tests/scripts/prep_buller.sh

raw symbols SCIP
1 #buller is bullhead & angler (☞゚ヮ゚)☞
2
3 nr=$(adb shell cat /proc/cpuinfo | grep processor | wc -l)
4 cpubase=/sys/devices/system/cpu
5 gov=cpufreq/scaling_governor
6
7 adb root
8 adb wait-for-device
9 adb shell stop thermal-engine
10 adb shell stop perfd
11
12 # LITTLE cores
13 # 384000 460800 600000 672000 787200 864000 960000 1248000 1440000
14 # BIG cores
15 # 384000 480000 633600 768000 864000 960000 1248000 1344000 1440000
16 # 1536000 1632000 1689600 1824000
17
18 cpu=0
19 S=960000
20 while [ $((cpu < 4)) -eq 1 ]; do
21 echo "Setting cpu $cpu to $S hz"
22 adb shell "echo 1 > $cpubase/cpu${cpu}/online"
23 adb shell "echo userspace > $cpubase/cpu${cpu}/$gov"
24 adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_max_freq"
25 adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_min_freq"
26 adb shell "echo $S > $cpubase/cpu${cpu}/cpufreq/scaling_setspeed"
27 cpu=$(($cpu + 1))
28 done
29
30 while [ $((cpu < $nr)) -eq 1 ]; do
31 echo "disable cpu $cpu"
32 adb shell "echo 0 > $cpubase/cpu${cpu}/online"
33 cpu=$(($cpu + 1))
34 done
35
36 echo "setting GPU bus and idle timer"
37 adb shell "echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split"
38 adb shell "echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on"
39 adb shell "echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer"
40
41 # angler: 0 762 1144 1525 2288 3509 4173 5271 5928 7904 9887 11863
42 adb shell "echo 11863 > /sys/class/devfreq/qcom,gpubw.70/min_freq" &> /dev/null
43 # bullhead: 0 762 1144 1525 2288 3509 4173 5271 5928 7102
44 adb shell "echo 7102 > /sys/class/devfreq/qcom,gpubw.19/min_freq" &> /dev/null
45
46
47 board=$(adb shell "getprop ro.product.board")
48 freq=0
49 if [ "$board" = "bullhead" ]
50 then
51 #600000000 490000000 450000000 367000000 300000000 180000000
52 freq=300000000
53 else
54 #600000000 510000000 450000000 390000000 305000000 180000000
55 freq=305000000
56 fi
57 echo "performance mode, $freq Hz"
58 adb shell "echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor"
59 adb shell "echo $freq > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq"
60 adb shell "echo $freq > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq"
61
62 adb shell "echo 4 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel"
63 adb shell "echo 4 > /sys/class/kgsl/kgsl-3d0/max_pwrlevel"
64