sdm660-common; power-libperfmgr: Properly handle sustained performance mode
* when tested with [1], even after exiting the app, spm was still active in powerhal thereby keeping max freqs limited and blocking boosts * enable/disable it properly and end all other hints before enabling, to fix this issue [1] https://android.googlesource.com/platform/cts/+/refs/heads/master/hostsidetests/sustainedperf Change-Id: I672195fc6f7aba91928e2ab6147a6a7cac51f459 Signed-off-by: chiru2000 <chiranth@m.ms.evolution-x.org> Signed-off-by: clarencelol <clarencekuiek@icloud.com> Signed-off-by: pix106 <sbordenave@gmail.com>
This commit is contained in:
parent
3f57e8df24
commit
c99c3228cf
1 changed files with 7 additions and 5 deletions
|
@ -119,14 +119,14 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
|
|||
break;
|
||||
case Mode::SUSTAINED_PERFORMANCE:
|
||||
if (enabled) {
|
||||
endAllHints(mHintManager);
|
||||
mHintManager->DoHint("SUSTAINED_PERFORMANCE");
|
||||
} else {
|
||||
mHintManager->EndHint("SUSTAINED_PERFORMANCE");
|
||||
}
|
||||
mSustainedPerfModeOn = true;
|
||||
mSustainedPerfModeOn = enabled;
|
||||
break;
|
||||
case Mode::LAUNCH:
|
||||
if (mSustainedPerfModeOn) {
|
||||
break;
|
||||
}
|
||||
[[fallthrough]];
|
||||
case Mode::FIXED_PERFORMANCE:
|
||||
[[fallthrough]];
|
||||
|
@ -141,7 +141,9 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
|
|||
case Mode::AUDIO_STREAMING_LOW_LATENCY:
|
||||
[[fallthrough]];
|
||||
default:
|
||||
if (mBatterySaverOn) break;
|
||||
if (mBatterySaverOn || mSustainedPerfModeOn) {
|
||||
break;
|
||||
}
|
||||
if (enabled) {
|
||||
mHintManager->DoHint(toString(type));
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue