Adpf: set uclamp when session is created

When seesion is created, set uclamp to boost CPU for top-app.

Bug: 192143316
Test: Build and run UiBenchSlowNestedRecyclerViewInitialFlingMicrobenchmark test
Change-Id: I748037019fae439ab1863a5ed21aa98b9d26e0dc
This commit is contained in:
Jimmy Shiu 2021-06-27 01:39:31 +08:00 committed by Arian
parent 3f7fdd8623
commit a9e7626ffb
No known key found for this signature in database
GPG Key ID: 48029380598CE3B9

View File

@ -136,6 +136,8 @@ PowerHintSession::PowerHintSession(int32_t tgid, int32_t uid, const std::vector<
ATRACE_INT(sz.c_str(), mDescriptor->is_active.load());
}
PowerSessionManager::getInstance()->addPowerSession(this);
// init boost
setUclamp(sUclampCap, 1024);
ALOGV("PowerHintSession created: %s", mDescriptor->toString().c_str());
}
@ -212,6 +214,8 @@ ndk::ScopedAStatus PowerHintSession::resume() {
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
mDescriptor->is_active.store(true);
mDescriptor->integral_error = std::max(sPidIInit, mDescriptor->integral_error);
// resume boost
setUclamp(sUclampCap, 1024);
if (ATRACE_ENABLED()) {
const std::string idstr = getIdString();
std::string sz = StringPrintf("adpf.%s-active", idstr.c_str());