Skip to content

Commit

Permalink
power: PowerHAL: remove UclampMinGranularity
Browse files Browse the repository at this point in the history
This is causing session update skipped and stuck.

Bug: 232336917
Test: /data/nativetest64/libperfmgr_test/libperfmgr_test
Signed-off-by: Wei Wang <[email protected]>
Change-Id: I8928b6f6a60dcf8d21e60228a74d3aa0ab792eff
  • Loading branch information
weivincewang authored and rayavanindra committed Jul 20, 2024
1 parent 0c36569 commit 61b08d1
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions power-libperfmgr/aidl/PowerHintSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,9 @@ int PowerHintSession::setUclamp(int32_t min, bool update) {
if (update) {
mDescriptor->current_min = min;
}
mDescriptor->transitioanl_min = min;
return 0;
}

int PowerHintSession::restoreUclamp() {
if (mDescriptor->transitioanl_min == mDescriptor->current_min) {
return 1;
}
return setUclamp(mDescriptor->current_min, false);
}

ndk::ScopedAStatus PowerHintSession::pause() {
if (mSessionClosed) {
ALOGE("Error: session is dead");
Expand Down Expand Up @@ -370,16 +362,10 @@ ndk::ScopedAStatus PowerHintSession::reportActualWorkDuration(
&(mDescriptor->previous_error), getIdString());

/* apply to all the threads in the group */
if (output != 0) {
int next_min = std::min(static_cast<int>(adpfConfig->mUclampMinHigh),
mDescriptor->current_min + static_cast<int>(output));
next_min = std::max(static_cast<int>(adpfConfig->mUclampMinLow), next_min);
if (std::abs(mDescriptor->current_min - next_min) > adpfConfig->mUclampMinGranularity) {
setUclamp(next_min);
} else {
restoreUclamp();
}
}
int next_min = std::min(static_cast<int>(adpfConfig->mUclampMinHigh),
mDescriptor->current_min + static_cast<int>(output));
next_min = std::max(static_cast<int>(adpfConfig->mUclampMinLow), next_min);
setUclamp(next_min);

return ndk::ScopedAStatus::ok();
}
Expand Down

0 comments on commit 61b08d1

Please sign in to comment.