summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2022-08-06 00:31:07 -0700
committerWei Wang <wvw@google.com>2022-08-08 23:00:25 +0000
commit986c81e89ba5bb0537429a631a4c93caf3dc846e (patch)
tree8fa8b0197a7f7b81920c64e52f0cd34d22998c1c
parent35cb67662ee67bb2e73ff3d466e39b06341a1f97 (diff)
ADPF: extend non-stale session timer in wakeup
For DISPLAY_UPDATE_IMMINENT wakeup signal, non-stale session's timer should be also extended. This resolves the performance issue caused those sessions to go stale     prematurely. Bug: 241621485 Test: Build Signed-off-by: Wei Wang <wvw@google.com> Change-Id: I06330e064060248bb556ae35e0cb8fd302cef231
-rw-r--r--power-libperfmgr/aidl/PowerHintSession.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/power-libperfmgr/aidl/PowerHintSession.cpp b/power-libperfmgr/aidl/PowerHintSession.cpp
index cac641a..7998c53 100644
--- a/power-libperfmgr/aidl/PowerHintSession.cpp
+++ b/power-libperfmgr/aidl/PowerHintSession.cpp
@@ -414,9 +414,16 @@ void PowerHintSession::setStale() {
void PowerHintSession::wakeup() {
std::lock_guard<std::mutex> guard(mSessionLock);
- // We only wake up non-paused and stale sessions
- if (mSessionClosed || !isActive() || !isTimeout())
+ // We only wake up non-paused session
+ if (mSessionClosed || !isActive()) {
return;
+ }
+ // Update session's timer
+ mStaleTimerHandler->updateTimer();
+ // Skip uclamp update for stale session
+ if (!isTimeout()) {
+ return;
+ }
if (ATRACE_ENABLED()) {
std::string tag = StringPrintf("wakeup.%s(a:%d,s:%d)", getIdString().c_str(), isActive(),
isTimeout());
@@ -426,7 +433,6 @@ void PowerHintSession::wakeup() {
int min = std::max(mDescriptor->current_min, static_cast<int>(adpfConfig->mUclampMinInit));
mDescriptor->current_min = min;
PowerSessionManager::getInstance()->setUclampMinLocked(this, min);
- mStaleTimerHandler->updateTimer();
if (ATRACE_ENABLED()) {
const std::string idstr = getIdString();