From 4c33049a265bcc48ea5d041a2a8520515c087b16 Mon Sep 17 00:00:00 2001 From: Adithya R Date: Sun, 5 Sep 2021 18:15:55 +0530 Subject: [PATCH] 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 * while we're at it, don't handle max freq for anything other than spm in powerhint [1] https://android.googlesource.com/platform/cts/+/refs/heads/master/hostsidetests/sustainedperf Signed-off-by: Adithya R --- power-libperfmgr/aidl/Power.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/power-libperfmgr/aidl/Power.cpp b/power-libperfmgr/aidl/Power.cpp index 18fd25e3..4d23dda8 100644 --- a/power-libperfmgr/aidl/Power.cpp +++ b/power-libperfmgr/aidl/Power.cpp @@ -91,14 +91,14 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) { break; case Mode::SUSTAINED_PERFORMANCE: if (enabled) { + endAllHints(); HintManager::GetInstance()->DoHint("SUSTAINED_PERFORMANCE"); + } else { + HintManager::GetInstance()->EndHint("SUSTAINED_PERFORMANCE"); } - mSustainedPerfModeOn = true; + mSustainedPerfModeOn = enabled; break; case Mode::LAUNCH: - if (mSustainedPerfModeOn) { - break; - } [[fallthrough]]; case Mode::FIXED_PERFORMANCE: [[fallthrough]];