Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 | |
Kevin DuBois | 5988f48 | 2020-01-17 09:03:32 -0800 | [diff] [blame] | 17 | #define ATRACE_TAG ATRACE_TAG_GRAPHICS |
Kevin DuBois | c94ca83 | 2019-11-26 12:56:24 -0800 | [diff] [blame] | 18 | #undef LOG_TAG |
| 19 | #define LOG_TAG "VSyncReactor" |
Kevin DuBois | f91e923 | 2019-11-21 10:51:23 -0800 | [diff] [blame] | 20 | //#define LOG_NDEBUG 0 |
Dominik Laskowski | 4e0d20d | 2021-12-06 11:31:02 -0800 | [diff] [blame] | 21 | |
Ryan Prichard | 430dde3 | 2022-08-30 17:08:20 -0700 | [diff] [blame] | 22 | #include <assert.h> |
Ady Abraham | 13bc0be | 2020-02-27 16:48:20 -0800 | [diff] [blame] | 23 | #include <cutils/properties.h> |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 24 | #include <gui/TraceUtils.h> |
Kevin DuBois | f91e923 | 2019-11-21 10:51:23 -0800 | [diff] [blame] | 25 | #include <log/log.h> |
Kevin DuBois | 5988f48 | 2020-01-17 09:03:32 -0800 | [diff] [blame] | 26 | #include <utils/Trace.h> |
Dominik Laskowski | 4e0d20d | 2021-12-06 11:31:02 -0800 | [diff] [blame] | 27 | |
Ady Abraham | 13bc0be | 2020-02-27 16:48:20 -0800 | [diff] [blame] | 28 | #include "../TracedOrdinal.h" |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 29 | #include "VSyncDispatch.h" |
Dominik Laskowski | 4e0d20d | 2021-12-06 11:31:02 -0800 | [diff] [blame] | 30 | #include "VSyncReactor.h" |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 31 | #include "VSyncTracker.h" |
| 32 | |
| 33 | namespace android::scheduler { |
Dominik Laskowski | 4e0d20d | 2021-12-06 11:31:02 -0800 | [diff] [blame] | 34 | |
Ady Abraham | 5e7371c | 2020-03-24 14:47:24 -0700 | [diff] [blame] | 35 | using base::StringAppendF; |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 36 | using base::StringPrintf; |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 37 | |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 38 | VsyncController::~VsyncController() = default; |
| 39 | |
Kevin DuBois | 0028738 | 2019-11-19 15:11:55 -0800 | [diff] [blame] | 40 | nsecs_t SystemClock::now() const { |
| 41 | return systemTime(SYSTEM_TIME_MONOTONIC); |
| 42 | } |
Kevin DuBois | 2fd3cea | 2019-11-14 08:52:45 -0800 | [diff] [blame] | 43 | |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 44 | VSyncReactor::VSyncReactor(std::string name, std::unique_ptr<Clock> clock, VSyncTracker& tracker, |
Ady Abraham | 8735eac | 2020-08-12 16:35:04 -0700 | [diff] [blame] | 45 | size_t pendingFenceLimit, bool supportKernelIdleTimer) |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 46 | : mName(name), |
| 47 | mClock(std::move(clock)), |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 48 | mTracker(tracker), |
Ady Abraham | 13bc0be | 2020-02-27 16:48:20 -0800 | [diff] [blame] | 49 | mPendingLimit(pendingFenceLimit), |
Dan Stoza | 027d365 | 2020-05-26 17:26:34 -0700 | [diff] [blame] | 50 | mSupportKernelIdleTimer(supportKernelIdleTimer) {} |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 51 | |
Kevin DuBois | f91e923 | 2019-11-21 10:51:23 -0800 | [diff] [blame] | 52 | VSyncReactor::~VSyncReactor() = default; |
| 53 | |
Dominik Laskowski | 068173d | 2021-08-11 17:22:59 -0700 | [diff] [blame] | 54 | bool VSyncReactor::addPresentFence(std::shared_ptr<FenceTime> fence) { |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 55 | if (!fence) { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | nsecs_t const signalTime = fence->getCachedSignalTime(); |
| 60 | if (signalTime == Fence::SIGNAL_TIME_INVALID) { |
| 61 | return true; |
| 62 | } |
| 63 | |
Ady Abraham | 9c53ee7 | 2020-07-22 21:16:18 -0700 | [diff] [blame] | 64 | std::lock_guard lock(mMutex); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 65 | if (mExternalIgnoreFences || mInternalIgnoreFences) { |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 66 | return true; |
| 67 | } |
| 68 | |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 69 | bool timestampAccepted = true; |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 70 | for (auto it = mUnfiredFences.begin(); it != mUnfiredFences.end();) { |
| 71 | auto const time = (*it)->getCachedSignalTime(); |
| 72 | if (time == Fence::SIGNAL_TIME_PENDING) { |
| 73 | it++; |
| 74 | } else if (time == Fence::SIGNAL_TIME_INVALID) { |
| 75 | it = mUnfiredFences.erase(it); |
| 76 | } else { |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 77 | timestampAccepted &= mTracker.addVsyncTimestamp(time); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 78 | |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 79 | it = mUnfiredFences.erase(it); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | if (signalTime == Fence::SIGNAL_TIME_PENDING) { |
| 84 | if (mPendingLimit == mUnfiredFences.size()) { |
| 85 | mUnfiredFences.erase(mUnfiredFences.begin()); |
| 86 | } |
Dominik Laskowski | 068173d | 2021-08-11 17:22:59 -0700 | [diff] [blame] | 87 | mUnfiredFences.push_back(std::move(fence)); |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 88 | } else { |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 89 | timestampAccepted &= mTracker.addVsyncTimestamp(signalTime); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | if (!timestampAccepted) { |
| 93 | mMoreSamplesNeeded = true; |
| 94 | setIgnorePresentFencesInternal(true); |
| 95 | mPeriodConfirmationInProgress = true; |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 96 | } |
| 97 | |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 98 | return mMoreSamplesNeeded; |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 99 | } |
| 100 | |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 101 | void VSyncReactor::setIgnorePresentFences(bool ignore) { |
Ady Abraham | 9c53ee7 | 2020-07-22 21:16:18 -0700 | [diff] [blame] | 102 | std::lock_guard lock(mMutex); |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 103 | mExternalIgnoreFences = ignore; |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 104 | updateIgnorePresentFencesInternal(); |
| 105 | } |
| 106 | |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 107 | void VSyncReactor::setIgnorePresentFencesInternal(bool ignore) { |
| 108 | mInternalIgnoreFences = ignore; |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 109 | updateIgnorePresentFencesInternal(); |
| 110 | } |
| 111 | |
| 112 | void VSyncReactor::updateIgnorePresentFencesInternal() { |
| 113 | if (mExternalIgnoreFences || mInternalIgnoreFences) { |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 114 | mUnfiredFences.clear(); |
| 115 | } |
| 116 | } |
| 117 | |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 118 | void VSyncReactor::startPeriodTransitionInternal(nsecs_t newPeriod) { |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 119 | ATRACE_FORMAT("%s %s", __func__, mName.c_str()); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 120 | mPeriodConfirmationInProgress = true; |
Kevin DuBois | c4cdd37 | 2020-01-09 14:12:02 -0800 | [diff] [blame] | 121 | mPeriodTransitioningTo = newPeriod; |
| 122 | mMoreSamplesNeeded = true; |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 123 | setIgnorePresentFencesInternal(true); |
Kevin DuBois | c4cdd37 | 2020-01-09 14:12:02 -0800 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | void VSyncReactor::endPeriodTransition() { |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 127 | ATRACE_FORMAT("%s %s", __func__, mName.c_str()); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 128 | mPeriodTransitioningTo.reset(); |
| 129 | mPeriodConfirmationInProgress = false; |
| 130 | mLastHwVsync.reset(); |
Kevin DuBois | c4cdd37 | 2020-01-09 14:12:02 -0800 | [diff] [blame] | 131 | } |
| 132 | |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 133 | void VSyncReactor::startPeriodTransition(nsecs_t period, bool force) { |
| 134 | // TODO (b/266817103): Pass in PhysicalDisplayId and use ftl::Concat to |
| 135 | // avoid unnecessary allocations. |
| 136 | ATRACE_INT64(StringPrintf("VSR-startPeriodTransition %s", mName.c_str()).c_str(), period); |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 137 | std::lock_guard lock(mMutex); |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 138 | mLastHwVsync.reset(); |
Dan Stoza | 027d365 | 2020-05-26 17:26:34 -0700 | [diff] [blame] | 139 | |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 140 | if (!mSupportKernelIdleTimer && period == mTracker.currentPeriod() && !force) { |
Kevin DuBois | c4cdd37 | 2020-01-09 14:12:02 -0800 | [diff] [blame] | 141 | endPeriodTransition(); |
Kevin DuBois | b818bfa | 2020-07-10 14:29:36 -0700 | [diff] [blame] | 142 | setIgnorePresentFencesInternal(false); |
| 143 | mMoreSamplesNeeded = false; |
Kevin DuBois | c4cdd37 | 2020-01-09 14:12:02 -0800 | [diff] [blame] | 144 | } else { |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 145 | startPeriodTransitionInternal(period); |
Kevin DuBois | c4cdd37 | 2020-01-09 14:12:02 -0800 | [diff] [blame] | 146 | } |
Kevin DuBois | ee2ad9f | 2019-11-21 11:10:57 -0800 | [diff] [blame] | 147 | } |
| 148 | |
Ady Abraham | 5dee2f1 | 2020-02-05 17:49:47 -0800 | [diff] [blame] | 149 | bool VSyncReactor::periodConfirmed(nsecs_t vsync_timestamp, std::optional<nsecs_t> HwcVsyncPeriod) { |
| 150 | if (!mPeriodConfirmationInProgress) { |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 151 | return false; |
| 152 | } |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 153 | |
Rachel Lee | 6a9731d | 2022-06-06 17:08:14 -0700 | [diff] [blame] | 154 | if (mDisplayPowerMode == hal::PowerMode::DOZE || |
| 155 | mDisplayPowerMode == hal::PowerMode::DOZE_SUSPEND) { |
| 156 | return true; |
| 157 | } |
| 158 | |
Ady Abraham | 5dee2f1 | 2020-02-05 17:49:47 -0800 | [diff] [blame] | 159 | if (!mLastHwVsync && !HwcVsyncPeriod) { |
| 160 | return false; |
| 161 | } |
| 162 | |
Dan Stoza | 09bf763 | 2020-06-10 14:28:50 -0700 | [diff] [blame] | 163 | const bool periodIsChanging = |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 164 | mPeriodTransitioningTo && (*mPeriodTransitioningTo != mTracker.currentPeriod()); |
Dan Stoza | 09bf763 | 2020-06-10 14:28:50 -0700 | [diff] [blame] | 165 | if (mSupportKernelIdleTimer && !periodIsChanging) { |
Dan Stoza | 027d365 | 2020-05-26 17:26:34 -0700 | [diff] [blame] | 166 | // Clear out the Composer-provided period and use the allowance logic below |
| 167 | HwcVsyncPeriod = {}; |
| 168 | } |
| 169 | |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 170 | auto const period = mPeriodTransitioningTo ? *mPeriodTransitioningTo : mTracker.currentPeriod(); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 171 | static constexpr int allowancePercent = 10; |
| 172 | static constexpr std::ratio<allowancePercent, 100> allowancePercentRatio; |
| 173 | auto const allowance = period * allowancePercentRatio.num / allowancePercentRatio.den; |
Ady Abraham | 5dee2f1 | 2020-02-05 17:49:47 -0800 | [diff] [blame] | 174 | if (HwcVsyncPeriod) { |
| 175 | return std::abs(*HwcVsyncPeriod - period) < allowance; |
| 176 | } |
| 177 | |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 178 | auto const distance = vsync_timestamp - *mLastHwVsync; |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 179 | return std::abs(distance - period) < allowance; |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 180 | } |
| 181 | |
Ady Abraham | 8cb2188 | 2020-08-26 18:22:05 -0700 | [diff] [blame] | 182 | bool VSyncReactor::addHwVsyncTimestamp(nsecs_t timestamp, std::optional<nsecs_t> hwcVsyncPeriod, |
| 183 | bool* periodFlushed) { |
Kevin DuBois | a9fdab7 | 2019-11-14 09:44:14 -0800 | [diff] [blame] | 184 | assert(periodFlushed); |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 185 | |
Ady Abraham | 9c53ee7 | 2020-07-22 21:16:18 -0700 | [diff] [blame] | 186 | std::lock_guard lock(mMutex); |
Ady Abraham | 5dee2f1 | 2020-02-05 17:49:47 -0800 | [diff] [blame] | 187 | if (periodConfirmed(timestamp, hwcVsyncPeriod)) { |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 188 | ATRACE_FORMAT("VSR %s: period confirmed", mName.c_str()); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 189 | if (mPeriodTransitioningTo) { |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 190 | mTracker.setPeriod(*mPeriodTransitioningTo); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 191 | *periodFlushed = true; |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 192 | } |
Kevin DuBois | b818bfa | 2020-07-10 14:29:36 -0700 | [diff] [blame] | 193 | |
| 194 | if (mLastHwVsync) { |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 195 | mTracker.addVsyncTimestamp(*mLastHwVsync); |
Kevin DuBois | b818bfa | 2020-07-10 14:29:36 -0700 | [diff] [blame] | 196 | } |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 197 | mTracker.addVsyncTimestamp(timestamp); |
Kevin DuBois | b818bfa | 2020-07-10 14:29:36 -0700 | [diff] [blame] | 198 | |
Kevin DuBois | c4cdd37 | 2020-01-09 14:12:02 -0800 | [diff] [blame] | 199 | endPeriodTransition(); |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 200 | mMoreSamplesNeeded = mTracker.needsMoreSamples(); |
Kevin DuBois | 02d5ed9 | 2020-01-27 11:05:46 -0800 | [diff] [blame] | 201 | } else if (mPeriodConfirmationInProgress) { |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 202 | ATRACE_FORMAT("VSR %s: still confirming period", mName.c_str()); |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 203 | mLastHwVsync = timestamp; |
| 204 | mMoreSamplesNeeded = true; |
| 205 | *periodFlushed = false; |
| 206 | } else { |
Leon Scroggins III | 31d4141 | 2022-11-18 16:42:53 -0500 | [diff] [blame] | 207 | ATRACE_FORMAT("VSR %s: adding sample", mName.c_str()); |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 208 | *periodFlushed = false; |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 209 | mTracker.addVsyncTimestamp(timestamp); |
| 210 | mMoreSamplesNeeded = mTracker.needsMoreSamples(); |
Kevin DuBois | a9fdab7 | 2019-11-14 09:44:14 -0800 | [diff] [blame] | 211 | } |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 212 | |
Kevin DuBois | b818bfa | 2020-07-10 14:29:36 -0700 | [diff] [blame] | 213 | if (!mMoreSamplesNeeded) { |
| 214 | setIgnorePresentFencesInternal(false); |
| 215 | } |
Kevin DuBois | f77025c | 2019-12-18 16:13:24 -0800 | [diff] [blame] | 216 | return mMoreSamplesNeeded; |
Kevin DuBois | a9fdab7 | 2019-11-14 09:44:14 -0800 | [diff] [blame] | 217 | } |
| 218 | |
Rachel Lee | 6a9731d | 2022-06-06 17:08:14 -0700 | [diff] [blame] | 219 | void VSyncReactor::setDisplayPowerMode(hal::PowerMode powerMode) { |
| 220 | std::scoped_lock lock(mMutex); |
| 221 | mDisplayPowerMode = powerMode; |
| 222 | } |
| 223 | |
Kevin DuBois | 0028738 | 2019-11-19 15:11:55 -0800 | [diff] [blame] | 224 | void VSyncReactor::dump(std::string& result) const { |
Ady Abraham | 9c53ee7 | 2020-07-22 21:16:18 -0700 | [diff] [blame] | 225 | std::lock_guard lock(mMutex); |
Ady Abraham | 5e7371c | 2020-03-24 14:47:24 -0700 | [diff] [blame] | 226 | StringAppendF(&result, "VsyncReactor in use\n"); |
| 227 | StringAppendF(&result, "Has %zu unfired fences\n", mUnfiredFences.size()); |
| 228 | StringAppendF(&result, "mInternalIgnoreFences=%d mExternalIgnoreFences=%d\n", |
| 229 | mInternalIgnoreFences, mExternalIgnoreFences); |
| 230 | StringAppendF(&result, "mMoreSamplesNeeded=%d mPeriodConfirmationInProgress=%d\n", |
| 231 | mMoreSamplesNeeded, mPeriodConfirmationInProgress); |
| 232 | if (mPeriodTransitioningTo) { |
| 233 | StringAppendF(&result, "mPeriodTransitioningTo=%" PRId64 "\n", *mPeriodTransitioningTo); |
| 234 | } else { |
| 235 | StringAppendF(&result, "mPeriodTransitioningTo=nullptr\n"); |
| 236 | } |
| 237 | |
| 238 | if (mLastHwVsync) { |
| 239 | StringAppendF(&result, "Last HW vsync was %.2fms ago\n", |
| 240 | (mClock->now() - *mLastHwVsync) / 1e6f); |
| 241 | } else { |
| 242 | StringAppendF(&result, "No Last HW vsync\n"); |
| 243 | } |
| 244 | |
Ady Abraham | 5e7371c | 2020-03-24 14:47:24 -0700 | [diff] [blame] | 245 | StringAppendF(&result, "VSyncTracker:\n"); |
Ady Abraham | 5a85855 | 2020-03-31 17:54:56 -0700 | [diff] [blame] | 246 | mTracker.dump(result); |
Kevin DuBois | 0028738 | 2019-11-19 15:11:55 -0800 | [diff] [blame] | 247 | } |
| 248 | |
Kevin DuBois | b2501ba | 2019-11-12 14:20:29 -0800 | [diff] [blame] | 249 | } // namespace android::scheduler |