Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cbe208b authored by Matt Buckley's avatar Matt Buckley Committed by Android (Google) Code Review
Browse files

Merge "Account for refresh rate in sf adpf hint session rate limiter"

parents 201b3378 a8a4597e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -759,9 +759,10 @@ void AidlPowerHalWrapper::setTargetWorkDuration(int64_t targetDuration) {
}

bool AidlPowerHalWrapper::shouldReportActualDurations() {
    // Report if we have never reported before or are approaching a stale session
    // Report if we have never reported before or will go stale next frame
    if (!mLastActualDurationSent.has_value() ||
        (systemTime() - mLastActualReportTimestamp) > kStaleTimeout.count()) {
        (mLastTargetDurationSent + systemTime() - mLastActualReportTimestamp) >
                kStaleTimeout.count()) {
        return true;
    }

+1 −1
Original line number Diff line number Diff line
@@ -332,7 +332,7 @@ private:
    static const bool sTraceHintSessionData;
    static constexpr const std::chrono::nanoseconds kDefaultTarget = 16ms;
    // Amount of time after the last message was sent before the session goes stale
    // actually 100ms but we use 80 here to ideally avoid going stale
    // actually 100ms but we use 80 here to give some slack
    static constexpr const std::chrono::nanoseconds kStaleTimeout = 80ms;
};