summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatheus Marinho <matheus4551@hotmail.com>2023-09-21 10:12:17 -0300
committerMatheus Marinho <matheus4551@hotmail.com>2023-09-21 10:17:43 -0300
commitd57e2dd4d166accf9857e16a7a2159ba0d7e68ee (patch)
treeaf898f459bd5686b482cc8acfeaf6db5ea228580
parentf39d5cd2ba25777f886306df1b28ae9311749df1 (diff)
downloadtdepowersave-fix/missing_schedutil.tar.gz
tdepowersave-fix/missing_schedutil.zip
Add schedutil to dynamic cpufreq policy governor listfix/missing_schedutil
Signed-off-by: Matheus Marinho <matheus4551@hotmail.com>
-rw-r--r--src/hardware.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/hardware.cpp b/src/hardware.cpp
index ef1ba23..04878f0 100644
--- a/src/hardware.cpp
+++ b/src/hardware.cpp
@@ -474,7 +474,7 @@ cpufreq_type HardwareInfo::checkCurrentCPUFreqPolicy() {
if (cpuFreq) {
if (!gov.isNull()) {
kdDebug() << "got CPU Freq gov: " << gov << endl;
- if ((gov == "ondemand") || (gov == "userspace") || (gov == "conservative")) {
+ if ((gov == "schedutil") || (gov == "ondemand") || (gov == "userspace") || (gov == "conservative")) {
_current = DYNAMIC;
} else if (gov == "powersave") {
_current = POWERSAVE;
@@ -1026,13 +1026,19 @@ bool HardwareInfo::setCPUFreq ( cpufreq_type cpufreq, int limit ) {
TQStringList dynamic;
if (checkCurrentCPUFreqPolicy() == cpufreq) {
- if (cpufreq == DYNAMIC && !cpuFreqGovernor.startsWith("ondemand")) {
+ if (cpufreq == DYNAMIC && !cpuFreqGovernor.startsWith("schedutil")) {
+ if (cpufreq == DYNAMIC && !cpuFreqGovernor.startsWith("ondemand")) {
+ kdDebug() << "CPU Freq Policy is already DYNAMIC, but not governor is currently "
+ << "not 'ondemand'. Try to set ondemand governor." << endl;
+ } else {
kdDebug() << "CPU Freq Policy is already DYNAMIC, but not governor is currently "
- << "not 'ondemand'. Try to set ondemand governor." << endl;
- } else {
+ << "not 'schedutil'. Try to set schedutil governor." << endl;
+ }
+ else {
kdDebug() << "Didn't change Policy, was already set." << endl;
return true;
}
+ }
}
switch (cpufreq) {
@@ -1043,7 +1049,7 @@ bool HardwareInfo::setCPUFreq ( cpufreq_type cpufreq, int limit ) {
}
break;
case DYNAMIC:
- dynamic << "ondemand" << "userspace" << "conservative";
+ dynamic << "schedutil" << "ondemand" << "userspace" << "conservative";
for (TQStringList::Iterator it = dynamic.begin(); it != dynamic.end(); it++){
kdDebug() << "Try to set dynamic CPUFreq to: " << *it << endl;