Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Marin Shalamanov | bed7fd3 | 2020-12-21 20:02:20 +0100 | [diff] [blame] | 17 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
| 18 | #pragma clang diagnostic push |
| 19 | #pragma clang diagnostic ignored "-Wextra" |
| 20 | |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 21 | // #define LOG_NDEBUG 0 |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 22 | #define ATRACE_TAG ATRACE_TAG_GRAPHICS |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 23 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 24 | #include "LayerInfo.h" |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 25 | |
| 26 | #include <algorithm> |
| 27 | #include <utility> |
| 28 | |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 29 | #include <android/native_window.h> |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 30 | #include <cutils/compiler.h> |
| 31 | #include <cutils/trace.h> |
Dominik Laskowski | f5d0ea5 | 2021-09-26 17:27:01 -0700 | [diff] [blame] | 32 | #include <ftl/enum.h> |
Ady Abraham | 73c3df5 | 2023-01-12 18:09:31 -0800 | [diff] [blame] | 33 | #include <gui/TraceUtils.h> |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 34 | #include <system/window.h> |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 35 | |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 36 | #undef LOG_TAG |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 37 | #define LOG_TAG "LayerInfo" |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 38 | |
| 39 | namespace android::scheduler { |
| 40 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 41 | bool LayerInfo::sTraceEnabled = false; |
Ady Abraham | b1b9d41 | 2020-06-01 19:53:52 -0700 | [diff] [blame] | 42 | |
Ady Abraham | bdda8f0 | 2021-04-01 16:06:11 -0700 | [diff] [blame] | 43 | LayerInfo::LayerInfo(const std::string& name, uid_t ownerUid, |
| 44 | LayerHistory::LayerVoteType defaultVote) |
Ady Abraham | a6b676e | 2020-05-27 14:29:09 -0700 | [diff] [blame] | 45 | : mName(name), |
Ady Abraham | bdda8f0 | 2021-04-01 16:06:11 -0700 | [diff] [blame] | 46 | mOwnerUid(ownerUid), |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 47 | mDefaultVote(defaultVote), |
Dominik Laskowski | 6eab42d | 2021-09-13 14:34:13 -0700 | [diff] [blame] | 48 | mLayerVote({defaultVote, Fps()}), |
Vishnu Nair | ef68d6d | 2023-02-28 06:18:27 +0000 | [diff] [blame] | 49 | mLayerProps(std::make_unique<LayerProps>()), |
| 50 | mRefreshRateHistory(name) { |
| 51 | ; |
| 52 | } |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 53 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 54 | void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now, LayerUpdateType updateType, |
Vishnu Nair | ef68d6d | 2023-02-28 06:18:27 +0000 | [diff] [blame] | 55 | bool pendingModeChange, const LayerProps& props) { |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 56 | lastPresentTime = std::max(lastPresentTime, static_cast<nsecs_t>(0)); |
| 57 | |
| 58 | mLastUpdatedTime = std::max(lastPresentTime, now); |
Vishnu Nair | ef68d6d | 2023-02-28 06:18:27 +0000 | [diff] [blame] | 59 | *mLayerProps = props; |
Ady Abraham | 5def733 | 2020-05-29 16:13:47 -0700 | [diff] [blame] | 60 | switch (updateType) { |
| 61 | case LayerUpdateType::AnimationTX: |
| 62 | mLastAnimationTime = std::max(lastPresentTime, now); |
| 63 | break; |
| 64 | case LayerUpdateType::SetFrameRate: |
| 65 | case LayerUpdateType::Buffer: |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 66 | FrameTimeData frameTime = {.presentTime = lastPresentTime, |
Ady Abraham | 5def733 | 2020-05-29 16:13:47 -0700 | [diff] [blame] | 67 | .queueTime = mLastUpdatedTime, |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 68 | .pendingModeChange = pendingModeChange, |
| 69 | .isSmallDirty = props.isSmallDirty}; |
Ady Abraham | 5def733 | 2020-05-29 16:13:47 -0700 | [diff] [blame] | 70 | mFrameTimes.push_back(frameTime); |
| 71 | if (mFrameTimes.size() > HISTORY_SIZE) { |
| 72 | mFrameTimes.pop_front(); |
| 73 | } |
| 74 | break; |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 75 | } |
| 76 | } |
| 77 | |
Vishnu Nair | 41376b6 | 2023-11-08 05:08:58 -0800 | [diff] [blame] | 78 | void LayerInfo::setProperties(const android::scheduler::LayerProps& properties) { |
| 79 | *mLayerProps = properties; |
| 80 | } |
| 81 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 82 | bool LayerInfo::isFrameTimeValid(const FrameTimeData& frameTime) const { |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 83 | return frameTime.queueTime >= std::chrono::duration_cast<std::chrono::nanoseconds>( |
| 84 | mFrameTimeValidSince.time_since_epoch()) |
| 85 | .count(); |
| 86 | } |
Ady Abraham | 1adbb72 | 2020-05-15 11:51:48 -0700 | [diff] [blame] | 87 | |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 88 | LayerInfo::Frequent LayerInfo::isFrequent(nsecs_t now) const { |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 89 | // If we know nothing about this layer (e.g. after touch event), |
| 90 | // we consider it as frequent as it might be the start of an animation. |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 91 | if (mFrameTimes.size() < kFrequentLayerWindowSize) { |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 92 | return {/* isFrequent */ true, /* clearHistory */ false, /* isConclusive */ true}; |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 93 | } |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 94 | |
| 95 | // Non-active layers are also infrequent |
| 96 | if (mLastUpdatedTime < getActiveLayerThreshold(now)) { |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 97 | return {/* isFrequent */ false, /* clearHistory */ false, /* isConclusive */ true}; |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | // We check whether we can classify this layer as frequent or infrequent: |
| 101 | // - frequent: a layer posted kFrequentLayerWindowSize within |
| 102 | // kMaxPeriodForFrequentLayerNs of each other. |
| 103 | // - infrequent: a layer posted kFrequentLayerWindowSize with longer |
| 104 | // gaps than kFrequentLayerWindowSize. |
| 105 | // If we can't determine the layer classification yet, we return the last |
| 106 | // classification. |
| 107 | bool isFrequent = true; |
| 108 | bool isInfrequent = true; |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 109 | int32_t smallDirtyCount = 0; |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 110 | const auto n = mFrameTimes.size() - 1; |
| 111 | for (size_t i = 0; i < kFrequentLayerWindowSize - 1; i++) { |
| 112 | if (mFrameTimes[n - i].queueTime - mFrameTimes[n - i - 1].queueTime < |
| 113 | kMaxPeriodForFrequentLayerNs.count()) { |
| 114 | isInfrequent = false; |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 115 | if (mFrameTimes[n - i].presentTime == 0 && mFrameTimes[n - i].isSmallDirty) { |
| 116 | smallDirtyCount++; |
| 117 | } |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 118 | } else { |
| 119 | isFrequent = false; |
| 120 | } |
| 121 | } |
| 122 | |
Arthur Hung | 8144e02 | 2023-09-08 10:26:23 +0000 | [diff] [blame] | 123 | // Vote the small dirty when a layer contains at least HISTORY_SIZE of small dirty updates. |
| 124 | bool isSmallDirty = false; |
| 125 | if (smallDirtyCount >= kNumSmallDirtyThreshold) { |
| 126 | if (mLastSmallDirtyCount >= HISTORY_SIZE) { |
| 127 | isSmallDirty = true; |
| 128 | } else { |
| 129 | mLastSmallDirtyCount++; |
| 130 | } |
| 131 | } else { |
| 132 | mLastSmallDirtyCount = 0; |
| 133 | } |
| 134 | |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 135 | if (isFrequent || isInfrequent) { |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 136 | // If the layer was previously inconclusive, we clear |
| 137 | // the history as indeterminate layers changed to frequent, |
| 138 | // and we should not look at the stale data. |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 139 | return {isFrequent, isFrequent && !mIsFrequencyConclusive, /* isConclusive */ true, |
Arthur Hung | 8144e02 | 2023-09-08 10:26:23 +0000 | [diff] [blame] | 140 | isSmallDirty}; |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | // If we can't determine whether the layer is frequent or not, we return |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 144 | // the last known classification and mark the layer frequency as inconclusive. |
| 145 | isFrequent = !mLastRefreshRate.infrequent; |
| 146 | |
| 147 | // If the layer was previously tagged as animating, we clear |
| 148 | // the history as it is likely the layer just changed its behavior, |
| 149 | // and we should not look at stale data. |
| 150 | return {isFrequent, isFrequent && mLastRefreshRate.animating, /* isConclusive */ false}; |
Nathaniel Nifong | 1303d91 | 2021-10-06 09:41:24 -0400 | [diff] [blame] | 151 | } |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 152 | |
Nathaniel Nifong | 1303d91 | 2021-10-06 09:41:24 -0400 | [diff] [blame] | 153 | Fps LayerInfo::getFps(nsecs_t now) const { |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 154 | // Find the first active frame |
Ady Abraham | 983e568 | 2020-05-28 16:49:18 -0700 | [diff] [blame] | 155 | auto it = mFrameTimes.begin(); |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 156 | for (; it != mFrameTimes.end(); ++it) { |
| 157 | if (it->queueTime >= getActiveLayerThreshold(now)) { |
| 158 | break; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | const auto numFrames = std::distance(it, mFrameTimes.end()); |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 163 | if (numFrames < kFrequentLayerWindowSize) { |
Nathaniel Nifong | 1303d91 | 2021-10-06 09:41:24 -0400 | [diff] [blame] | 164 | return Fps(); |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | // Layer is considered frequent if the average frame rate is higher than the threshold |
| 168 | const auto totalTime = mFrameTimes.back().queueTime - it->queueTime; |
Nathaniel Nifong | 1303d91 | 2021-10-06 09:41:24 -0400 | [diff] [blame] | 169 | return Fps::fromPeriodNsecs(totalTime / (numFrames - 1)); |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 170 | } |
| 171 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 172 | bool LayerInfo::isAnimating(nsecs_t now) const { |
Ady Abraham | 5def733 | 2020-05-29 16:13:47 -0700 | [diff] [blame] | 173 | return mLastAnimationTime >= getActiveLayerThreshold(now); |
| 174 | } |
| 175 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 176 | bool LayerInfo::hasEnoughDataForHeuristic() const { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 177 | // The layer had to publish at least HISTORY_SIZE or HISTORY_DURATION of updates |
Ady Abraham | a61edcb | 2020-01-30 18:32:03 -0800 | [diff] [blame] | 178 | if (mFrameTimes.size() < 2) { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 179 | ALOGV("fewer than 2 frames recorded: %zu", mFrameTimes.size()); |
Ady Abraham | a61edcb | 2020-01-30 18:32:03 -0800 | [diff] [blame] | 180 | return false; |
| 181 | } |
| 182 | |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 183 | if (!isFrameTimeValid(mFrameTimes.front())) { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 184 | ALOGV("stale frames still captured"); |
Ady Abraham | dfb63ba | 2020-05-27 20:05:05 +0000 | [diff] [blame] | 185 | return false; |
| 186 | } |
| 187 | |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 188 | const auto totalDuration = mFrameTimes.back().queueTime - mFrameTimes.front().queueTime; |
| 189 | if (mFrameTimes.size() < HISTORY_SIZE && totalDuration < HISTORY_DURATION.count()) { |
| 190 | ALOGV("not enough frames captured: %zu | %.2f seconds", mFrameTimes.size(), |
| 191 | totalDuration / 1e9f); |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 192 | return false; |
| 193 | } |
| 194 | |
| 195 | return true; |
| 196 | } |
| 197 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 198 | std::optional<nsecs_t> LayerInfo::calculateAverageFrameTime() const { |
Marin Shalamanov | a7fe304 | 2021-01-29 21:02:08 +0100 | [diff] [blame] | 199 | // Ignore frames captured during a mode change |
| 200 | const bool isDuringModeChange = |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 201 | std::any_of(mFrameTimes.begin(), mFrameTimes.end(), |
Marin Shalamanov | a7fe304 | 2021-01-29 21:02:08 +0100 | [diff] [blame] | 202 | [](const auto& frame) { return frame.pendingModeChange; }); |
| 203 | if (isDuringModeChange) { |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 204 | return std::nullopt; |
| 205 | } |
Ady Abraham | 32efd54 | 2020-05-19 17:49:26 -0700 | [diff] [blame] | 206 | |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 207 | const bool isMissingPresentTime = |
| 208 | std::any_of(mFrameTimes.begin(), mFrameTimes.end(), |
| 209 | [](auto frame) { return frame.presentTime == 0; }); |
| 210 | if (isMissingPresentTime && !mLastRefreshRate.reported.isValid()) { |
| 211 | // If there are no presentation timestamps and we haven't calculated |
| 212 | // one in the past then we can't calculate the refresh rate |
| 213 | return std::nullopt; |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 214 | } |
Ady Abraham | c966483 | 2020-05-12 14:16:56 -0700 | [diff] [blame] | 215 | |
Ady Abraham | c966483 | 2020-05-12 14:16:56 -0700 | [diff] [blame] | 216 | // Calculate the average frame time based on presentation timestamps. If those |
| 217 | // doesn't exist, we look at the time the buffer was queued only. We can do that only if |
| 218 | // we calculated a refresh rate based on presentation timestamps in the past. The reason |
| 219 | // we look at the queue time is to handle cases where hwui attaches presentation timestamps |
| 220 | // when implementing render ahead for specific refresh rates. When hwui no longer provides |
| 221 | // presentation timestamps we look at the queue time to see if the current refresh rate still |
| 222 | // matches the content. |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 223 | |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 224 | auto getFrameTime = isMissingPresentTime ? [](FrameTimeData data) { return data.queueTime; } |
| 225 | : [](FrameTimeData data) { return data.presentTime; }; |
| 226 | |
| 227 | nsecs_t totalDeltas = 0; |
| 228 | int numDeltas = 0; |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 229 | int32_t smallDirtyCount = 0; |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 230 | auto prevFrame = mFrameTimes.begin(); |
| 231 | for (auto it = mFrameTimes.begin() + 1; it != mFrameTimes.end(); ++it) { |
| 232 | const auto currDelta = getFrameTime(*it) - getFrameTime(*prevFrame); |
| 233 | if (currDelta < kMinPeriodBetweenFrames) { |
| 234 | // Skip this frame, but count the delta into the next frame |
| 235 | continue; |
| 236 | } |
| 237 | |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 238 | // If this is a small area update, we don't want to consider it for calculating the average |
| 239 | // frame time. Instead, we let the bigger frame updates to drive the calculation. |
| 240 | if (it->isSmallDirty && currDelta < kMinPeriodBetweenSmallDirtyFrames) { |
| 241 | smallDirtyCount++; |
| 242 | continue; |
| 243 | } |
| 244 | |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 245 | prevFrame = it; |
| 246 | |
| 247 | if (currDelta > kMaxPeriodBetweenFrames) { |
| 248 | // Skip this frame and the current delta. |
| 249 | continue; |
| 250 | } |
| 251 | |
| 252 | totalDeltas += currDelta; |
| 253 | numDeltas++; |
| 254 | } |
| 255 | |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 256 | if (smallDirtyCount > 0) { |
| 257 | ATRACE_FORMAT_INSTANT("small dirty = %" PRIu32, smallDirtyCount); |
| 258 | } |
| 259 | |
Marin Shalamanov | 2045d5b | 2020-12-28 18:11:41 +0100 | [diff] [blame] | 260 | if (numDeltas == 0) { |
| 261 | return std::nullopt; |
| 262 | } |
| 263 | |
| 264 | const auto averageFrameTime = static_cast<double>(totalDeltas) / static_cast<double>(numDeltas); |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 265 | return static_cast<nsecs_t>(averageFrameTime); |
Ady Abraham | 32efd54 | 2020-05-19 17:49:26 -0700 | [diff] [blame] | 266 | } |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 267 | |
Dominik Laskowski | d82e0f0 | 2022-10-26 15:23:04 -0400 | [diff] [blame] | 268 | std::optional<Fps> LayerInfo::calculateRefreshRateIfPossible(const RefreshRateSelector& selector, |
| 269 | nsecs_t now) { |
Ady Abraham | 73c3df5 | 2023-01-12 18:09:31 -0800 | [diff] [blame] | 270 | ATRACE_CALL(); |
Ady Abraham | 32efd54 | 2020-05-19 17:49:26 -0700 | [diff] [blame] | 271 | static constexpr float MARGIN = 1.0f; // 1Hz |
Ady Abraham | 32efd54 | 2020-05-19 17:49:26 -0700 | [diff] [blame] | 272 | if (!hasEnoughDataForHeuristic()) { |
| 273 | ALOGV("Not enough data"); |
| 274 | return std::nullopt; |
| 275 | } |
| 276 | |
Dominik Laskowski | 6eab42d | 2021-09-13 14:34:13 -0700 | [diff] [blame] | 277 | if (const auto averageFrameTime = calculateAverageFrameTime()) { |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 278 | const auto refreshRate = Fps::fromPeriodNsecs(*averageFrameTime); |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 279 | const bool refreshRateConsistent = mRefreshRateHistory.add(refreshRate, now); |
| 280 | if (refreshRateConsistent) { |
Dominik Laskowski | d82e0f0 | 2022-10-26 15:23:04 -0400 | [diff] [blame] | 281 | const auto knownRefreshRate = selector.findClosestKnownFrameRate(refreshRate); |
Dominik Laskowski | 6eab42d | 2021-09-13 14:34:13 -0700 | [diff] [blame] | 282 | using fps_approx_ops::operator!=; |
| 283 | |
| 284 | // To avoid oscillation, use the last calculated refresh rate if it is close enough. |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 285 | if (std::abs(mLastRefreshRate.calculated.getValue() - refreshRate.getValue()) > |
| 286 | MARGIN && |
Dominik Laskowski | 6eab42d | 2021-09-13 14:34:13 -0700 | [diff] [blame] | 287 | mLastRefreshRate.reported != knownRefreshRate) { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 288 | mLastRefreshRate.calculated = refreshRate; |
| 289 | mLastRefreshRate.reported = knownRefreshRate; |
| 290 | } |
| 291 | |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 292 | ALOGV("%s %s rounded to nearest known frame rate %s", mName.c_str(), |
| 293 | to_string(refreshRate).c_str(), to_string(mLastRefreshRate.reported).c_str()); |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 294 | } else { |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 295 | ALOGV("%s Not stable (%s) returning last known frame rate %s", mName.c_str(), |
| 296 | to_string(refreshRate).c_str(), to_string(mLastRefreshRate.reported).c_str()); |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 297 | } |
Ady Abraham | 32efd54 | 2020-05-19 17:49:26 -0700 | [diff] [blame] | 298 | } |
| 299 | |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 300 | return mLastRefreshRate.reported.isValid() ? std::make_optional(mLastRefreshRate.reported) |
| 301 | : std::nullopt; |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 302 | } |
| 303 | |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 304 | LayerInfo::RefreshRateVotes LayerInfo::getRefreshRateVote(const RefreshRateSelector& selector, |
| 305 | nsecs_t now) { |
Ady Abraham | 73c3df5 | 2023-01-12 18:09:31 -0800 | [diff] [blame] | 306 | ATRACE_CALL(); |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 307 | LayerInfo::RefreshRateVotes votes; |
| 308 | |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 309 | if (mLayerVote.type != LayerHistory::LayerVoteType::Heuristic) { |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 310 | if (mLayerVote.category != FrameRateCategory::Default) { |
Rachel Lee | 414f408 | 2023-10-23 14:48:44 -0700 | [diff] [blame] | 311 | const auto voteType = mLayerVote.type == LayerHistory::LayerVoteType::NoVote |
| 312 | ? LayerHistory::LayerVoteType::NoVote |
| 313 | : LayerHistory::LayerVoteType::ExplicitCategory; |
| 314 | ATRACE_FORMAT_INSTANT("Vote %s (category=%s)", ftl::enum_string(voteType).c_str(), |
Rachel Lee | c0e40bc | 2023-09-12 13:41:15 -0700 | [diff] [blame] | 315 | ftl::enum_string(mLayerVote.category).c_str()); |
Rachel Lee | 414f408 | 2023-10-23 14:48:44 -0700 | [diff] [blame] | 316 | ALOGV("%s voted %s with category: %s", mName.c_str(), |
| 317 | ftl::enum_string(voteType).c_str(), |
| 318 | ftl::enum_string(mLayerVote.category).c_str()); |
| 319 | votes.push_back({voteType, Fps(), Seamlessness::Default, mLayerVote.category, |
Rachel Lee | 67afbea | 2023-09-28 15:35:07 -0700 | [diff] [blame] | 320 | mLayerVote.categorySmoothSwitchOnly}); |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | if (mLayerVote.fps.isValid() || |
| 324 | mLayerVote.type != LayerHistory::LayerVoteType::ExplicitDefault) { |
Rachel Lee | c0e40bc | 2023-09-12 13:41:15 -0700 | [diff] [blame] | 325 | ATRACE_FORMAT_INSTANT("Vote %s", ftl::enum_string(mLayerVote.type).c_str()); |
Rachel Lee | 414f408 | 2023-10-23 14:48:44 -0700 | [diff] [blame] | 326 | ALOGV("%s voted %d", mName.c_str(), static_cast<int>(mLayerVote.type)); |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 327 | votes.push_back(mLayerVote); |
| 328 | } |
| 329 | |
| 330 | return votes; |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 331 | } |
| 332 | |
Ady Abraham | 5def733 | 2020-05-29 16:13:47 -0700 | [diff] [blame] | 333 | if (isAnimating(now)) { |
Ady Abraham | 73c3df5 | 2023-01-12 18:09:31 -0800 | [diff] [blame] | 334 | ATRACE_FORMAT_INSTANT("animating"); |
Ady Abraham | 5def733 | 2020-05-29 16:13:47 -0700 | [diff] [blame] | 335 | ALOGV("%s is animating", mName.c_str()); |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 336 | mLastRefreshRate.animating = true; |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 337 | votes.push_back({LayerHistory::LayerVoteType::Max, Fps()}); |
| 338 | return votes; |
Ady Abraham | 5def733 | 2020-05-29 16:13:47 -0700 | [diff] [blame] | 339 | } |
| 340 | |
Alec Mouri | 89f5d4e | 2023-10-20 17:12:49 +0000 | [diff] [blame] | 341 | // Vote for max refresh rate whenever we're front-buffered. |
| 342 | if (FlagManager::getInstance().vrr_config() && isFrontBuffered()) { |
| 343 | ATRACE_FORMAT_INSTANT("front buffered"); |
| 344 | ALOGV("%s is front-buffered", mName.c_str()); |
| 345 | votes.push_back({LayerHistory::LayerVoteType::Max, Fps()}); |
| 346 | return votes; |
| 347 | } |
| 348 | |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 349 | const LayerInfo::Frequent frequent = isFrequent(now); |
| 350 | mIsFrequencyConclusive = frequent.isConclusive; |
| 351 | if (!frequent.isFrequent) { |
Ady Abraham | 73c3df5 | 2023-01-12 18:09:31 -0800 | [diff] [blame] | 352 | ATRACE_FORMAT_INSTANT("infrequent"); |
Ady Abraham | a6b676e | 2020-05-27 14:29:09 -0700 | [diff] [blame] | 353 | ALOGV("%s is infrequent", mName.c_str()); |
Ady Abraham | 86ac5c5 | 2023-01-11 15:24:03 -0800 | [diff] [blame] | 354 | mLastRefreshRate.infrequent = true; |
Arthur Hung | 8144e02 | 2023-09-08 10:26:23 +0000 | [diff] [blame] | 355 | mLastSmallDirtyCount = 0; |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 356 | // Infrequent layers vote for minimal refresh rate for |
Marin Shalamanov | 29e2540 | 2021-04-07 21:09:58 +0200 | [diff] [blame] | 357 | // battery saving purposes and also to prevent b/135718869. |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 358 | votes.push_back({LayerHistory::LayerVoteType::Min, Fps()}); |
| 359 | return votes; |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 360 | } |
| 361 | |
ramindani | 63db24e | 2023-04-03 10:56:05 -0700 | [diff] [blame] | 362 | if (frequent.clearHistory) { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 363 | clearHistory(now); |
| 364 | } |
| 365 | |
Arthur Hung | 8144e02 | 2023-09-08 10:26:23 +0000 | [diff] [blame] | 366 | // Return no vote if the recent frames are small dirty. |
Arthur Hung | c70bee2 | 2023-06-02 01:35:52 +0000 | [diff] [blame] | 367 | if (frequent.isSmallDirty && !mLastRefreshRate.reported.isValid()) { |
| 368 | ATRACE_FORMAT_INSTANT("NoVote (small dirty)"); |
| 369 | ALOGV("%s is small dirty", mName.c_str()); |
| 370 | votes.push_back({LayerHistory::LayerVoteType::NoVote, Fps()}); |
| 371 | return votes; |
| 372 | } |
| 373 | |
Dominik Laskowski | d82e0f0 | 2022-10-26 15:23:04 -0400 | [diff] [blame] | 374 | auto refreshRate = calculateRefreshRateIfPossible(selector, now); |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 375 | if (refreshRate.has_value()) { |
Rachel Lee | c0e40bc | 2023-09-12 13:41:15 -0700 | [diff] [blame] | 376 | ATRACE_FORMAT_INSTANT("calculated (%s)", to_string(*refreshRate).c_str()); |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 377 | ALOGV("%s calculated refresh rate: %s", mName.c_str(), to_string(*refreshRate).c_str()); |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 378 | votes.push_back({LayerHistory::LayerVoteType::Heuristic, refreshRate.value()}); |
| 379 | return votes; |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 380 | } |
| 381 | |
Rachel Lee | c0e40bc | 2023-09-12 13:41:15 -0700 | [diff] [blame] | 382 | ATRACE_FORMAT_INSTANT("Max (can't resolve refresh rate)"); |
Ady Abraham | a6b676e | 2020-05-27 14:29:09 -0700 | [diff] [blame] | 383 | ALOGV("%s Max (can't resolve refresh rate)", mName.c_str()); |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 384 | votes.push_back({LayerHistory::LayerVoteType::Max, Fps()}); |
| 385 | return votes; |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 386 | } |
| 387 | |
Dominik Laskowski | f5d0ea5 | 2021-09-26 17:27:01 -0700 | [diff] [blame] | 388 | const char* LayerInfo::getTraceTag(LayerHistory::LayerVoteType type) const { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 389 | if (mTraceTags.count(type) == 0) { |
Dominik Laskowski | f5d0ea5 | 2021-09-26 17:27:01 -0700 | [diff] [blame] | 390 | auto tag = "LFPS " + mName + " " + ftl::enum_string(type); |
| 391 | mTraceTags.emplace(type, std::move(tag)); |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | return mTraceTags.at(type).c_str(); |
| 395 | } |
| 396 | |
Vishnu Nair | ef68d6d | 2023-02-28 06:18:27 +0000 | [diff] [blame] | 397 | LayerInfo::FrameRate LayerInfo::getSetFrameRateVote() const { |
| 398 | return mLayerProps->setFrameRateVote; |
| 399 | } |
| 400 | |
| 401 | bool LayerInfo::isVisible() const { |
| 402 | return mLayerProps->visible; |
| 403 | } |
| 404 | |
| 405 | int32_t LayerInfo::getFrameRateSelectionPriority() const { |
| 406 | return mLayerProps->frameRateSelectionPriority; |
| 407 | } |
| 408 | |
Alec Mouri | 89f5d4e | 2023-10-20 17:12:49 +0000 | [diff] [blame] | 409 | bool LayerInfo::isFrontBuffered() const { |
| 410 | return mLayerProps->isFrontBuffered; |
| 411 | } |
| 412 | |
Vishnu Nair | ef68d6d | 2023-02-28 06:18:27 +0000 | [diff] [blame] | 413 | FloatRect LayerInfo::getBounds() const { |
| 414 | return mLayerProps->bounds; |
| 415 | } |
| 416 | |
| 417 | ui::Transform LayerInfo::getTransform() const { |
| 418 | return mLayerProps->transform; |
| 419 | } |
| 420 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 421 | LayerInfo::RefreshRateHistory::HeuristicTraceTagData |
| 422 | LayerInfo::RefreshRateHistory::makeHeuristicTraceTagData() const { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 423 | const std::string prefix = "LFPS "; |
| 424 | const std::string suffix = "Heuristic "; |
| 425 | return {.min = prefix + mName + suffix + "min", |
| 426 | .max = prefix + mName + suffix + "max", |
| 427 | .consistent = prefix + mName + suffix + "consistent", |
| 428 | .average = prefix + mName + suffix + "average"}; |
| 429 | } |
| 430 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 431 | void LayerInfo::RefreshRateHistory::clear() { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 432 | mRefreshRates.clear(); |
| 433 | } |
| 434 | |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 435 | bool LayerInfo::RefreshRateHistory::add(Fps refreshRate, nsecs_t now) { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 436 | mRefreshRates.push_back({refreshRate, now}); |
| 437 | while (mRefreshRates.size() >= HISTORY_SIZE || |
| 438 | now - mRefreshRates.front().timestamp > HISTORY_DURATION.count()) { |
| 439 | mRefreshRates.pop_front(); |
| 440 | } |
| 441 | |
| 442 | if (CC_UNLIKELY(sTraceEnabled)) { |
| 443 | if (!mHeuristicTraceTagData.has_value()) { |
| 444 | mHeuristicTraceTagData = makeHeuristicTraceTagData(); |
| 445 | } |
| 446 | |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 447 | ATRACE_INT(mHeuristicTraceTagData->average.c_str(), refreshRate.getIntValue()); |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | return isConsistent(); |
| 451 | } |
| 452 | |
Marin Shalamanov | 1bc43ee | 2020-11-20 16:56:52 +0100 | [diff] [blame] | 453 | bool LayerInfo::RefreshRateHistory::isConsistent() const { |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 454 | if (mRefreshRates.empty()) return true; |
| 455 | |
Dominik Laskowski | 6eab42d | 2021-09-13 14:34:13 -0700 | [diff] [blame] | 456 | const auto [min, max] = |
| 457 | std::minmax_element(mRefreshRates.begin(), mRefreshRates.end(), |
| 458 | [](const auto& lhs, const auto& rhs) { |
| 459 | return isStrictlyLess(lhs.refreshRate, rhs.refreshRate); |
| 460 | }); |
| 461 | |
| 462 | const bool consistent = |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 463 | max->refreshRate.getValue() - min->refreshRate.getValue() < MARGIN_CONSISTENT_FPS; |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 464 | |
| 465 | if (CC_UNLIKELY(sTraceEnabled)) { |
| 466 | if (!mHeuristicTraceTagData.has_value()) { |
| 467 | mHeuristicTraceTagData = makeHeuristicTraceTagData(); |
| 468 | } |
| 469 | |
Marin Shalamanov | e8a663d | 2020-11-24 17:48:00 +0100 | [diff] [blame] | 470 | ATRACE_INT(mHeuristicTraceTagData->max.c_str(), max->refreshRate.getIntValue()); |
| 471 | ATRACE_INT(mHeuristicTraceTagData->min.c_str(), min->refreshRate.getIntValue()); |
Ady Abraham | 0ccd79b | 2020-06-10 10:11:17 -0700 | [diff] [blame] | 472 | ATRACE_INT(mHeuristicTraceTagData->consistent.c_str(), consistent); |
| 473 | } |
| 474 | |
| 475 | return consistent; |
| 476 | } |
| 477 | |
Vishnu Nair | 3fbe326 | 2023-09-29 17:07:00 -0700 | [diff] [blame] | 478 | FrameRateCompatibility LayerInfo::FrameRate::convertCompatibility(int8_t compatibility) { |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 479 | switch (compatibility) { |
| 480 | case ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT: |
| 481 | return FrameRateCompatibility::Default; |
| 482 | case ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE: |
| 483 | return FrameRateCompatibility::ExactOrMultiple; |
| 484 | case ANATIVEWINDOW_FRAME_RATE_EXACT: |
| 485 | return FrameRateCompatibility::Exact; |
| 486 | case ANATIVEWINDOW_FRAME_RATE_MIN: |
| 487 | return FrameRateCompatibility::Min; |
| 488 | case ANATIVEWINDOW_FRAME_RATE_NO_VOTE: |
| 489 | return FrameRateCompatibility::NoVote; |
| 490 | default: |
| 491 | LOG_ALWAYS_FATAL("Invalid frame rate compatibility value %d", compatibility); |
| 492 | return FrameRateCompatibility::Default; |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | Seamlessness LayerInfo::FrameRate::convertChangeFrameRateStrategy(int8_t strategy) { |
| 497 | switch (strategy) { |
| 498 | case ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS: |
| 499 | return Seamlessness::OnlySeamless; |
| 500 | case ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS: |
| 501 | return Seamlessness::SeamedAndSeamless; |
| 502 | default: |
| 503 | LOG_ALWAYS_FATAL("Invalid change frame sate strategy value %d", strategy); |
| 504 | return Seamlessness::Default; |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | FrameRateCategory LayerInfo::FrameRate::convertCategory(int8_t category) { |
| 509 | switch (category) { |
| 510 | case ANATIVEWINDOW_FRAME_RATE_CATEGORY_DEFAULT: |
| 511 | return FrameRateCategory::Default; |
| 512 | case ANATIVEWINDOW_FRAME_RATE_CATEGORY_NO_PREFERENCE: |
| 513 | return FrameRateCategory::NoPreference; |
| 514 | case ANATIVEWINDOW_FRAME_RATE_CATEGORY_LOW: |
| 515 | return FrameRateCategory::Low; |
| 516 | case ANATIVEWINDOW_FRAME_RATE_CATEGORY_NORMAL: |
| 517 | return FrameRateCategory::Normal; |
| 518 | case ANATIVEWINDOW_FRAME_RATE_CATEGORY_HIGH: |
| 519 | return FrameRateCategory::High; |
| 520 | default: |
| 521 | LOG_ALWAYS_FATAL("Invalid frame rate category value %d", category); |
| 522 | return FrameRateCategory::Default; |
| 523 | } |
| 524 | } |
| 525 | |
Rachel Lee | 58cc90d | 2023-09-05 18:50:20 -0700 | [diff] [blame] | 526 | LayerInfo::FrameRateSelectionStrategy LayerInfo::convertFrameRateSelectionStrategy( |
| 527 | int8_t strategy) { |
| 528 | switch (strategy) { |
| 529 | case ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_SELF: |
| 530 | return FrameRateSelectionStrategy::Self; |
| 531 | case ANATIVEWINDOW_FRAME_RATE_SELECTION_STRATEGY_OVERRIDE_CHILDREN: |
| 532 | return FrameRateSelectionStrategy::OverrideChildren; |
| 533 | default: |
| 534 | LOG_ALWAYS_FATAL("Invalid frame rate selection strategy value %d", strategy); |
| 535 | return FrameRateSelectionStrategy::Self; |
| 536 | } |
| 537 | } |
| 538 | |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 539 | bool LayerInfo::FrameRate::isNoVote() const { |
Rachel Lee | d0694bc | 2023-09-12 14:57:58 -0700 | [diff] [blame] | 540 | return vote.type == FrameRateCompatibility::NoVote; |
Rachel Lee | ce6e004 | 2023-06-27 11:22:54 -0700 | [diff] [blame] | 541 | } |
| 542 | |
| 543 | bool LayerInfo::FrameRate::isValid() const { |
| 544 | return isNoVote() || vote.rate.isValid() || category != FrameRateCategory::Default; |
| 545 | } |
| 546 | |
| 547 | std::ostream& operator<<(std::ostream& stream, const LayerInfo::FrameRate& rate) { |
| 548 | return stream << "{rate=" << rate.vote.rate << " type=" << ftl::enum_string(rate.vote.type) |
| 549 | << " seamlessness=" << ftl::enum_string(rate.vote.seamlessness) << '}'; |
| 550 | } |
| 551 | |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 552 | } // namespace android::scheduler |
Marin Shalamanov | bed7fd3 | 2020-12-21 20:02:20 +0100 | [diff] [blame] | 553 | |
| 554 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
Dominik Laskowski | 6eab42d | 2021-09-13 14:34:13 -0700 | [diff] [blame] | 555 | #pragma clang diagnostic pop // ignored "-Wextra" |