Charles(Yen-Cheng) Chan | 71c547e | 2018-10-09 14:47:11 +0800 | [diff] [blame] | 1 | #!/system/bin/sh |
| 2 | # |
| 3 | # Copyright (C) 2018 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # performance test setup for b4/s4 devices |
| 18 | |
Charles(Yen-Cheng) Chan | 71c547e | 2018-10-09 14:47:11 +0800 | [diff] [blame] | 19 | stop vendor.thermal-engine |
Wei Wang | bde2597 | 2019-05-23 10:31:44 -0700 | [diff] [blame] | 20 | setprop vendor.powerhal.init 0 |
Wei Wang | 547d828 | 2020-06-12 18:52:29 -0700 | [diff] [blame] | 21 | setprop ctl.restart vendor.power-hal-aidl |
Wei Wang | bde2597 | 2019-05-23 10:31:44 -0700 | [diff] [blame] | 22 | setprop ctl.interface_restart android.hardware.power@1.0::IPower/default |
Charles(Yen-Cheng) Chan | 71c547e | 2018-10-09 14:47:11 +0800 | [diff] [blame] | 23 | |
| 24 | cpubase=/sys/devices/system/cpu |
| 25 | gov=cpufreq/scaling_governor |
| 26 | |
| 27 | cpu=6 |
| 28 | top=8 |
| 29 | |
| 30 | # Enable golden cores at max frequency. |
| 31 | # 300000 652800 825600 979200 1132800 1363200 1536000 1747200 1843200 1996800 2016000 |
| 32 | # 300000 576000 748800 998400 1209600 1324800 1516800 1612800 1708800 |
| 33 | while [ $((cpu < $top)) -eq 1 ]; do |
| 34 | echo 1 > $cpubase/cpu${cpu}/online |
| 35 | echo performance > $cpubase/cpu${cpu}/$gov |
| 36 | S=`cat $cpubase/cpu${cpu}/cpufreq/scaling_cur_freq` |
| 37 | echo "setting cpu $cpu to max at $S kHz" |
| 38 | cpu=$(($cpu + 1)) |
| 39 | done |
| 40 | |
| 41 | cpu=0 |
| 42 | top=6 |
| 43 | |
| 44 | # Disable silver cores. |
| 45 | while [ $((cpu < $top)) -eq 1 ]; do |
| 46 | echo "disable cpu $cpu" |
| 47 | echo 0 > $cpubase/cpu${cpu}/online |
| 48 | cpu=$(($cpu + 1)) |
| 49 | done |
| 50 | |
| 51 | echo "disable GPU bus split" |
| 52 | echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split |
| 53 | echo "enable GPU force clocks on" |
| 54 | echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on |
| 55 | echo "set GPU idle timer to 10000" |
| 56 | echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer |
| 57 | |
| 58 | # 0 381 762 1144 1720 2086 2597 3147 3879 5161 5931 6881 |
| 59 | echo performance > /sys/class/devfreq/soc:qcom,gpubw/governor |
| 60 | echo -n "set GPU bus frequency to max at " |
| 61 | cat /sys/class/devfreq/soc:qcom,gpubw/cur_freq |
| 62 | |
| 63 | # 180000000 267000000 355000000 430000000 |
| 64 | echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor |
| 65 | echo 0 > /sys/class/kgsl/kgsl-3d0/max_pwrlevel |
| 66 | echo 0 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel |
| 67 | echo -n "set GPU frequency to max at " |
| 68 | cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq |