diff options
author | 2023-09-27 19:41:59 +0000 | |
---|---|---|
committer | 2023-09-27 19:41:59 +0000 | |
commit | bd304f3d68747cd80c551d9f95c5d7d8cd1f30d5 (patch) | |
tree | 1b8aa06876c204bfa1b5ea3ff261ee0d7a4b3c4b | |
parent | 3710ce6e5dfd986de24107877b34486cdebadb29 (diff) | |
parent | 348d90c78a63e9e042b692449b05aa1f5629f146 (diff) |
Merge "Send cached target duration when creating sessions" into udc-qpr-dev am: 348d90c78a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24866464
Change-Id: I162b41e03709c8c0a967b2f96d8306c025f5874c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libs/hwui/renderthread/HintSessionWrapper.cpp | 7 | ||||
-rw-r--r-- | libs/hwui/renderthread/HintSessionWrapper.h | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/HintSessionWrapper.cpp b/libs/hwui/renderthread/HintSessionWrapper.cpp index d1ebe6d9f576..565da52de940 100644 --- a/libs/hwui/renderthread/HintSessionWrapper.cpp +++ b/libs/hwui/renderthread/HintSessionWrapper.cpp @@ -72,6 +72,7 @@ void HintSessionWrapper::destroy() { mSessionValid = true; mHintSession = nullptr; } + mResetsSinceLastReport = 0; } bool HintSessionWrapper::init() { @@ -111,10 +112,10 @@ bool HintSessionWrapper::init() { // Use a placeholder target value to initialize, // this will always be replaced elsewhere before it gets used - int64_t defaultTargetDurationNanos = 16666667; + int64_t targetDurationNanos = + mLastTargetWorkDuration == 0 ? kDefaultTargetDuration : mLastTargetWorkDuration; mHintSessionFuture = CommonPool::async([=, this, tids = std::move(tids)] { - return mBinding->createSession(manager, tids.data(), tids.size(), - defaultTargetDurationNanos); + return mBinding->createSession(manager, tids.data(), tids.size(), targetDurationNanos); }); return false; } diff --git a/libs/hwui/renderthread/HintSessionWrapper.h b/libs/hwui/renderthread/HintSessionWrapper.h index 36e91ea33c75..41891cd80a42 100644 --- a/libs/hwui/renderthread/HintSessionWrapper.h +++ b/libs/hwui/renderthread/HintSessionWrapper.h @@ -65,6 +65,7 @@ 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 { |