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-09 02:04:43 +0000
commit9b2db5e8756596f2268118340450a6c91f6d4501 (patch)
tree4163a324a2572a35df738844eff421b7eea9475f
parent4c2d22da9e00d233e06b06173f57e325c7c4cfd9 (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();