blob: 161ca6372af712d3bf86a075852aaf1e3fefe445 [file] [log] [blame]
Michael Wright5d22d4f2018-06-21 02:50:34 +01001/*
2 * Copyright 2018 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
Dan Stoza030fbc12020-02-19 15:32:01 -080019#include <atomic>
Matt Buckleyef51fba2021-10-12 19:30:12 +000020#include <chrono>
Matt Buckley50c44062022-01-17 20:48:10 +000021#include <unordered_map>
Peiyong Lin74ca2f42019-01-14 19:36:57 -080022#include <unordered_set>
23
Matt Buckley50c44062022-01-17 20:48:10 +000024#include <ui/DisplayId.h>
25#include <ui/FenceTime.h>
Dan Stoza20950002020-06-18 14:56:58 -070026#include <utils/Mutex.h>
27
Matt Buckley104f53a2023-12-14 00:19:20 +000028// FMQ library in IPower does questionable conversions
29#pragma clang diagnostic push
30#pragma clang diagnostic ignored "-Wconversion"
Xiang Wang99f6f3c2023-05-22 13:12:16 -070031#include <aidl/android/hardware/power/IPower.h>
Matt Buckley0538cae2022-11-08 23:12:04 +000032#include <powermanager/PowerHalController.h>
Matt Buckley104f53a2023-12-14 00:19:20 +000033#pragma clang diagnostic pop
34
35#include <compositionengine/impl/OutputCompositionState.h>
Matt Buckley2fa85012022-08-30 22:38:45 +000036#include <scheduler/Time.h>
Alec Mouriff793872022-01-13 17:45:06 -080037#include <ui/DisplayIdentification.h>
Dan Stoza030fbc12020-02-19 15:32:01 -080038#include "../Scheduler/OneShotTimer.h"
Michael Wright5d22d4f2018-06-21 02:50:34 +010039
Matt Buckleyef51fba2021-10-12 19:30:12 +000040using namespace std::chrono_literals;
41
Michael Wright5d22d4f2018-06-21 02:50:34 +010042namespace android {
Alec Mouridea1ac52021-06-23 18:12:18 -070043
44class SurfaceFlinger;
45
Michael Wright5d22d4f2018-06-21 02:50:34 +010046namespace Hwc2 {
47
48class PowerAdvisor {
49public:
50 virtual ~PowerAdvisor();
51
Alec Mouridea1ac52021-06-23 18:12:18 -070052 // Initializes resources that cannot be initialized on construction
53 virtual void init() = 0;
Matt Buckley547cc0c2023-10-27 22:22:36 +000054 // Used to indicate that power hints can now be reported
Dan Stoza29e7bdf2020-03-23 14:43:09 -070055 virtual void onBootFinished() = 0;
Peiyong Lin74ca2f42019-01-14 19:36:57 -080056 virtual void setExpensiveRenderingExpected(DisplayId displayId, bool expected) = 0;
Alec Mouridea1ac52021-06-23 18:12:18 -070057 virtual bool isUsingExpensiveRendering() = 0;
Matt Buckley547cc0c2023-10-27 22:22:36 +000058 // Checks both if it's supported and if it's enabled; this is thread-safe since its values are
59 // set before onBootFinished, which gates all methods that run on threads other than SF main
Matt Buckley06f299a2021-09-24 19:43:51 +000060 virtual bool usePowerHintSession() = 0;
61 virtual bool supportsPowerHintSession() = 0;
Xiang Wangcb50bbd2024-04-18 16:57:54 -070062 virtual bool supportsGpuReporting() = 0;
Matt Buckley0538cae2022-11-08 23:12:04 +000063
Matt Buckley50c44062022-01-17 20:48:10 +000064 // Sends a power hint that updates to the target work duration for the frame
Matt Buckley0538cae2022-11-08 23:12:04 +000065 virtual void updateTargetWorkDuration(Duration targetDuration) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000066 // Sends a power hint for the actual known work duration at the end of the frame
Matt Buckley0538cae2022-11-08 23:12:04 +000067 virtual void reportActualWorkDuration() = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000068 // Sets whether the power hint session is enabled
Matt Buckley0538cae2022-11-08 23:12:04 +000069 virtual void enablePowerHintSession(bool enabled) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000070 // Initializes the power hint session
Matt Buckley547cc0c2023-10-27 22:22:36 +000071 virtual bool startPowerHintSession(std::vector<int32_t>&& threadIds) = 0;
Xiang Wangaab31162024-03-12 19:48:08 -070072 // Provides PowerAdvisor with gpu start time
73 virtual void setGpuStartTime(DisplayId displayId, TimePoint startTime) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000074 // Provides PowerAdvisor with a copy of the gpu fence so it can determine the gpu end time
75 virtual void setGpuFenceTime(DisplayId displayId, std::unique_ptr<FenceTime>&& fenceTime) = 0;
Matt Buckley16dec1f2022-06-07 21:46:20 +000076 // Reports the start and end times of a hwc validate call this frame for a given display
Matt Buckley2fa85012022-08-30 22:38:45 +000077 virtual void setHwcValidateTiming(DisplayId displayId, TimePoint validateStartTime,
78 TimePoint validateEndTime) = 0;
Matt Buckley16dec1f2022-06-07 21:46:20 +000079 // Reports the start and end times of a hwc present call this frame for a given display
Matt Buckley2fa85012022-08-30 22:38:45 +000080 virtual void setHwcPresentTiming(DisplayId displayId, TimePoint presentStartTime,
81 TimePoint presentEndTime) = 0;
Matt Buckleyc6b9d382022-06-17 15:28:07 -070082 // Reports the expected time that the current frame will present to the display
Matt Buckley2fa85012022-08-30 22:38:45 +000083 virtual void setExpectedPresentTime(TimePoint expectedPresentTime) = 0;
Matt Buckley1809d902022-08-05 06:51:43 +000084 // Reports the most recent present fence time and end time once known
Matt Buckley2fa85012022-08-30 22:38:45 +000085 virtual void setSfPresentTiming(TimePoint presentFenceTime, TimePoint presentEndTime) = 0;
Xiang Wangaab31162024-03-12 19:48:08 -070086 // Reports whether a display requires RenderEngine to draw
87 virtual void setRequiresRenderEngine(DisplayId displayId, bool requiresRenderEngine) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000088 // Reports whether a given display skipped validation this frame
89 virtual void setSkippedValidate(DisplayId displayId, bool skipped) = 0;
Matt Buckley16dec1f2022-06-07 21:46:20 +000090 // Reports when a hwc present is delayed, and the time that it will resume
Matt Buckley2fa85012022-08-30 22:38:45 +000091 virtual void setHwcPresentDelayedTime(DisplayId displayId,
92 TimePoint earliestFrameStartTime) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000093 // Reports the start delay for SurfaceFlinger this frame
Matt Buckley2fa85012022-08-30 22:38:45 +000094 virtual void setFrameDelay(Duration frameDelayDuration) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000095 // Reports the SurfaceFlinger commit start time this frame
Matt Buckley2fa85012022-08-30 22:38:45 +000096 virtual void setCommitStart(TimePoint commitStartTime) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000097 // Reports the SurfaceFlinger composite end time this frame
Matt Buckley2fa85012022-08-30 22:38:45 +000098 virtual void setCompositeEnd(TimePoint compositeEndTime) = 0;
Matt Buckley50c44062022-01-17 20:48:10 +000099 // Reports the list of the currently active displays
100 virtual void setDisplays(std::vector<DisplayId>& displayIds) = 0;
101 // Sets the target duration for the entire pipeline including the gpu
Matt Buckley2fa85012022-08-30 22:38:45 +0000102 virtual void setTotalFrameTargetWorkDuration(Duration targetDuration) = 0;
Matt Buckley547cc0c2023-10-27 22:22:36 +0000103
104 // --- The following methods may run on threads besides SF main ---
105 // Send a hint about an upcoming increase in the CPU workload
106 virtual void notifyCpuLoadUp() = 0;
107 // Send a hint about the imminent start of a new CPU workload
108 virtual void notifyDisplayUpdateImminentAndCpuReset() = 0;
Michael Wright5d22d4f2018-06-21 02:50:34 +0100109};
110
111namespace impl {
112
Michael Wright5d22d4f2018-06-21 02:50:34 +0100113// PowerAdvisor is a wrapper around IPower HAL which takes into account the
114// full state of the system when sending out power hints to things like the GPU.
115class PowerAdvisor final : public Hwc2::PowerAdvisor {
116public:
Alec Mouridea1ac52021-06-23 18:12:18 -0700117 PowerAdvisor(SurfaceFlinger& flinger);
Michael Wright5d22d4f2018-06-21 02:50:34 +0100118 ~PowerAdvisor() override;
119
Alec Mouridea1ac52021-06-23 18:12:18 -0700120 void init() override;
Dan Stoza29e7bdf2020-03-23 14:43:09 -0700121 void onBootFinished() override;
Peiyong Lin74ca2f42019-01-14 19:36:57 -0800122 void setExpensiveRenderingExpected(DisplayId displayId, bool expected) override;
Matt Buckley06f299a2021-09-24 19:43:51 +0000123 bool isUsingExpensiveRendering() override { return mNotifiedExpensiveRendering; };
Matt Buckley06f299a2021-09-24 19:43:51 +0000124 bool usePowerHintSession() override;
125 bool supportsPowerHintSession() override;
Xiang Wangcb50bbd2024-04-18 16:57:54 -0700126 bool supportsGpuReporting() override;
Matt Buckley0538cae2022-11-08 23:12:04 +0000127 void updateTargetWorkDuration(Duration targetDuration) override;
128 void reportActualWorkDuration() override;
129 void enablePowerHintSession(bool enabled) override;
Matt Buckley547cc0c2023-10-27 22:22:36 +0000130 bool startPowerHintSession(std::vector<int32_t>&& threadIds) override;
Xiang Wangaab31162024-03-12 19:48:08 -0700131 void setGpuStartTime(DisplayId displayId, TimePoint startTime) override;
Matt Buckley547cc0c2023-10-27 22:22:36 +0000132 void setGpuFenceTime(DisplayId displayId, std::unique_ptr<FenceTime>&& fenceTime) override;
Matt Buckley2fa85012022-08-30 22:38:45 +0000133 void setHwcValidateTiming(DisplayId displayId, TimePoint validateStartTime,
134 TimePoint validateEndTime) override;
135 void setHwcPresentTiming(DisplayId displayId, TimePoint presentStartTime,
136 TimePoint presentEndTime) override;
Matt Buckley50c44062022-01-17 20:48:10 +0000137 void setSkippedValidate(DisplayId displayId, bool skipped) override;
Xiang Wangaab31162024-03-12 19:48:08 -0700138 void setRequiresRenderEngine(DisplayId displayId, bool requiresRenderEngine);
Matt Buckley2fa85012022-08-30 22:38:45 +0000139 void setExpectedPresentTime(TimePoint expectedPresentTime) override;
140 void setSfPresentTiming(TimePoint presentFenceTime, TimePoint presentEndTime) override;
141 void setHwcPresentDelayedTime(DisplayId displayId, TimePoint earliestFrameStartTime) override;
Matt Buckley2fa85012022-08-30 22:38:45 +0000142 void setFrameDelay(Duration frameDelayDuration) override;
143 void setCommitStart(TimePoint commitStartTime) override;
144 void setCompositeEnd(TimePoint compositeEndTime) override;
Matt Buckley50c44062022-01-17 20:48:10 +0000145 void setDisplays(std::vector<DisplayId>& displayIds) override;
Matt Buckley2fa85012022-08-30 22:38:45 +0000146 void setTotalFrameTargetWorkDuration(Duration targetDuration) override;
Michael Wright5d22d4f2018-06-21 02:50:34 +0100147
Matt Buckley547cc0c2023-10-27 22:22:36 +0000148 // --- The following methods may run on threads besides SF main ---
149 void notifyCpuLoadUp() override;
150 void notifyDisplayUpdateImminentAndCpuReset() override;
151
Michael Wright5d22d4f2018-06-21 02:50:34 +0100152private:
Matt Buckley57274052022-08-12 21:54:23 +0000153 friend class PowerAdvisorTest;
154
Matt Buckley0538cae2022-11-08 23:12:04 +0000155 std::unique_ptr<power::PowerHalController> mPowerHal;
Dan Stoza29e7bdf2020-03-23 14:43:09 -0700156 std::atomic_bool mBootFinished = false;
Matt Buckleyef51fba2021-10-12 19:30:12 +0000157
Peiyong Lin74ca2f42019-01-14 19:36:57 -0800158 std::unordered_set<DisplayId> mExpensiveDisplays;
Michael Wright5d22d4f2018-06-21 02:50:34 +0100159 bool mNotifiedExpensiveRendering = false;
Dan Stoza030fbc12020-02-19 15:32:01 -0800160
Alec Mouridea1ac52021-06-23 18:12:18 -0700161 SurfaceFlinger& mFlinger;
Dan Stoza030fbc12020-02-19 15:32:01 -0800162 std::atomic_bool mSendUpdateImminent = true;
Alec Mouric059dcf2022-05-05 23:40:07 +0000163 std::atomic<nsecs_t> mLastScreenUpdatedTime = 0;
164 std::optional<scheduler::OneShotTimer> mScreenUpdateTimer;
Matt Buckley50c44062022-01-17 20:48:10 +0000165
166 // Higher-level timing data used for estimation
167 struct DisplayTimeline {
Matt Buckley16dec1f2022-06-07 21:46:20 +0000168 // The start of hwc present, or the start of validate if it happened there instead
Matt Buckley2fa85012022-08-30 22:38:45 +0000169 TimePoint hwcPresentStartTime;
Matt Buckley16dec1f2022-06-07 21:46:20 +0000170 // The end of hwc present or validate, whichever one actually presented
Matt Buckley2fa85012022-08-30 22:38:45 +0000171 TimePoint hwcPresentEndTime;
Matt Buckley16dec1f2022-06-07 21:46:20 +0000172 // How long the actual hwc present was delayed after hwcPresentStartTime
Matt Buckley2fa85012022-08-30 22:38:45 +0000173 Duration hwcPresentDelayDuration{0ns};
Matt Buckleyc6b9d382022-06-17 15:28:07 -0700174 // When we think we started waiting for the present fence after calling into hwc present and
Matt Buckley50c44062022-01-17 20:48:10 +0000175 // after potentially waiting for the earliest present time
Matt Buckley2fa85012022-08-30 22:38:45 +0000176 TimePoint presentFenceWaitStartTime;
Matt Buckley16dec1f2022-06-07 21:46:20 +0000177 // How long we ran after we finished waiting for the fence but before hwc present finished
Matt Buckley2fa85012022-08-30 22:38:45 +0000178 Duration postPresentFenceHwcPresentDuration{0ns};
Matt Buckley50c44062022-01-17 20:48:10 +0000179 // Are we likely to have waited for the present fence during composition
Matt Buckleyc6b9d382022-06-17 15:28:07 -0700180 bool probablyWaitsForPresentFence = false;
Matt Buckley50c44062022-01-17 20:48:10 +0000181 };
182
183 struct GpuTimeline {
Matt Buckley2fa85012022-08-30 22:38:45 +0000184 Duration duration{0ns};
185 TimePoint startTime;
Matt Buckley50c44062022-01-17 20:48:10 +0000186 };
187
188 // Power hint session data recorded from the pipeline
189 struct DisplayTimingData {
190 std::unique_ptr<FenceTime> gpuEndFenceTime;
Matt Buckley2fa85012022-08-30 22:38:45 +0000191 std::optional<TimePoint> gpuStartTime;
192 std::optional<TimePoint> lastValidGpuEndTime;
193 std::optional<TimePoint> lastValidGpuStartTime;
194 std::optional<TimePoint> hwcPresentStartTime;
195 std::optional<TimePoint> hwcPresentEndTime;
196 std::optional<TimePoint> hwcValidateStartTime;
197 std::optional<TimePoint> hwcValidateEndTime;
198 std::optional<TimePoint> hwcPresentDelayedTime;
Xiang Wangaab31162024-03-12 19:48:08 -0700199 bool requiresRenderEngine = false;
Matt Buckley50c44062022-01-17 20:48:10 +0000200 bool skippedValidate = false;
201 // Calculate high-level timing milestones from more granular display timing data
Matt Buckley2fa85012022-08-30 22:38:45 +0000202 DisplayTimeline calculateDisplayTimeline(TimePoint fenceTime);
Matt Buckley50c44062022-01-17 20:48:10 +0000203 // Estimate the gpu duration for a given display from previous gpu timing data
Matt Buckley2fa85012022-08-30 22:38:45 +0000204 std::optional<GpuTimeline> estimateGpuTiming(std::optional<TimePoint> previousEndTime);
Matt Buckley50c44062022-01-17 20:48:10 +0000205 };
206
207 template <class T, size_t N>
208 class RingBuffer {
209 std::array<T, N> elements = {};
210 size_t mIndex = 0;
211 size_t numElements = 0;
212
213 public:
214 void append(T item) {
215 mIndex = (mIndex + 1) % N;
216 numElements = std::min(N, numElements + 1);
217 elements[mIndex] = item;
218 }
219 bool isFull() const { return numElements == N; }
220 // Allows access like [0] == current, [-1] = previous, etc..
221 T& operator[](int offset) {
222 size_t positiveOffset =
223 static_cast<size_t>((offset % static_cast<int>(N)) + static_cast<int>(N));
224 return elements[(mIndex + positiveOffset) % N];
225 }
226 };
227
228 // Filter and sort the display ids by a given property
Matt Buckley2fa85012022-08-30 22:38:45 +0000229 std::vector<DisplayId> getOrderedDisplayIds(
230 std::optional<TimePoint> DisplayTimingData::*sortBy);
Xiang Wangaab31162024-03-12 19:48:08 -0700231 // Estimates a frame's total work duration including gpu and gpu time.
232 std::optional<aidl::android::hardware::power::WorkDuration> estimateWorkDuration();
Matt Buckley50c44062022-01-17 20:48:10 +0000233 // There are two different targets and actual work durations we care about,
234 // this normalizes them together and takes the max of the two
Matt Buckley2fa85012022-08-30 22:38:45 +0000235 Duration combineTimingEstimates(Duration totalDuration, Duration flingerDuration);
Matt Buckley52dfaad2024-03-07 20:20:07 +0000236 // Whether to use the new "createHintSessionWithConfig" method
237 bool shouldCreateSessionWithConfig() REQUIRES(mHintSessionMutex);
238
Matt Buckley547cc0c2023-10-27 22:22:36 +0000239 bool ensurePowerHintSessionRunning() REQUIRES(mHintSessionMutex);
Matt Buckley50c44062022-01-17 20:48:10 +0000240 std::unordered_map<DisplayId, DisplayTimingData> mDisplayTimingData;
Matt Buckley50c44062022-01-17 20:48:10 +0000241 // Current frame's delay
Matt Buckley2fa85012022-08-30 22:38:45 +0000242 Duration mFrameDelayDuration{0ns};
Matt Buckley50c44062022-01-17 20:48:10 +0000243 // Last frame's post-composition duration
Matt Buckley2fa85012022-08-30 22:38:45 +0000244 Duration mLastPostcompDuration{0ns};
Matt Buckley50c44062022-01-17 20:48:10 +0000245 // Buffer of recent commit start times
Matt Buckley2fa85012022-08-30 22:38:45 +0000246 RingBuffer<TimePoint, 2> mCommitStartTimes;
Matt Buckley50c44062022-01-17 20:48:10 +0000247 // Buffer of recent expected present times
Matt Buckley2fa85012022-08-30 22:38:45 +0000248 RingBuffer<TimePoint, 2> mExpectedPresentTimes;
Matt Buckleya2ad1dc2022-08-16 20:07:26 +0000249 // Most recent present fence time, provided by SF after composition engine finishes presenting
Matt Buckley2fa85012022-08-30 22:38:45 +0000250 TimePoint mLastPresentFenceTime;
Matt Buckleya2ad1dc2022-08-16 20:07:26 +0000251 // Most recent composition engine present end time, returned with the present fence from SF
Matt Buckley2fa85012022-08-30 22:38:45 +0000252 TimePoint mLastSfPresentEndTime;
Matt Buckleya2ad1dc2022-08-16 20:07:26 +0000253 // Target duration for the entire pipeline including gpu
Matt Buckley2fa85012022-08-30 22:38:45 +0000254 std::optional<Duration> mTotalFrameTargetDuration;
Matt Buckley50c44062022-01-17 20:48:10 +0000255 // Updated list of display IDs
256 std::vector<DisplayId> mDisplayIds;
257
Matt Buckley0538cae2022-11-08 23:12:04 +0000258 // Ensure powerhal connection is initialized
259 power::PowerHalController& getPowerHal();
260
Matt Buckley547cc0c2023-10-27 22:22:36 +0000261 // These variables are set before mBootFinished and never mutated after, so it's safe to access
262 // from threaded methods.
Matt Buckley0538cae2022-11-08 23:12:04 +0000263 std::optional<bool> mHintSessionEnabled;
264 std::optional<bool> mSupportsHintSession;
Matt Buckley0538cae2022-11-08 23:12:04 +0000265
266 std::mutex mHintSessionMutex;
Matt Buckley6c18e6d2024-02-07 23:39:50 +0000267 std::shared_ptr<power::PowerHintSessionWrapper> mHintSession GUARDED_BY(mHintSessionMutex) =
268 nullptr;
Matt Buckley0538cae2022-11-08 23:12:04 +0000269
270 // Initialize to true so we try to call, to check if it's supported
271 bool mHasExpensiveRendering = true;
272 bool mHasDisplayUpdateImminent = true;
273 // Queue of actual durations saved to report
Xiang Wang99f6f3c2023-05-22 13:12:16 -0700274 std::vector<aidl::android::hardware::power::WorkDuration> mHintSessionQueue;
Matt Buckley0538cae2022-11-08 23:12:04 +0000275 // The latest values we have received for target and actual
276 Duration mTargetDuration = kDefaultTargetDuration;
Matt Buckley0538cae2022-11-08 23:12:04 +0000277 // The list of thread ids, stored so we can restart the session from this class if needed
278 std::vector<int32_t> mHintSessionThreadIds;
279 Duration mLastTargetDurationSent = kDefaultTargetDuration;
Matt Buckley547cc0c2023-10-27 22:22:36 +0000280
281 // Used to manage the execution ordering of reportActualWorkDuration for concurrency testing
282 std::promise<bool> mDelayReportActualMutexAcquisitonPromise;
283 bool mTimingTestingMode = false;
284
Matt Buckley52dfaad2024-03-07 20:20:07 +0000285 // Hint session configuration data
286 aidl::android::hardware::power::SessionConfig mSessionConfig;
287
288 // Whether createHintSessionWithConfig is supported, assume true until it fails
289 bool mSessionConfigSupported = true;
290 bool mFirstConfigSupportCheck = true;
291
Matt Buckley0538cae2022-11-08 23:12:04 +0000292 // Whether we should emit ATRACE_INT data for hint sessions
293 static const bool sTraceHintSessionData;
294
295 // Default target duration for the hint session
296 static constexpr const Duration kDefaultTargetDuration{16ms};
Matt Buckley50c44062022-01-17 20:48:10 +0000297
Matt Buckleyc6b9d382022-06-17 15:28:07 -0700298 // An adjustable safety margin which pads the "actual" value sent to PowerHAL,
299 // encouraging more aggressive boosting to give SurfaceFlinger a larger margin for error
Matt Buckleyac15a1b2023-02-28 06:51:28 +0000300 static const Duration sTargetSafetyMargin;
301 static constexpr const Duration kDefaultTargetSafetyMargin{1ms};
Matt Buckley50c44062022-01-17 20:48:10 +0000302
Matt Buckley676e4392023-05-25 22:09:26 +0000303 // Whether we should send reportActualWorkDuration calls
304 static const bool sUseReportActualDuration;
305
Matt Buckley50c44062022-01-17 20:48:10 +0000306 // How long we expect hwc to run after the present call until it waits for the fence
Matt Buckley2fa85012022-08-30 22:38:45 +0000307 static constexpr const Duration kFenceWaitStartDelayValidated{150us};
308 static constexpr const Duration kFenceWaitStartDelaySkippedValidate{250us};
Michael Wright5d22d4f2018-06-21 02:50:34 +0100309};
310
Michael Wright5d22d4f2018-06-21 02:50:34 +0100311} // namespace impl
312} // namespace Hwc2
313} // namespace android