sm6375-common: power-libperfmgr: Remove wakeup behavior from PowerHintSession and PowerSessionManager
Currently, all sessions get boosted any time DISPLAY_UPDATE_IMMINENT is sent from SurfaceFlinger which can lead to large, unnecessary boosts. This patch aims to change that by removing the wakeup behavior, relying instead on sessions to boost themselves with new load change hints. * Remove wakeup() from PowerHintSession * Remove wakeSessions from PowerSessionManager * Remove related timers and message handlers * Remove DISPLAY_UPDATE_IMMINENT behavior entirely Test: manual Bug: b/260136431 Change-Id: I4610edfefe8fcbef7d4cdbf5768830a9392a54f7
This commit is contained in:
parent
9e3f57229d
commit
caedda6122
4 changed files with 1 additions and 75 deletions
|
|
@ -97,37 +97,6 @@ void PowerSessionManager::updateHintBoost(const std::string &boost, int32_t dura
|
|||
ATRACE_CALL();
|
||||
ALOGV("PowerSessionManager::updateHintBoost: boost: %s, durationMs: %d", boost.c_str(),
|
||||
durationMs);
|
||||
if (boost.compare("DISPLAY_UPDATE_IMMINENT") == 0) {
|
||||
PowerHintMonitor::getInstance()->getLooper()->sendMessage(mWakeupHandler, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void PowerSessionManager::wakeSessions() {
|
||||
std::lock_guard<std::mutex> guard(mLock);
|
||||
std::shared_ptr<AdpfConfig> adpfConfig = HintManager::GetInstance()->GetAdpfProfile();
|
||||
std::unordered_set<PowerHintSession *> wakeupList;
|
||||
const int wakeupBoostValue = static_cast<int>(adpfConfig->mUclampMinInit);
|
||||
for (auto &it : mTidSessionListMap) {
|
||||
int tid = it.first;
|
||||
int maxboost = -1;
|
||||
// Find the max boost value among all the sessions that include the same TID.
|
||||
for (PowerHintSession *s : it.second) {
|
||||
if (!s->isActive())
|
||||
continue;
|
||||
// all active sessions need to be awakened.
|
||||
wakeupList.insert(s);
|
||||
if (s->isTimeout()) {
|
||||
maxboost = std::max(maxboost, s->getUclampMin());
|
||||
}
|
||||
}
|
||||
// Found the max boost and actally set to the task.
|
||||
if (maxboost != -1) {
|
||||
set_uclamp_min(tid, std::max(maxboost, wakeupBoostValue));
|
||||
}
|
||||
}
|
||||
for (PowerHintSession *s : wakeupList) {
|
||||
s->wakeup();
|
||||
}
|
||||
}
|
||||
|
||||
int PowerSessionManager::getDisplayRefreshRate() {
|
||||
|
|
@ -223,10 +192,6 @@ void PowerSessionManager::handleMessage(const Message &) {
|
|||
}
|
||||
}
|
||||
|
||||
void PowerSessionManager::WakeupHandler::handleMessage(const Message &) {
|
||||
PowerSessionManager::getInstance()->wakeSessions();
|
||||
}
|
||||
|
||||
void PowerSessionManager::dumpToFd(int fd) {
|
||||
std::ostringstream dump_buf;
|
||||
std::lock_guard<std::mutex> guard(mLock);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue