Remove rate limiter from adpf cpu hint session
Remove old rate limiter code as it's not used and no longer needed
Bug: b/244358432
Test: atest libsurfaceflinger_unittest:libsurfaceflinger_unittest.AidlPowerHalWrapperTest
Change-Id: I531280bd8f2d80137839dd9a12bc88d21a213f95
diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
index 566537b..d5309a9 100644
--- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
+++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
@@ -640,9 +640,6 @@
}
mSupportsPowerHint = checkPowerHintSessionSupported();
-
- // Currently set to 0 to disable rate limiter by default
- mAllowedActualDeviation = base::GetIntProperty<nsecs_t>("debug.sf.allowed_actual_deviation", 0);
}
AidlPowerHalWrapper::~AidlPowerHalWrapper() {
@@ -758,21 +755,6 @@
}
}
-bool AidlPowerHalWrapper::shouldReportActualDurations() {
- // Report if we have never reported before or will go stale next frame
- if (!mLastActualDurationSent.has_value() ||
- (mLastTargetDurationSent + systemTime() - mLastActualReportTimestamp) >
- kStaleTimeout.count()) {
- return true;
- }
-
- if (!mActualDuration.has_value()) {
- return false;
- }
- // Report if the change in actual duration exceeds the threshold
- return abs(*mActualDuration - *mLastActualDurationSent) > mAllowedActualDeviation;
-}
-
void AidlPowerHalWrapper::sendActualWorkDuration(int64_t actualDuration, nsecs_t timestamp) {
ATRACE_CALL();
@@ -801,22 +783,13 @@
" with error: %" PRId64,
reportedDuration, mLastTargetDurationSent, reportedDuration - mLastTargetDurationSent);
- // This rate limiter queues similar duration reports to the powerhal into
- // batches to avoid excessive binder calls. The criteria to send a given batch
- // are outlined in shouldReportActualDurationsNow()
- if (shouldReportActualDurations()) {
- ALOGV("Sending hint update batch");
- mLastActualReportTimestamp = systemTime();
- auto ret = mPowerHintSession->reportActualWorkDuration(mPowerHintQueue);
- if (!ret.isOk()) {
- ALOGW("Failed to report actual work durations with error: %s",
- ret.exceptionMessage().c_str());
- mShouldReconnectHal = true;
- }
- mPowerHintQueue.clear();
- // We save the actual duration here for rate limiting
- mLastActualDurationSent = actualDuration;
+ auto ret = mPowerHintSession->reportActualWorkDuration(mPowerHintQueue);
+ if (!ret.isOk()) {
+ ALOGW("Failed to report actual work durations with error: %s",
+ ret.exceptionMessage().c_str());
+ mShouldReconnectHal = true;
}
+ mPowerHintQueue.clear();
}
bool AidlPowerHalWrapper::shouldReconnectHAL() {
@@ -831,10 +804,6 @@
return mTargetDuration;
}
-void AidlPowerHalWrapper::setAllowedActualDeviation(nsecs_t allowedDeviation) {
- mAllowedActualDeviation = allowedDeviation;
-}
-
const bool AidlPowerHalWrapper::sTraceHintSessionData =
base::GetBoolProperty(std::string("debug.sf.trace_hint_sessions"), false);