blob: aa57d857af7e95adbe5d50aaf059fdbe8f470f9b [file] [log] [blame]
Wei Wangb5b664f2018-05-04 12:23:41 -07001#!/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
Wei Wangb5b664f2018-05-04 12:23:41 -070019stop vendor.thermal-engine
Wei Wangbde25972019-05-23 10:31:44 -070020setprop vendor.powerhal.init 0
Wei Wang547d8282020-06-12 18:52:29 -070021setprop ctl.restart vendor.power-hal-aidl
Wei Wangbde25972019-05-23 10:31:44 -070022setprop ctl.interface_restart android.hardware.power@1.0::IPower/default
Wei Wangb5b664f2018-05-04 12:23:41 -070023
24cpubase=/sys/devices/system/cpu
25gov=cpufreq/scaling_governor
26
27cpu=4
28top=8
29
davidchaoc192ac52018-05-21 18:42:19 +080030cpufreq=2092800
31# Set the golden cores at 2092800.
Wei Wangb5b664f2018-05-04 12:23:41 -070032# 825600 902400 979200 1056000 1209600 1286400 1363200 1459200 1536000
33# 1612800 1689600 1766400 1843200 1920000 1996800 2092800 2169600
34# 2246400 2323200 2400000 2476800 2553600 2649600
35while [ $((cpu < $top)) -eq 1 ]; do
36 echo 1 > $cpubase/cpu${cpu}/online
37 echo performance > $cpubase/cpu${cpu}/$gov
davidchaoc192ac52018-05-21 18:42:19 +080038 echo $cpufreq > /sys/devices/system/cpu/cpu$cpu/cpufreq/scaling_max_freq
Wei Wangb5b664f2018-05-04 12:23:41 -070039 S=`cat $cpubase/cpu${cpu}/cpufreq/scaling_cur_freq`
davidchaoc192ac52018-05-21 18:42:19 +080040 echo "set cpu $cpu to $S kHz"
Wei Wangb5b664f2018-05-04 12:23:41 -070041 cpu=$(($cpu + 1))
42done
43
44cpu=0
45top=4
46
47# Disable the silver cores.
48while [ $((cpu < $top)) -eq 1 ]; do
49 echo "disable cpu $cpu"
50 echo 0 > $cpubase/cpu${cpu}/online
51 cpu=$(($cpu + 1))
52done
53
davidchaoc192ac52018-05-21 18:42:19 +080054echo "disable GPU bus split"
Wei Wangb5b664f2018-05-04 12:23:41 -070055echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split
davidchaoc192ac52018-05-21 18:42:19 +080056echo "enable GPU force clock on"
Wei Wangb5b664f2018-05-04 12:23:41 -070057echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on
davidchaoc192ac52018-05-21 18:42:19 +080058echo "set GPU idle timer to 10000"
Wei Wangb5b664f2018-05-04 12:23:41 -070059echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer
60
61# 0 381 572 762 1144 1571 2086 2597 2929 3879 4943 5931 6881
62echo performance > /sys/class/devfreq/soc:qcom,gpubw/governor
davidchaoc192ac52018-05-21 18:42:19 +080063echo -n "set GPU bus frequency to max at "
Wei Wangb5b664f2018-05-04 12:23:41 -070064cat /sys/class/devfreq/soc:qcom,gpubw/cur_freq
65
66# 257000000 342000000 414000000 520000000 596000000 675000000 710000000
davidchaoc192ac52018-05-21 18:42:19 +080067G=596000000
Wei Wangb5b664f2018-05-04 12:23:41 -070068echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
davidchaoc192ac52018-05-21 18:42:19 +080069echo $G > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq
70echo $G > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq
71echo -n "set GPU frequency to "
Wei Wangb5b664f2018-05-04 12:23:41 -070072cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq