Wei Wang | 8935084 | 2018-12-18 11:04:40 -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 2018 devices |
| 18 | |
| 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 |
Wei Wang | 8935084 | 2018-12-18 11:04:40 -0800 | [diff] [blame] | 23 | |
| 24 | cpubase=/sys/devices/system/cpu |
| 25 | gov=cpufreq/scaling_governor |
| 26 | |
| 27 | cpu=4 |
| 28 | top=7 |
| 29 | cpufreq=2016000 |
| 30 | # Set the bigcores at 2016000. |
| 31 | while [ $((cpu < $top)) -eq 1 ]; do |
| 32 | echo 1 > $cpubase/cpu${cpu}/online |
| 33 | echo performance > $cpubase/cpu${cpu}/$gov |
| 34 | echo $cpufreq > /sys/devices/system/cpu/cpu$cpu/cpufreq/scaling_max_freq |
| 35 | S=`cat $cpubase/cpu${cpu}/cpufreq/scaling_cur_freq` |
| 36 | echo "set cpu $cpu to $S kHz" |
| 37 | cpu=$(($cpu + 1)) |
| 38 | done |
| 39 | |
| 40 | cpu=0 |
| 41 | top=4 |
| 42 | # Disable the silver cores. |
| 43 | while [ $((cpu < $top)) -eq 1 ]; do |
| 44 | echo "disable cpu $cpu" |
| 45 | echo 0 > $cpubase/cpu${cpu}/online |
| 46 | cpu=$(($cpu + 1)) |
| 47 | done |
| 48 | |
| 49 | cpu=7 |
| 50 | top=8 |
| 51 | # Disable the big+ core. |
| 52 | while [ $((cpu < $top)) -eq 1 ]; do |
| 53 | echo "disable cpu $cpu" |
| 54 | echo 0 > $cpubase/cpu${cpu}/online |
| 55 | cpu=$(($cpu + 1)) |
| 56 | done |
| 57 | |
| 58 | echo "disable GPU bus split" |
| 59 | echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split |
| 60 | echo "enable GPU force clock on" |
| 61 | echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on |
| 62 | echo "set GPU idle timer to 10000" |
| 63 | echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer |
| 64 | |
| 65 | # 0 381 572 762 1144 1571 2086 2597 2929 3879 4943 5931 6881 |
| 66 | echo performance > /sys/class/devfreq/soc:qcom,gpubw/governor |
| 67 | echo -n "set GPU bus frequency to max at " |
| 68 | cat /sys/class/devfreq/soc:qcom,gpubw/cur_freq |
| 69 | |
| 70 | # 257000000 345000000 427000000 585000000 |
| 71 | G=427000000 |
| 72 | echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor |
| 73 | echo $G > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq |
| 74 | echo $G > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq |
| 75 | echo -n "set GPU frequency to " |
| 76 | cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq |