blob: 0142ccd93f570605017672eb1092c46778cd29c4 [file] [log] [blame]
Ady Abraham8a82ba62020-01-17 12:43:17 -08001/*
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 Shalamanovbed7fd32020-12-21 20:02:20 +010017// TODO(b/129481165): remove the #pragma below and fix conversion issues
18#pragma clang diagnostic push
19#pragma clang diagnostic ignored "-Wextra"
20
Ady Abraham8a82ba62020-01-17 12:43:17 -080021// #define LOG_NDEBUG 0
Ady Abraham0ccd79b2020-06-10 10:11:17 -070022#define ATRACE_TAG ATRACE_TAG_GRAPHICS
Ady Abraham8a82ba62020-01-17 12:43:17 -080023
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +010024#include "LayerInfo.h"
Ady Abraham8a82ba62020-01-17 12:43:17 -080025
26#include <algorithm>
27#include <utility>
28
Ady Abraham0ccd79b2020-06-10 10:11:17 -070029#include <cutils/compiler.h>
30#include <cutils/trace.h>
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -070031#include <ftl/enum.h>
Ady Abraham73c3df52023-01-12 18:09:31 -080032#include <gui/TraceUtils.h>
Ady Abraham0ccd79b2020-06-10 10:11:17 -070033
Ady Abraham8a82ba62020-01-17 12:43:17 -080034#undef LOG_TAG
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +010035#define LOG_TAG "LayerInfo"
Ady Abraham8a82ba62020-01-17 12:43:17 -080036
37namespace android::scheduler {
38
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +010039bool LayerInfo::sTraceEnabled = false;
Ady Abrahamb1b9d412020-06-01 19:53:52 -070040
Ady Abrahambdda8f02021-04-01 16:06:11 -070041LayerInfo::LayerInfo(const std::string& name, uid_t ownerUid,
42 LayerHistory::LayerVoteType defaultVote)
Ady Abrahama6b676e2020-05-27 14:29:09 -070043 : mName(name),
Ady Abrahambdda8f02021-04-01 16:06:11 -070044 mOwnerUid(ownerUid),
Ady Abraham8a82ba62020-01-17 12:43:17 -080045 mDefaultVote(defaultVote),
Dominik Laskowski6eab42d2021-09-13 14:34:13 -070046 mLayerVote({defaultVote, Fps()}),
Ady Abraham0ccd79b2020-06-10 10:11:17 -070047 mRefreshRateHistory(name) {}
Ady Abraham8a82ba62020-01-17 12:43:17 -080048
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +010049void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now, LayerUpdateType updateType,
Ady Abrahambdda8f02021-04-01 16:06:11 -070050 bool pendingModeChange, LayerProps props) {
Ady Abraham8a82ba62020-01-17 12:43:17 -080051 lastPresentTime = std::max(lastPresentTime, static_cast<nsecs_t>(0));
52
53 mLastUpdatedTime = std::max(lastPresentTime, now);
Ady Abrahambdda8f02021-04-01 16:06:11 -070054 mLayerProps = props;
Ady Abraham5def7332020-05-29 16:13:47 -070055 switch (updateType) {
56 case LayerUpdateType::AnimationTX:
57 mLastAnimationTime = std::max(lastPresentTime, now);
58 break;
59 case LayerUpdateType::SetFrameRate:
60 case LayerUpdateType::Buffer:
Marin Shalamanov2045d5b2020-12-28 18:11:41 +010061 FrameTimeData frameTime = {.presentTime = lastPresentTime,
Ady Abraham5def7332020-05-29 16:13:47 -070062 .queueTime = mLastUpdatedTime,
Marin Shalamanova7fe3042021-01-29 21:02:08 +010063 .pendingModeChange = pendingModeChange};
Ady Abraham5def7332020-05-29 16:13:47 -070064 mFrameTimes.push_back(frameTime);
65 if (mFrameTimes.size() > HISTORY_SIZE) {
66 mFrameTimes.pop_front();
67 }
68 break;
Ady Abraham8a82ba62020-01-17 12:43:17 -080069 }
70}
71
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +010072bool LayerInfo::isFrameTimeValid(const FrameTimeData& frameTime) const {
Ady Abrahamdfb63ba2020-05-27 20:05:05 +000073 return frameTime.queueTime >= std::chrono::duration_cast<std::chrono::nanoseconds>(
74 mFrameTimeValidSince.time_since_epoch())
75 .count();
76}
Ady Abraham1adbb722020-05-15 11:51:48 -070077
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +010078bool LayerInfo::isFrequent(nsecs_t now) const {
Nathaniel Nifong1303d912021-10-06 09:41:24 -040079 using fps_approx_ops::operator>=;
Ady Abraham86ac5c52023-01-11 15:24:03 -080080 // If we know nothing about this layer (e.g. after touch event),
81 // we consider it as frequent as it might be the start of an animation.
Marin Shalamanov2045d5b2020-12-28 18:11:41 +010082 if (mFrameTimes.size() < kFrequentLayerWindowSize) {
Ady Abrahamdfb63ba2020-05-27 20:05:05 +000083 return true;
84 }
Ady Abraham86ac5c52023-01-11 15:24:03 -080085
86 // Non-active layers are also infrequent
87 if (mLastUpdatedTime < getActiveLayerThreshold(now)) {
88 return false;
89 }
90
91 // We check whether we can classify this layer as frequent or infrequent:
92 // - frequent: a layer posted kFrequentLayerWindowSize within
93 // kMaxPeriodForFrequentLayerNs of each other.
94 // - infrequent: a layer posted kFrequentLayerWindowSize with longer
95 // gaps than kFrequentLayerWindowSize.
96 // If we can't determine the layer classification yet, we return the last
97 // classification.
98 bool isFrequent = true;
99 bool isInfrequent = true;
100 const auto n = mFrameTimes.size() - 1;
101 for (size_t i = 0; i < kFrequentLayerWindowSize - 1; i++) {
102 if (mFrameTimes[n - i].queueTime - mFrameTimes[n - i - 1].queueTime <
103 kMaxPeriodForFrequentLayerNs.count()) {
104 isInfrequent = false;
105 } else {
106 isFrequent = false;
107 }
108 }
109
110 if (isFrequent || isInfrequent) {
111 return isFrequent;
112 }
113
114 // If we can't determine whether the layer is frequent or not, we return
115 // the last known classification.
116 return !mLastRefreshRate.infrequent;
Nathaniel Nifong1303d912021-10-06 09:41:24 -0400117}
Ady Abrahamdfb63ba2020-05-27 20:05:05 +0000118
Nathaniel Nifong1303d912021-10-06 09:41:24 -0400119Fps LayerInfo::getFps(nsecs_t now) const {
Ady Abrahamdfb63ba2020-05-27 20:05:05 +0000120 // Find the first active frame
Ady Abraham983e5682020-05-28 16:49:18 -0700121 auto it = mFrameTimes.begin();
Ady Abrahamdfb63ba2020-05-27 20:05:05 +0000122 for (; it != mFrameTimes.end(); ++it) {
123 if (it->queueTime >= getActiveLayerThreshold(now)) {
124 break;
125 }
126 }
127
128 const auto numFrames = std::distance(it, mFrameTimes.end());
Marin Shalamanov2045d5b2020-12-28 18:11:41 +0100129 if (numFrames < kFrequentLayerWindowSize) {
Nathaniel Nifong1303d912021-10-06 09:41:24 -0400130 return Fps();
Ady Abrahamdfb63ba2020-05-27 20:05:05 +0000131 }
132
133 // Layer is considered frequent if the average frame rate is higher than the threshold
134 const auto totalTime = mFrameTimes.back().queueTime - it->queueTime;
Nathaniel Nifong1303d912021-10-06 09:41:24 -0400135 return Fps::fromPeriodNsecs(totalTime / (numFrames - 1));
Ady Abraham8a82ba62020-01-17 12:43:17 -0800136}
137
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100138bool LayerInfo::isAnimating(nsecs_t now) const {
Ady Abraham5def7332020-05-29 16:13:47 -0700139 return mLastAnimationTime >= getActiveLayerThreshold(now);
140}
141
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100142bool LayerInfo::hasEnoughDataForHeuristic() const {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700143 // The layer had to publish at least HISTORY_SIZE or HISTORY_DURATION of updates
Ady Abrahama61edcb2020-01-30 18:32:03 -0800144 if (mFrameTimes.size() < 2) {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700145 ALOGV("fewer than 2 frames recorded: %zu", mFrameTimes.size());
Ady Abrahama61edcb2020-01-30 18:32:03 -0800146 return false;
147 }
148
Ady Abrahamdfb63ba2020-05-27 20:05:05 +0000149 if (!isFrameTimeValid(mFrameTimes.front())) {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700150 ALOGV("stale frames still captured");
Ady Abrahamdfb63ba2020-05-27 20:05:05 +0000151 return false;
152 }
153
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700154 const auto totalDuration = mFrameTimes.back().queueTime - mFrameTimes.front().queueTime;
155 if (mFrameTimes.size() < HISTORY_SIZE && totalDuration < HISTORY_DURATION.count()) {
156 ALOGV("not enough frames captured: %zu | %.2f seconds", mFrameTimes.size(),
157 totalDuration / 1e9f);
Ady Abraham8a82ba62020-01-17 12:43:17 -0800158 return false;
159 }
160
161 return true;
162}
163
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100164std::optional<nsecs_t> LayerInfo::calculateAverageFrameTime() const {
Marin Shalamanova7fe3042021-01-29 21:02:08 +0100165 // Ignore frames captured during a mode change
166 const bool isDuringModeChange =
Marin Shalamanov2045d5b2020-12-28 18:11:41 +0100167 std::any_of(mFrameTimes.begin(), mFrameTimes.end(),
Marin Shalamanova7fe3042021-01-29 21:02:08 +0100168 [](const auto& frame) { return frame.pendingModeChange; });
169 if (isDuringModeChange) {
Marin Shalamanov2045d5b2020-12-28 18:11:41 +0100170 return std::nullopt;
171 }
Ady Abraham32efd542020-05-19 17:49:26 -0700172
Marin Shalamanov2045d5b2020-12-28 18:11:41 +0100173 const bool isMissingPresentTime =
174 std::any_of(mFrameTimes.begin(), mFrameTimes.end(),
175 [](auto frame) { return frame.presentTime == 0; });
176 if (isMissingPresentTime && !mLastRefreshRate.reported.isValid()) {
177 // If there are no presentation timestamps and we haven't calculated
178 // one in the past then we can't calculate the refresh rate
179 return std::nullopt;
Ady Abraham8a82ba62020-01-17 12:43:17 -0800180 }
Ady Abrahamc9664832020-05-12 14:16:56 -0700181
Ady Abrahamc9664832020-05-12 14:16:56 -0700182 // Calculate the average frame time based on presentation timestamps. If those
183 // doesn't exist, we look at the time the buffer was queued only. We can do that only if
184 // we calculated a refresh rate based on presentation timestamps in the past. The reason
185 // we look at the queue time is to handle cases where hwui attaches presentation timestamps
186 // when implementing render ahead for specific refresh rates. When hwui no longer provides
187 // presentation timestamps we look at the queue time to see if the current refresh rate still
188 // matches the content.
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700189
Marin Shalamanov2045d5b2020-12-28 18:11:41 +0100190 auto getFrameTime = isMissingPresentTime ? [](FrameTimeData data) { return data.queueTime; }
191 : [](FrameTimeData data) { return data.presentTime; };
192
193 nsecs_t totalDeltas = 0;
194 int numDeltas = 0;
195 auto prevFrame = mFrameTimes.begin();
196 for (auto it = mFrameTimes.begin() + 1; it != mFrameTimes.end(); ++it) {
197 const auto currDelta = getFrameTime(*it) - getFrameTime(*prevFrame);
198 if (currDelta < kMinPeriodBetweenFrames) {
199 // Skip this frame, but count the delta into the next frame
200 continue;
201 }
202
203 prevFrame = it;
204
205 if (currDelta > kMaxPeriodBetweenFrames) {
206 // Skip this frame and the current delta.
207 continue;
208 }
209
210 totalDeltas += currDelta;
211 numDeltas++;
212 }
213
214 if (numDeltas == 0) {
215 return std::nullopt;
216 }
217
218 const auto averageFrameTime = static_cast<double>(totalDeltas) / static_cast<double>(numDeltas);
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700219 return static_cast<nsecs_t>(averageFrameTime);
Ady Abraham32efd542020-05-19 17:49:26 -0700220}
Ady Abraham8a82ba62020-01-17 12:43:17 -0800221
Dominik Laskowskid82e0f02022-10-26 15:23:04 -0400222std::optional<Fps> LayerInfo::calculateRefreshRateIfPossible(const RefreshRateSelector& selector,
223 nsecs_t now) {
Ady Abraham73c3df52023-01-12 18:09:31 -0800224 ATRACE_CALL();
Ady Abraham32efd542020-05-19 17:49:26 -0700225 static constexpr float MARGIN = 1.0f; // 1Hz
Ady Abraham32efd542020-05-19 17:49:26 -0700226 if (!hasEnoughDataForHeuristic()) {
227 ALOGV("Not enough data");
228 return std::nullopt;
229 }
230
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700231 if (const auto averageFrameTime = calculateAverageFrameTime()) {
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100232 const auto refreshRate = Fps::fromPeriodNsecs(*averageFrameTime);
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700233 const bool refreshRateConsistent = mRefreshRateHistory.add(refreshRate, now);
234 if (refreshRateConsistent) {
Dominik Laskowskid82e0f02022-10-26 15:23:04 -0400235 const auto knownRefreshRate = selector.findClosestKnownFrameRate(refreshRate);
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700236 using fps_approx_ops::operator!=;
237
238 // To avoid oscillation, use the last calculated refresh rate if it is close enough.
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100239 if (std::abs(mLastRefreshRate.calculated.getValue() - refreshRate.getValue()) >
240 MARGIN &&
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700241 mLastRefreshRate.reported != knownRefreshRate) {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700242 mLastRefreshRate.calculated = refreshRate;
243 mLastRefreshRate.reported = knownRefreshRate;
244 }
245
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100246 ALOGV("%s %s rounded to nearest known frame rate %s", mName.c_str(),
247 to_string(refreshRate).c_str(), to_string(mLastRefreshRate.reported).c_str());
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700248 } else {
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100249 ALOGV("%s Not stable (%s) returning last known frame rate %s", mName.c_str(),
250 to_string(refreshRate).c_str(), to_string(mLastRefreshRate.reported).c_str());
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700251 }
Ady Abraham32efd542020-05-19 17:49:26 -0700252 }
253
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100254 return mLastRefreshRate.reported.isValid() ? std::make_optional(mLastRefreshRate.reported)
255 : std::nullopt;
Ady Abraham8a82ba62020-01-17 12:43:17 -0800256}
257
Dominik Laskowskid82e0f02022-10-26 15:23:04 -0400258LayerInfo::LayerVote LayerInfo::getRefreshRateVote(const RefreshRateSelector& selector,
Ady Abraham3efa3942021-06-24 19:01:25 -0700259 nsecs_t now) {
Ady Abraham73c3df52023-01-12 18:09:31 -0800260 ATRACE_CALL();
Ady Abraham8a82ba62020-01-17 12:43:17 -0800261 if (mLayerVote.type != LayerHistory::LayerVoteType::Heuristic) {
Ady Abrahama6b676e2020-05-27 14:29:09 -0700262 ALOGV("%s voted %d ", mName.c_str(), static_cast<int>(mLayerVote.type));
Marin Shalamanov46084422020-10-13 12:33:42 +0200263 return mLayerVote;
Ady Abraham8a82ba62020-01-17 12:43:17 -0800264 }
265
Ady Abraham5def7332020-05-29 16:13:47 -0700266 if (isAnimating(now)) {
Ady Abraham73c3df52023-01-12 18:09:31 -0800267 ATRACE_FORMAT_INSTANT("animating");
Ady Abraham5def7332020-05-29 16:13:47 -0700268 ALOGV("%s is animating", mName.c_str());
Ady Abraham86ac5c52023-01-11 15:24:03 -0800269 mLastRefreshRate.animating = true;
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700270 return {LayerHistory::LayerVoteType::Max, Fps()};
Ady Abraham5def7332020-05-29 16:13:47 -0700271 }
272
Ady Abraham8a82ba62020-01-17 12:43:17 -0800273 if (!isFrequent(now)) {
Ady Abraham73c3df52023-01-12 18:09:31 -0800274 ATRACE_FORMAT_INSTANT("infrequent");
Ady Abrahama6b676e2020-05-27 14:29:09 -0700275 ALOGV("%s is infrequent", mName.c_str());
Ady Abraham86ac5c52023-01-11 15:24:03 -0800276 mLastRefreshRate.infrequent = true;
Nathaniel Nifong1303d912021-10-06 09:41:24 -0400277 // Infrequent layers vote for mininal refresh rate for
Marin Shalamanov29e25402021-04-07 21:09:58 +0200278 // battery saving purposes and also to prevent b/135718869.
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700279 return {LayerHistory::LayerVoteType::Min, Fps()};
Ady Abraham8a82ba62020-01-17 12:43:17 -0800280 }
281
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700282 // If the layer was previously tagged as animating or infrequent, we clear
283 // the history as it is likely the layer just changed its behavior
284 // and we should not look at stale data
Ady Abraham86ac5c52023-01-11 15:24:03 -0800285 if (mLastRefreshRate.animating || mLastRefreshRate.infrequent) {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700286 clearHistory(now);
287 }
288
Dominik Laskowskid82e0f02022-10-26 15:23:04 -0400289 auto refreshRate = calculateRefreshRateIfPossible(selector, now);
Ady Abraham8a82ba62020-01-17 12:43:17 -0800290 if (refreshRate.has_value()) {
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100291 ALOGV("%s calculated refresh rate: %s", mName.c_str(), to_string(*refreshRate).c_str());
Ady Abraham8a82ba62020-01-17 12:43:17 -0800292 return {LayerHistory::LayerVoteType::Heuristic, refreshRate.value()};
293 }
294
Ady Abrahama6b676e2020-05-27 14:29:09 -0700295 ALOGV("%s Max (can't resolve refresh rate)", mName.c_str());
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700296 return {LayerHistory::LayerVoteType::Max, Fps()};
Ady Abraham8a82ba62020-01-17 12:43:17 -0800297}
298
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700299const char* LayerInfo::getTraceTag(LayerHistory::LayerVoteType type) const {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700300 if (mTraceTags.count(type) == 0) {
Dominik Laskowskif5d0ea52021-09-26 17:27:01 -0700301 auto tag = "LFPS " + mName + " " + ftl::enum_string(type);
302 mTraceTags.emplace(type, std::move(tag));
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700303 }
304
305 return mTraceTags.at(type).c_str();
306}
307
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100308LayerInfo::RefreshRateHistory::HeuristicTraceTagData
309LayerInfo::RefreshRateHistory::makeHeuristicTraceTagData() const {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700310 const std::string prefix = "LFPS ";
311 const std::string suffix = "Heuristic ";
312 return {.min = prefix + mName + suffix + "min",
313 .max = prefix + mName + suffix + "max",
314 .consistent = prefix + mName + suffix + "consistent",
315 .average = prefix + mName + suffix + "average"};
316}
317
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100318void LayerInfo::RefreshRateHistory::clear() {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700319 mRefreshRates.clear();
320}
321
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100322bool LayerInfo::RefreshRateHistory::add(Fps refreshRate, nsecs_t now) {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700323 mRefreshRates.push_back({refreshRate, now});
324 while (mRefreshRates.size() >= HISTORY_SIZE ||
325 now - mRefreshRates.front().timestamp > HISTORY_DURATION.count()) {
326 mRefreshRates.pop_front();
327 }
328
329 if (CC_UNLIKELY(sTraceEnabled)) {
330 if (!mHeuristicTraceTagData.has_value()) {
331 mHeuristicTraceTagData = makeHeuristicTraceTagData();
332 }
333
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100334 ATRACE_INT(mHeuristicTraceTagData->average.c_str(), refreshRate.getIntValue());
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700335 }
336
337 return isConsistent();
338}
339
Marin Shalamanov1bc43ee2020-11-20 16:56:52 +0100340bool LayerInfo::RefreshRateHistory::isConsistent() const {
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700341 if (mRefreshRates.empty()) return true;
342
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700343 const auto [min, max] =
344 std::minmax_element(mRefreshRates.begin(), mRefreshRates.end(),
345 [](const auto& lhs, const auto& rhs) {
346 return isStrictlyLess(lhs.refreshRate, rhs.refreshRate);
347 });
348
349 const bool consistent =
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100350 max->refreshRate.getValue() - min->refreshRate.getValue() < MARGIN_CONSISTENT_FPS;
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700351
352 if (CC_UNLIKELY(sTraceEnabled)) {
353 if (!mHeuristicTraceTagData.has_value()) {
354 mHeuristicTraceTagData = makeHeuristicTraceTagData();
355 }
356
Marin Shalamanove8a663d2020-11-24 17:48:00 +0100357 ATRACE_INT(mHeuristicTraceTagData->max.c_str(), max->refreshRate.getIntValue());
358 ATRACE_INT(mHeuristicTraceTagData->min.c_str(), min->refreshRate.getIntValue());
Ady Abraham0ccd79b2020-06-10 10:11:17 -0700359 ATRACE_INT(mHeuristicTraceTagData->consistent.c_str(), consistent);
360 }
361
362 return consistent;
363}
364
Ady Abraham8a82ba62020-01-17 12:43:17 -0800365} // namespace android::scheduler
Marin Shalamanovbed7fd32020-12-21 20:02:20 +0100366
367// TODO(b/129481165): remove the #pragma below and fix conversion issues
Dominik Laskowski6eab42d2021-09-13 14:34:13 -0700368#pragma clang diagnostic pop // ignored "-Wextra"