2022-02-27 03:14:27 +00:00
|
|
|
#!/bin/bash
|
2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
|
|
|
|
|
|
|
. /etc/os-release
|
|
|
|
|
|
|
|
set_gov() {
|
2022-02-05 22:40:57 +00:00
|
|
|
for POLICY in ${CPU_FREQ[@]}
|
|
|
|
do
|
2022-03-07 03:11:57 +00:00
|
|
|
echo $1 >${POLICY}/scaling_governor 2>/dev/null
|
2022-02-05 22:40:57 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
for HANDLE in ${GPU_FREQ} ${DMC_FREQ}
|
2022-02-05 14:23:32 +00:00
|
|
|
do
|
2022-03-05 14:54:25 +00:00
|
|
|
echo $1 >${HANDLE}/governor 2>/dev/null || echo dmc_$1 >${HANDLE}/governor 2>/dev/null
|
2022-02-05 14:23:32 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2022-06-01 10:56:46 +00:00
|
|
|
performance() {
|
2022-02-05 14:23:32 +00:00
|
|
|
set_gov performance
|
|
|
|
}
|
|
|
|
|
2022-06-01 10:56:46 +00:00
|
|
|
ondemand() {
|
2022-02-05 14:23:32 +00:00
|
|
|
set_gov ondemand
|
|
|
|
}
|
|
|
|
|
2022-06-01 10:56:46 +00:00
|
|
|
interactive() {
|
|
|
|
set_gov interactive
|
|
|
|
}
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
powersave() {
|
|
|
|
set_gov powersave
|
|
|
|
}
|
|
|
|
|