Add schedutil to dynamic cpufreq policy governor list

Signed-off-by: Matheus Marinho <matheus4551@hotmail.com>
fix/missing_schedutil
Matheus Marinho 1 year ago
parent f39d5cd2ba
commit d57e2dd4d1

@ -474,7 +474,7 @@ cpufreq_type HardwareInfo::checkCurrentCPUFreqPolicy() {
if (cpuFreq) { if (cpuFreq) {
if (!gov.isNull()) { if (!gov.isNull()) {
kdDebug() << "got CPU Freq gov: " << gov << endl; 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; _current = DYNAMIC;
} else if (gov == "powersave") { } else if (gov == "powersave") {
_current = POWERSAVE; _current = POWERSAVE;
@ -1026,14 +1026,20 @@ bool HardwareInfo::setCPUFreq ( cpufreq_type cpufreq, int limit ) {
TQStringList dynamic; TQStringList dynamic;
if (checkCurrentCPUFreqPolicy() == cpufreq) { if (checkCurrentCPUFreqPolicy() == cpufreq) {
if (cpufreq == DYNAMIC && !cpuFreqGovernor.startsWith("schedutil")) {
if (cpufreq == DYNAMIC && !cpuFreqGovernor.startsWith("ondemand")) { if (cpufreq == DYNAMIC && !cpuFreqGovernor.startsWith("ondemand")) {
kdDebug() << "CPU Freq Policy is already DYNAMIC, but not governor is currently " kdDebug() << "CPU Freq Policy is already DYNAMIC, but not governor is currently "
<< "not 'ondemand'. Try to set ondemand governor." << endl; << "not 'ondemand'. Try to set ondemand governor." << endl;
} else { } else {
kdDebug() << "CPU Freq Policy is already DYNAMIC, but not governor is currently "
<< "not 'schedutil'. Try to set schedutil governor." << endl;
}
else {
kdDebug() << "Didn't change Policy, was already set." << endl; kdDebug() << "Didn't change Policy, was already set." << endl;
return true; return true;
} }
} }
}
switch (cpufreq) { switch (cpufreq) {
case PERFORMANCE: case PERFORMANCE:
@ -1043,7 +1049,7 @@ bool HardwareInfo::setCPUFreq ( cpufreq_type cpufreq, int limit ) {
} }
break; break;
case DYNAMIC: case DYNAMIC:
dynamic << "ondemand" << "userspace" << "conservative"; dynamic << "schedutil" << "ondemand" << "userspace" << "conservative";
for (TQStringList::Iterator it = dynamic.begin(); it != dynamic.end(); it++){ for (TQStringList::Iterator it = dynamic.begin(); it != dynamic.end(); it++){
kdDebug() << "Try to set dynamic CPUFreq to: " << *it << endl; kdDebug() << "Try to set dynamic CPUFreq to: " << *it << endl;

Loading…
Cancel
Save