aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/thermal_functions.sh27
-rwxr-xr-xthermal/thermal_02.sh6
2 files changed, 32 insertions, 1 deletions
diff --git a/include/thermal_functions.sh b/include/thermal_functions.sh
index c25e1d8..4fbd4b7 100644
--- a/include/thermal_functions.sh
+++ b/include/thermal_functions.sh
@@ -283,3 +283,30 @@ kill_glmark2() {
kill -9 $gpu_pid
fi
}
+
+set_thermal_governors() {
+
+ local gov=$1
+ local index=0
+ thermal_governor_backup[MAX_ZONE]=
+
+ local th_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']")
+ for zone in $th_zones; do
+ thermal_governor_backup[$index]=$(cat $THERMAL_PATH/$zone/policy)
+ index=$((index + 1))
+ echo $gov > $THERMAL_PATH/$zone/policy
+ done
+ return 0
+}
+
+restore_thermal_governors() {
+
+ local index=0
+
+ local th_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']")
+ for zone in $th_zones; do
+ echo ${thermal_governor_backup[$index]} > $THERMAL_PATH/$zone/policy
+ index=$((index + 1))
+ done
+ return 0
+}
diff --git a/thermal/thermal_02.sh b/thermal/thermal_02.sh
index 1ff59b2..1f53612 100755
--- a/thermal/thermal_02.sh
+++ b/thermal/thermal_02.sh
@@ -60,7 +60,11 @@ check_cooling_device_states() {
echo $prev_state_val > $dirpath/cur_state
}
-for_each_cooling_device check_cooling_device_attributes
+set_thermal_governors user_space
+for_each_cooling_device check_cooling_device_attributes
for_each_cooling_device check_cooling_device_states
+
+restore_thermal_governors
+
test_status_show