sm6375-common: power-libperfmgr: ADPF: support sending power hint
Send a hint only when the system can support the hint. Bug: 243025173 Test: PtsUiBench & CUJ Change-Id: If56d0c22f8dd61f5fe27ba79f08f2963269abe41 Merged-In: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
This commit is contained in:
parent
c4d4353fdd
commit
f4fd4bcd5c
2 changed files with 13 additions and 0 deletions
|
@ -189,6 +189,15 @@ void PowerHintSession::updateUniveralBoostMode() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PowerHintSession::tryToSendPowerHint(std::string hint) {
|
||||||
|
if (!mSupportedHints[hint].has_value()) {
|
||||||
|
mSupportedHints[hint] = HintManager::GetInstance()->IsHintSupported(hint);
|
||||||
|
}
|
||||||
|
if (mSupportedHints[hint].value()) {
|
||||||
|
HintManager::GetInstance()->DoHint(hint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int PowerHintSession::setSessionUclampMin(int32_t min) {
|
int PowerHintSession::setSessionUclampMin(int32_t min) {
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> guard(mSessionLock);
|
std::lock_guard<std::mutex> guard(mSessionLock);
|
||||||
|
|
|
@ -130,6 +130,7 @@ class PowerHintSession : public BnPowerHintSession {
|
||||||
private:
|
private:
|
||||||
void updateUniveralBoostMode();
|
void updateUniveralBoostMode();
|
||||||
int setSessionUclampMin(int32_t min);
|
int setSessionUclampMin(int32_t min);
|
||||||
|
void tryToSendPowerHint(std::string hint);
|
||||||
std::string getIdString() const;
|
std::string getIdString() const;
|
||||||
AppHintDesc *mDescriptor = nullptr;
|
AppHintDesc *mDescriptor = nullptr;
|
||||||
sp<StaleTimerHandler> mStaleTimerHandler;
|
sp<StaleTimerHandler> mStaleTimerHandler;
|
||||||
|
@ -142,6 +143,9 @@ class PowerHintSession : public BnPowerHintSession {
|
||||||
int64_t mLastStartedTimeNs;
|
int64_t mLastStartedTimeNs;
|
||||||
int64_t mLastDurationNs;
|
int64_t mLastDurationNs;
|
||||||
int64_t mWorkPeriodNs;
|
int64_t mWorkPeriodNs;
|
||||||
|
|
||||||
|
// To cache the status of whether ADPF hints are supported.
|
||||||
|
std::unordered_map<std::string, std::optional<bool>> mSupportedHints;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace pixel
|
} // namespace pixel
|
||||||
|
|
Loading…
Reference in a new issue