1*dd0948b3SAndroid Build Coastguard Worker#!/system/bin/sh 2*dd0948b3SAndroid Build Coastguard Worker# 3*dd0948b3SAndroid Build Coastguard Worker# Copyright (C) 2018 The Android Open Source Project 4*dd0948b3SAndroid Build Coastguard Worker# 5*dd0948b3SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 6*dd0948b3SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 7*dd0948b3SAndroid Build Coastguard Worker# You may obtain a copy of the License at 8*dd0948b3SAndroid Build Coastguard Worker# 9*dd0948b3SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 10*dd0948b3SAndroid Build Coastguard Worker# 11*dd0948b3SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 12*dd0948b3SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 13*dd0948b3SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14*dd0948b3SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 15*dd0948b3SAndroid Build Coastguard Worker# limitations under the License. 16*dd0948b3SAndroid Build Coastguard Worker 17*dd0948b3SAndroid Build Coastguard Worker# performance test setup for 2018 devices 18*dd0948b3SAndroid Build Coastguard Worker 19*dd0948b3SAndroid Build Coastguard Workerstop vendor.thermal-engine 20*dd0948b3SAndroid Build Coastguard Workersetprop vendor.powerhal.init 0 21*dd0948b3SAndroid Build Coastguard Workersetprop ctl.restart vendor.power-hal-aidl 22*dd0948b3SAndroid Build Coastguard Workersetprop ctl.interface_restart android.hardware.power@1.0::IPower/default 23*dd0948b3SAndroid Build Coastguard Worker 24*dd0948b3SAndroid Build Coastguard Workercpubase=/sys/devices/system/cpu 25*dd0948b3SAndroid Build Coastguard Workergov=cpufreq/scaling_governor 26*dd0948b3SAndroid Build Coastguard Worker 27*dd0948b3SAndroid Build Coastguard Workercpu=4 28*dd0948b3SAndroid Build Coastguard Workertop=8 29*dd0948b3SAndroid Build Coastguard Worker 30*dd0948b3SAndroid Build Coastguard Workercpufreq=2092800 31*dd0948b3SAndroid Build Coastguard Worker# Set the golden cores at 2092800. 32*dd0948b3SAndroid Build Coastguard Worker# 825600 902400 979200 1056000 1209600 1286400 1363200 1459200 1536000 33*dd0948b3SAndroid Build Coastguard Worker# 1612800 1689600 1766400 1843200 1920000 1996800 2092800 2169600 34*dd0948b3SAndroid Build Coastguard Worker# 2246400 2323200 2400000 2476800 2553600 2649600 35*dd0948b3SAndroid Build Coastguard Workerwhile [ $((cpu < $top)) -eq 1 ]; do 36*dd0948b3SAndroid Build Coastguard Worker echo 1 > $cpubase/cpu${cpu}/online 37*dd0948b3SAndroid Build Coastguard Worker echo performance > $cpubase/cpu${cpu}/$gov 38*dd0948b3SAndroid Build Coastguard Worker echo $cpufreq > /sys/devices/system/cpu/cpu$cpu/cpufreq/scaling_max_freq 39*dd0948b3SAndroid Build Coastguard Worker S=`cat $cpubase/cpu${cpu}/cpufreq/scaling_cur_freq` 40*dd0948b3SAndroid Build Coastguard Worker echo "set cpu $cpu to $S kHz" 41*dd0948b3SAndroid Build Coastguard Worker cpu=$(($cpu + 1)) 42*dd0948b3SAndroid Build Coastguard Workerdone 43*dd0948b3SAndroid Build Coastguard Worker 44*dd0948b3SAndroid Build Coastguard Workercpu=0 45*dd0948b3SAndroid Build Coastguard Workertop=4 46*dd0948b3SAndroid Build Coastguard Worker 47*dd0948b3SAndroid Build Coastguard Worker# Disable the silver cores. 48*dd0948b3SAndroid Build Coastguard Workerwhile [ $((cpu < $top)) -eq 1 ]; do 49*dd0948b3SAndroid Build Coastguard Worker echo "disable cpu $cpu" 50*dd0948b3SAndroid Build Coastguard Worker echo 0 > $cpubase/cpu${cpu}/online 51*dd0948b3SAndroid Build Coastguard Worker cpu=$(($cpu + 1)) 52*dd0948b3SAndroid Build Coastguard Workerdone 53*dd0948b3SAndroid Build Coastguard Worker 54*dd0948b3SAndroid Build Coastguard Workerecho "disable GPU bus split" 55*dd0948b3SAndroid Build Coastguard Workerecho 0 > /sys/class/kgsl/kgsl-3d0/bus_split 56*dd0948b3SAndroid Build Coastguard Workerecho "enable GPU force clock on" 57*dd0948b3SAndroid Build Coastguard Workerecho 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on 58*dd0948b3SAndroid Build Coastguard Workerecho "set GPU idle timer to 10000" 59*dd0948b3SAndroid Build Coastguard Workerecho 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer 60*dd0948b3SAndroid Build Coastguard Worker 61*dd0948b3SAndroid Build Coastguard Worker# 0 381 572 762 1144 1571 2086 2597 2929 3879 4943 5931 6881 62*dd0948b3SAndroid Build Coastguard Workerecho performance > /sys/class/devfreq/soc:qcom,gpubw/governor 63*dd0948b3SAndroid Build Coastguard Workerecho -n "set GPU bus frequency to max at " 64*dd0948b3SAndroid Build Coastguard Workercat /sys/class/devfreq/soc:qcom,gpubw/cur_freq 65*dd0948b3SAndroid Build Coastguard Worker 66*dd0948b3SAndroid Build Coastguard Worker# 257000000 342000000 414000000 520000000 596000000 675000000 710000000 67*dd0948b3SAndroid Build Coastguard WorkerG=596000000 68*dd0948b3SAndroid Build Coastguard Workerecho performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor 69*dd0948b3SAndroid Build Coastguard Workerecho $G > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq 70*dd0948b3SAndroid Build Coastguard Workerecho $G > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq 71*dd0948b3SAndroid Build Coastguard Workerecho -n "set GPU frequency to " 72*dd0948b3SAndroid Build Coastguard Workercat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq 73