Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [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 | |
| 17 | #pragma once |
| 18 | |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 19 | #include <../TimeStats/TimeStats.h> |
Ady Abraham | 22c7b5c | 2020-09-22 19:33:40 -0700 | [diff] [blame] | 20 | #include <gui/ISurfaceComposer.h> |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 21 | #include <ui/FenceTime.h> |
| 22 | #include <utils/RefBase.h> |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 23 | #include <utils/String16.h> |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 24 | #include <utils/Timers.h> |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 25 | #include <utils/Vector.h> |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 26 | |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 27 | #include <deque> |
| 28 | #include <mutex> |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 29 | |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 30 | namespace android::frametimeline { |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 31 | |
| 32 | enum JankMetadata { |
| 33 | // Frame was presented earlier than expected |
| 34 | EarlyPresent = 0x1, |
| 35 | // Frame was presented later than expected |
| 36 | LatePresent = 0x2, |
| 37 | // App/SF started earlier than expected |
| 38 | EarlyStart = 0x4, |
| 39 | // App/SF started later than expected |
| 40 | LateStart = 0x8, |
| 41 | // App/SF finished work earlier than the deadline |
| 42 | EarlyFinish = 0x10, |
| 43 | // App/SF finished work later than the deadline |
| 44 | LateFinish = 0x20, |
| 45 | // SF was in GPU composition |
| 46 | GpuComposition = 0x40, |
| 47 | }; |
| 48 | |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 49 | class FrameTimelineTest; |
| 50 | |
| 51 | /* |
| 52 | * Collection of timestamps that can be used for both predictions and actual times. |
| 53 | */ |
| 54 | struct TimelineItem { |
| 55 | TimelineItem(const nsecs_t startTime = 0, const nsecs_t endTime = 0, |
| 56 | const nsecs_t presentTime = 0) |
| 57 | : startTime(startTime), endTime(endTime), presentTime(presentTime) {} |
| 58 | |
| 59 | nsecs_t startTime; |
| 60 | nsecs_t endTime; |
| 61 | nsecs_t presentTime; |
Ady Abraham | 55fa727 | 2020-09-30 19:19:27 -0700 | [diff] [blame] | 62 | |
| 63 | bool operator==(const TimelineItem& other) const { |
| 64 | return startTime == other.startTime && endTime == other.endTime && |
| 65 | presentTime == other.presentTime; |
| 66 | } |
| 67 | |
| 68 | bool operator!=(const TimelineItem& other) const { return !(*this == other); } |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | /* |
| 72 | * TokenManager generates a running number token for a set of predictions made by VsyncPredictor. It |
| 73 | * saves these predictions for a short period of time and returns the predictions for a given token, |
| 74 | * if it hasn't expired. |
| 75 | */ |
| 76 | class TokenManager { |
| 77 | public: |
| 78 | virtual ~TokenManager() = default; |
| 79 | |
| 80 | // Generates a token for the given set of predictions. Stores the predictions for 120ms and |
| 81 | // destroys it later. |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 82 | virtual int64_t generateTokenForPredictions(TimelineItem&& prediction) = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | enum class PredictionState { |
| 86 | Valid, // Predictions obtained successfully from the TokenManager |
| 87 | Expired, // TokenManager no longer has the predictions |
| 88 | None, // Predictions are either not present or didn't come from TokenManager |
| 89 | }; |
| 90 | |
| 91 | /* |
| 92 | * Stores a set of predictions and the corresponding actual timestamps pertaining to a single frame |
| 93 | * from the app |
| 94 | */ |
| 95 | class SurfaceFrame { |
| 96 | public: |
| 97 | enum class PresentState { |
| 98 | Presented, // Buffer was latched and presented by SurfaceFlinger |
| 99 | Dropped, // Buffer was dropped by SurfaceFlinger |
| 100 | Unknown, // Initial state, SurfaceFlinger hasn't seen this buffer yet |
| 101 | }; |
| 102 | |
| 103 | virtual ~SurfaceFrame() = default; |
| 104 | |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 105 | virtual TimelineItem getPredictions() const = 0; |
| 106 | virtual TimelineItem getActuals() const = 0; |
| 107 | virtual nsecs_t getActualQueueTime() const = 0; |
| 108 | virtual PresentState getPresentState() const = 0; |
| 109 | virtual PredictionState getPredictionState() const = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 110 | |
| 111 | virtual void setPresentState(PresentState state) = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 112 | |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 113 | // Actual timestamps of the app are set individually at different functions. |
| 114 | // Start time (if the app provides) and Queue time are accessible after queueing the frame, |
Ady Abraham | 7f8a1e6 | 2020-09-28 16:09:35 -0700 | [diff] [blame] | 115 | // whereas Acquire Fence time is available only during latch. |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 116 | virtual void setActualStartTime(nsecs_t actualStartTime) = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 117 | virtual void setActualQueueTime(nsecs_t actualQueueTime) = 0; |
Ady Abraham | 7f8a1e6 | 2020-09-28 16:09:35 -0700 | [diff] [blame] | 118 | virtual void setAcquireFenceTime(nsecs_t acquireFenceTime) = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 119 | }; |
| 120 | |
| 121 | /* |
| 122 | * Maintains a history of SurfaceFrames grouped together by the vsync time in which they were |
| 123 | * presented |
| 124 | */ |
| 125 | class FrameTimeline { |
| 126 | public: |
| 127 | virtual ~FrameTimeline() = default; |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 128 | virtual TokenManager* getTokenManager() = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 129 | |
| 130 | // Create a new surface frame, set the predictions based on a token and return it to the caller. |
| 131 | // Sets the PredictionState of SurfaceFrame. |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 132 | // Debug name is the human-readable debugging string for dumpsys. |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 133 | virtual std::unique_ptr<SurfaceFrame> createSurfaceFrameForToken( |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 134 | uid_t uid, std::string layerName, std::string debugName, |
| 135 | std::optional<int64_t> token) = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 136 | |
| 137 | // Adds a new SurfaceFrame to the current DisplayFrame. Frames from multiple layers can be |
| 138 | // composited into one display frame. |
| 139 | virtual void addSurfaceFrame(std::unique_ptr<SurfaceFrame> surfaceFrame, |
| 140 | SurfaceFrame::PresentState state) = 0; |
| 141 | |
| 142 | // The first function called by SF for the current DisplayFrame. Fetches SF predictions based on |
| 143 | // the token and sets the actualSfWakeTime for the current DisplayFrame. |
| 144 | virtual void setSfWakeUp(int64_t token, nsecs_t wakeupTime) = 0; |
| 145 | |
| 146 | // Sets the sfPresentTime and finalizes the current DisplayFrame. Tracks the given present fence |
| 147 | // until it's signaled, and updates the present timestamps of all presented SurfaceFrames in |
| 148 | // that vsync. |
| 149 | virtual void setSfPresent(nsecs_t sfPresentTime, |
| 150 | const std::shared_ptr<FenceTime>& presentFence) = 0; |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 151 | |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 152 | // Args: |
| 153 | // -jank : Dumps only the Display Frames that are either janky themselves |
| 154 | // or contain janky Surface Frames. |
| 155 | // -all : Dumps the entire list of DisplayFrames and the SurfaceFrames contained within |
| 156 | virtual void parseArgs(const Vector<String16>& args, std::string& result) = 0; |
Adithya Srinivasan | 2d73632 | 2020-10-01 16:53:48 -0700 | [diff] [blame] | 157 | |
| 158 | // Sets the max number of display frames that can be stored. Called by SF backdoor. |
| 159 | virtual void setMaxDisplayFrames(uint32_t size); |
| 160 | |
| 161 | // Restores the max number of display frames to default. Called by SF backdoor. |
| 162 | virtual void reset() = 0; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 163 | }; |
| 164 | |
| 165 | namespace impl { |
| 166 | |
| 167 | using namespace std::chrono_literals; |
| 168 | |
| 169 | class TokenManager : public android::frametimeline::TokenManager { |
| 170 | public: |
Ady Abraham | 22c7b5c | 2020-09-22 19:33:40 -0700 | [diff] [blame] | 171 | TokenManager() : mCurrentToken(ISurfaceComposer::INVALID_VSYNC_ID + 1) {} |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 172 | ~TokenManager() = default; |
| 173 | |
| 174 | int64_t generateTokenForPredictions(TimelineItem&& predictions) override; |
| 175 | std::optional<TimelineItem> getPredictionsForToken(int64_t token); |
| 176 | |
| 177 | private: |
| 178 | // Friend class for testing |
| 179 | friend class android::frametimeline::FrameTimelineTest; |
| 180 | |
| 181 | void flushTokens(nsecs_t flushTime) REQUIRES(mMutex); |
| 182 | |
| 183 | std::unordered_map<int64_t, TimelineItem> mPredictions GUARDED_BY(mMutex); |
| 184 | std::vector<std::pair<int64_t, nsecs_t>> mTokens GUARDED_BY(mMutex); |
| 185 | int64_t mCurrentToken GUARDED_BY(mMutex); |
| 186 | std::mutex mMutex; |
| 187 | static constexpr nsecs_t kMaxRetentionTime = |
| 188 | std::chrono::duration_cast<std::chrono::nanoseconds>(120ms).count(); |
| 189 | }; |
| 190 | |
| 191 | class SurfaceFrame : public android::frametimeline::SurfaceFrame { |
| 192 | public: |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 193 | SurfaceFrame(uid_t uid, std::string layerName, std::string debugName, |
| 194 | PredictionState predictionState, TimelineItem&& predictions); |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 195 | ~SurfaceFrame() = default; |
| 196 | |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 197 | TimelineItem getPredictions() const override { return mPredictions; }; |
| 198 | TimelineItem getActuals() const override; |
| 199 | nsecs_t getActualQueueTime() const override; |
| 200 | PresentState getPresentState() const override; |
| 201 | PredictionState getPredictionState() const override { return mPredictionState; }; |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 202 | |
| 203 | void setActualStartTime(nsecs_t actualStartTime) override; |
| 204 | void setActualQueueTime(nsecs_t actualQueueTime) override; |
Ady Abraham | 7f8a1e6 | 2020-09-28 16:09:35 -0700 | [diff] [blame] | 205 | void setAcquireFenceTime(nsecs_t acquireFenceTime) override; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 206 | void setPresentState(PresentState state) override; |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 207 | void setActualPresentTime(nsecs_t presentTime); |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 208 | void setJankInfo(TimeStats::JankType jankType, int32_t jankMetadata); |
| 209 | TimeStats::JankType getJankType() const; |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 210 | nsecs_t getBaseTime() const; |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 211 | uid_t getOwnerUid() const; |
| 212 | const std::string& getName() const; |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 213 | // All the timestamps are dumped relative to the baseTime |
| 214 | void dump(std::string& result, const std::string& indent, nsecs_t baseTime); |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 215 | |
| 216 | private: |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 217 | const uid_t mOwnerUid; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 218 | const std::string mLayerName; |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 219 | const std::string mDebugName; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 220 | PresentState mPresentState GUARDED_BY(mMutex); |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 221 | const PredictionState mPredictionState; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 222 | const TimelineItem mPredictions; |
| 223 | TimelineItem mActuals GUARDED_BY(mMutex); |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 224 | nsecs_t mActualQueueTime GUARDED_BY(mMutex); |
| 225 | mutable std::mutex mMutex; |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 226 | TimeStats::JankType mJankType GUARDED_BY(mMutex); // Enum for the type of jank |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 227 | int32_t mJankMetadata GUARDED_BY(mMutex); // Additional details about the jank |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 228 | }; |
| 229 | |
| 230 | class FrameTimeline : public android::frametimeline::FrameTimeline { |
| 231 | public: |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 232 | FrameTimeline(std::shared_ptr<TimeStats> timeStats); |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 233 | ~FrameTimeline() = default; |
| 234 | |
Adithya Srinivasan | 5f683cf | 2020-09-15 14:21:04 -0700 | [diff] [blame] | 235 | frametimeline::TokenManager* getTokenManager() override { return &mTokenManager; } |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 236 | std::unique_ptr<frametimeline::SurfaceFrame> createSurfaceFrameForToken( |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 237 | uid_t ownerUid, std::string layerName, std::string debugName, |
| 238 | std::optional<int64_t> token) override; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 239 | void addSurfaceFrame(std::unique_ptr<frametimeline::SurfaceFrame> surfaceFrame, |
| 240 | SurfaceFrame::PresentState state) override; |
| 241 | void setSfWakeUp(int64_t token, nsecs_t wakeupTime) override; |
| 242 | void setSfPresent(nsecs_t sfPresentTime, |
| 243 | const std::shared_ptr<FenceTime>& presentFence) override; |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 244 | void parseArgs(const Vector<String16>& args, std::string& result) override; |
Adithya Srinivasan | 2d73632 | 2020-10-01 16:53:48 -0700 | [diff] [blame] | 245 | void setMaxDisplayFrames(uint32_t size) override; |
| 246 | void reset() override; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 247 | |
| 248 | private: |
| 249 | // Friend class for testing |
| 250 | friend class android::frametimeline::FrameTimelineTest; |
| 251 | |
| 252 | /* |
| 253 | * DisplayFrame should be used only internally within FrameTimeline. |
| 254 | */ |
| 255 | struct DisplayFrame { |
| 256 | DisplayFrame(); |
| 257 | |
| 258 | /* Usage of TimelineItem w.r.t SurfaceFlinger |
| 259 | * startTime Time when SurfaceFlinger wakes up to handle transactions and buffer updates |
| 260 | * endTime Time when SurfaceFlinger sends a composited frame to Display |
| 261 | * presentTime Time when the composited frame was presented on screen |
| 262 | */ |
| 263 | TimelineItem surfaceFlingerPredictions; |
| 264 | TimelineItem surfaceFlingerActuals; |
| 265 | |
| 266 | // Collection of predictions and actual values sent over by Layers |
| 267 | std::vector<std::unique_ptr<SurfaceFrame>> surfaceFrames; |
| 268 | |
| 269 | PredictionState predictionState; |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 270 | TimeStats::JankType jankType = TimeStats::JankType::None; // Enum for the type of jank |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 271 | int32_t jankMetadata = 0x0; // Additional details about the jank |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 272 | }; |
| 273 | |
| 274 | void flushPendingPresentFences() REQUIRES(mMutex); |
| 275 | void finalizeCurrentDisplayFrame() REQUIRES(mMutex); |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 276 | // BaseTime is the smallest timestamp in a DisplayFrame. |
| 277 | // Used for dumping all timestamps relative to the oldest, making it easy to read. |
| 278 | nsecs_t findBaseTime(const std::shared_ptr<DisplayFrame>&) REQUIRES(mMutex); |
| 279 | void dumpDisplayFrame(std::string& result, const std::shared_ptr<DisplayFrame>&, |
| 280 | nsecs_t baseTime) REQUIRES(mMutex); |
| 281 | void dumpAll(std::string& result); |
| 282 | void dumpJank(std::string& result); |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 283 | |
| 284 | // Sliding window of display frames. TODO(b/168072834): compare perf with fixed size array |
| 285 | std::deque<std::shared_ptr<DisplayFrame>> mDisplayFrames GUARDED_BY(mMutex); |
| 286 | std::vector<std::pair<std::shared_ptr<FenceTime>, std::shared_ptr<DisplayFrame>>> |
| 287 | mPendingPresentFences GUARDED_BY(mMutex); |
| 288 | std::shared_ptr<DisplayFrame> mCurrentDisplayFrame GUARDED_BY(mMutex); |
| 289 | TokenManager mTokenManager; |
| 290 | std::mutex mMutex; |
Adithya Srinivasan | 2d73632 | 2020-10-01 16:53:48 -0700 | [diff] [blame] | 291 | uint32_t mMaxDisplayFrames; |
Alec Mouri | 9a29e67 | 2020-09-14 12:39:14 -0700 | [diff] [blame^] | 292 | std::shared_ptr<TimeStats> mTimeStats; |
Adithya Srinivasan | 2d73632 | 2020-10-01 16:53:48 -0700 | [diff] [blame] | 293 | static constexpr uint32_t kDefaultMaxDisplayFrames = 64; |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 294 | // The initial container size for the vector<SurfaceFrames> inside display frame. Although this |
| 295 | // number doesn't represent any bounds on the number of surface frames that can go in a display |
| 296 | // frame, this is a good starting size for the vector so that we can avoid the internal vector |
| 297 | // resizing that happens with push_back. |
| 298 | static constexpr uint32_t kNumSurfaceFramesInitial = 10; |
Adithya Srinivasan | 8fc601d | 2020-09-25 13:51:09 -0700 | [diff] [blame] | 299 | // The various thresholds for App and SF. If the actual timestamp falls within the threshold |
| 300 | // compared to prediction, we don't treat it as a jank. |
| 301 | static constexpr nsecs_t kPresentThreshold = |
| 302 | std::chrono::duration_cast<std::chrono::nanoseconds>(2ms).count(); |
| 303 | static constexpr nsecs_t kDeadlineThreshold = |
| 304 | std::chrono::duration_cast<std::chrono::nanoseconds>(2ms).count(); |
| 305 | static constexpr nsecs_t kSFStartThreshold = |
| 306 | std::chrono::duration_cast<std::chrono::nanoseconds>(1ms).count(); |
Adithya Srinivasan | f279e04 | 2020-08-17 14:56:27 -0700 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | } // namespace impl |
| 310 | } // namespace android::frametimeline |