From 5b351053039b88cf89b84fe49f019deded8251c8 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Thu, 12 May 2022 09:54:25 -0700 Subject: [PATCH] power: PowerHAL: remove UclampMinGranularity This is causing session update skipped and stuck. Bug: 232336917 Test: /data/nativetest64/libperfmgr_test/libperfmgr_test Signed-off-by: Wei Wang Change-Id: I8928b6f6a60dcf8d21e60228a74d3aa0ab792eff --- aidl/power-libperfmgr/PowerHintSession.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/aidl/power-libperfmgr/PowerHintSession.cpp b/aidl/power-libperfmgr/PowerHintSession.cpp index c562b06..18a37a8 100644 --- a/aidl/power-libperfmgr/PowerHintSession.cpp +++ b/aidl/power-libperfmgr/PowerHintSession.cpp @@ -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"); @@ -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(adpfConfig->mUclampMinHigh), - mDescriptor->current_min + static_cast(output)); - next_min = std::max(static_cast(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(adpfConfig->mUclampMinHigh), + mDescriptor->current_min + static_cast(output)); + next_min = std::max(static_cast(adpfConfig->mUclampMinLow), next_min); + setUclamp(next_min); return ndk::ScopedAStatus::ok(); }