• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/system/bin/sh
2#
3# Copyright (C) 2020 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 2020 devices
18function disable_thermal()
19{
20    thermal_path='/sys/devices/virtual/thermal/'
21
22    nz=$(ls -al $thermal_path | grep thermal_zone | wc -l)
23    i=0
24    while [ $i -lt $nz ]; do
25        tz_path=$thermal_path'thermal_zone'$i'/'
26        mode_path=$tz_path'mode'
27
28        if [ -f $mode_path ]; then
29            echo disabled > $tz_path'mode'
30        fi
31        i=$(($i + 1));
32    done
33}
34
35disable_thermal
36setprop vendor.powerhal.init 0
37setprop ctl.restart vendor.power-hal-aidl
38
39cpubase=/sys/devices/system/cpu
40gov=cpufreq/scaling_governor
41
42cpu=6
43top=8
44#Big Core 652800  940800 1152000 1478400 1728000 1900800 2092800 2208000
45#Big Plus 806400 1094400 1401600 1766400 1996800 2188800 2304000 2400000
46cpufreq=2092800
47# Set the bigcores around 2G
48while [ $((cpu < $top)) -eq 1 ]; do
49  echo 1 > $cpubase/cpu${cpu}/online
50  echo userspace > $cpubase/cpu${cpu}/$gov
51  echo $cpufreq > /sys/devices/system/cpu/cpu$cpu/cpufreq/scaling_max_freq
52  echo $cpufreq > /sys/devices/system/cpu/cpu$cpu/cpufreq/scaling_setspeed
53  S=`cat $cpubase/cpu${cpu}/cpufreq/scaling_cur_freq`
54  echo "set cpu $cpu to $S kHz"
55  cpu=$(($cpu + 1))
56done
57
58cpu=0
59top=6
60# Disable the silver cores.
61while [ $((cpu < $top)) -eq 1 ]; do
62  echo "disable cpu $cpu"
63  echo 0 > $cpubase/cpu${cpu}/online
64  cpu=$(($cpu + 1))
65done
66
67echo "disable GPU bus split"
68echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split
69echo "enable GPU force clock on"
70echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on
71echo "set GPU idle timer to 10000"
72echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer
73
74# 0 381 572 762 1144 1571 2086 2597 2929 3879 4943 5931 6881
75echo performance > /sys/class/devfreq/soc:qcom,gpubw/governor
76echo -n "set GPU bus frequency to max at "
77cat /sys/class/devfreq/soc:qcom,gpubw/cur_freq
78
79#625 500 400 275 mhz
80echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
81echo 0 > /sys/class/kgsl/kgsl-3d0/max_pwrlevel
82echo 0 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel
83echo -n "set GPU frequency to max at "
84cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq
85