diff options
author | jimmyshiu <jimmyshiu@google.com> | 2022-06-02 09:30:18 +0000 |
---|---|---|
committer | jimmyshiu <jimmyshiu@google.com> | 2022-06-09 17:55:49 +0000 |
commit | 1ac7825096ea60221ea8bcc4c65bb52ae67b48ef (patch) | |
tree | b24be0b6bf4959d675090d7627063a1fa33a5240 /power-libperfmgr/aidl/PowerSessionManager.cpp | |
parent | 18aac5e526610bdb114bed468a87ecb4710bbc8d (diff) |
Fix uclamp_min stuck at high freq
Separate Stale and EarlyBoost handlers and refine the code.
Test: adb shell dumpsys android.hardware.power.IPower/default
Test: Manual
Bug: 232992641
Change-Id: I81a4fd96fb7311ae5bbb7cbabe72378c9cad4aa3
Diffstat (limited to 'power-libperfmgr/aidl/PowerSessionManager.cpp')
-rw-r--r-- | power-libperfmgr/aidl/PowerSessionManager.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/power-libperfmgr/aidl/PowerSessionManager.cpp b/power-libperfmgr/aidl/PowerSessionManager.cpp index 984b0d0..313a19e 100644 --- a/power-libperfmgr/aidl/PowerSessionManager.cpp +++ b/power-libperfmgr/aidl/PowerSessionManager.cpp @@ -162,12 +162,11 @@ void PowerSessionManager::setUclampMinLocked(PowerHintSession *session, int val) // Get thex max uclamp.min across sessions which include the tid. int tidMax = 0; for (PowerHintSession *s : mTidSessionListMap[t]) { - if (!s->isActive() || s->isStale()) + if (!s->isActive() || s->isTimeout()) continue; tidMax = std::max(tidMax, s->getUclampMin()); } - val = std::max(val, tidMax); - set_uclamp_min(t, val); + set_uclamp_min(t, std::max(val, tidMax)); } } @@ -176,7 +175,7 @@ std::optional<bool> PowerSessionManager::isAnyAppSessionActive() { bool active = false; for (PowerHintSession *s : mSessions) { // session active and not stale is actually active. - if (s->isActive() && !s->isStale() && s->isAppSession()) { + if (s->isActive() && !s->isTimeout() && s->isAppSession()) { active = true; break; } |