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

Commit a25ad051 authored by Matt Buckley's avatar Matt Buckley
Browse files

[DO NOT MERGE] Revert "Send cached target duration when creating sessions"

This reverts commit 73b143c6.

Reason for revert: Performance issues

Bug: 300360668
Bug: 302620048

Change-Id: I2a00c0498392a49f64d1f0e523d3ccbc9b345c57
parent 73b143c6
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -72,7 +72,6 @@ void HintSessionWrapper::destroy() {
        mSessionValid = true;
        mHintSession = nullptr;
    }
    mResetsSinceLastReport = 0;
}

bool HintSessionWrapper::init() {
@@ -112,10 +111,10 @@ bool HintSessionWrapper::init() {

    // Use a placeholder target value to initialize,
    // this will always be replaced elsewhere before it gets used
    int64_t targetDurationNanos =
            mLastTargetWorkDuration == 0 ? kDefaultTargetDuration : mLastTargetWorkDuration;
    int64_t defaultTargetDurationNanos = 16666667;
    mHintSessionFuture = CommonPool::async([=, this, tids = std::move(tids)] {
        return mBinding->createSession(manager, tids.data(), tids.size(), targetDurationNanos);
        return mBinding->createSession(manager, tids.data(), tids.size(),
                                       defaultTargetDurationNanos);
    });
    return false;
}
+0 −1
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ private:
    static constexpr nsecs_t kResetHintTimeout = 100_ms;
    static constexpr int64_t kSanityCheckLowerBound = 100_us;
    static constexpr int64_t kSanityCheckUpperBound = 10_s;
    static constexpr int64_t kDefaultTargetDuration = 16666667;

    // Allows easier stub when testing
    class HintSessionBinding {