sm6375-common: power-libperfmgr: PowerHintSession: do not update PID controller when target changes

There is no history kept in powerhint session, so let us just keep what
we have in the PID controller and let new samples settle.

Bug: 227003278
Test: Build
Change-Id: Ia8b9a0be288389ec36ac35c668aca013d470c257
This commit is contained in:
Wei Wang 2024-07-18 12:56:42 +05:30 committed by Anand S
parent 020bd6ab5a
commit c515a81911
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61

View file

@ -269,10 +269,6 @@ ndk::ScopedAStatus PowerHintSession::updateTargetWorkDuration(int64_t targetDura
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
ALOGV("update target duration: %" PRId64 " ns", targetDurationNanos);
double ratio =
targetDurationNanos == 0 ? 1.0 : mDescriptor->duration.count() / targetDurationNanos;
mDescriptor->integral_error =
std::max(sPidIInit, static_cast<int64_t>(mDescriptor->integral_error * ratio));
mDescriptor->duration = std::chrono::nanoseconds(targetDurationNanos);
if (ATRACE_ENABLED()) {