diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-28 22:19:22 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-28 22:19:22 +0000 |
commit | f2e22cee311d343d9d7289361ab369e545ec22bf (patch) | |
tree | a71aa83fbfea22a294611cbb79f1953d3735a544 /power-libperfmgr/aidl/PowerHintSession.cpp | |
parent | 29f2a58828f2123e412f0de20ee9778fc92282a9 (diff) | |
parent | 2f7f40e3c05054ff861e65e91074e1476b90c8e5 (diff) | |
download | pixel-f2e22cee311d343d9d7289361ab369e545ec22bf.tar.gz |
Merge cherrypicks of ['googleplex-android-review.googlesource.com/26568916'] into 24Q2-release.android-14.0.0_r54android-14.0.0_r53android-14.0.0_r52android-14.0.0_r51android-14.0.0_r50android14-qpr3-s2-releaseandroid14-qpr3-release
Change-Id: I2835f555c7de5ea0f01493aadf1d94038ced8e3b
Diffstat (limited to 'power-libperfmgr/aidl/PowerHintSession.cpp')
-rw-r--r-- | power-libperfmgr/aidl/PowerHintSession.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/power-libperfmgr/aidl/PowerHintSession.cpp b/power-libperfmgr/aidl/PowerHintSession.cpp index ee9093e7..fd119c72 100644 --- a/power-libperfmgr/aidl/PowerHintSession.cpp +++ b/power-libperfmgr/aidl/PowerHintSession.cpp @@ -46,6 +46,8 @@ using ::android::perfmgr::HintManager; using std::chrono::duration_cast; using std::chrono::nanoseconds; +using std::operator""ms; + namespace { static std::atomic<int64_t> sSessionIDCounter{0}; @@ -176,10 +178,11 @@ void PowerHintSession::updatePidControlVariable(int pidControlVariable, bool upd mDescriptor->pidControlVariable = pidControlVariable; if (updateVote) { auto adpfConfig = HintManager::GetInstance()->GetAdpfProfile(); - mPSManager->voteSet( - mSessionId, AdpfHintType::ADPF_VOTE_DEFAULT, pidControlVariable, kUclampMax, - std::chrono::steady_clock::now(), - duration_cast<nanoseconds>(mDescriptor->targetNs * adpfConfig->mStaleTimeFactor)); + mPSManager->voteSet(mSessionId, AdpfHintType::ADPF_VOTE_DEFAULT, pidControlVariable, + kUclampMax, std::chrono::steady_clock::now(), + std::max(duration_cast<nanoseconds>(mDescriptor->targetNs * + adpfConfig->mStaleTimeFactor), + nanoseconds(adpfConfig->mReportingRateLimitNs) * 2)); } ATRACE_INT(mAppDescriptorTrace.trace_min.c_str(), pidControlVariable); } |