| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) 2012 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 | 7b743be | 2019-02-27 10:05:48 -0800 | [diff] [blame] | 17 | #pragma once | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 18 |  | 
 | 19 | #include <stddef.h> | 
 | 20 |  | 
 | 21 | #include <utils/Mutex.h> | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 22 | #include <utils/RefBase.h> | 
| Lloyd Pique | 78ce418 | 2018-01-31 16:39:51 -0800 | [diff] [blame] | 23 | #include <utils/Timers.h> | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 24 |  | 
| Brian Anderson | fbc80ae | 2017-05-26 16:23:54 -0700 | [diff] [blame] | 25 | #include <ui/FenceTime.h> | 
 | 26 |  | 
 | 27 | #include <memory> | 
 | 28 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 29 | namespace android { | 
 | 30 |  | 
| Brian Anderson | fbc80ae | 2017-05-26 16:23:54 -0700 | [diff] [blame] | 31 | class FenceTime; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 32 |  | 
 | 33 | class DispSync { | 
 | 34 | public: | 
 | 35 |     class Callback { | 
 | 36 |     public: | 
| Kevin DuBois | 7b743be | 2019-02-27 10:05:48 -0800 | [diff] [blame] | 37 |         Callback() = default; | 
 | 38 |         virtual ~Callback(); | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 39 |         virtual void onDispSyncEvent(nsecs_t when) = 0; | 
| Kevin DuBois | 7b743be | 2019-02-27 10:05:48 -0800 | [diff] [blame] | 40 |  | 
 | 41 |     protected: | 
 | 42 |         Callback(Callback const&) = delete; | 
 | 43 |         Callback& operator=(Callback const&) = delete; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 44 |     }; | 
 | 45 |  | 
| Kevin DuBois | 7b743be | 2019-02-27 10:05:48 -0800 | [diff] [blame] | 46 |     DispSync() = default; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 47 |     virtual ~DispSync(); | 
 | 48 |  | 
 | 49 |     virtual void reset() = 0; | 
 | 50 |     virtual bool addPresentFence(const std::shared_ptr<FenceTime>&) = 0; | 
 | 51 |     virtual void beginResync() = 0; | 
| Alec Mouri | 754c98a | 2019-03-18 18:53:42 -0700 | [diff] [blame] | 52 |     virtual bool addResyncSample(nsecs_t timestamp, bool* periodChanged) = 0; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 53 |     virtual void endResync() = 0; | 
 | 54 |     virtual void setPeriod(nsecs_t period) = 0; | 
 | 55 |     virtual nsecs_t getPeriod() = 0; | 
 | 56 |     virtual void setRefreshSkipCount(int count) = 0; | 
| Alec Mouri | 7355eb2 | 2019-03-05 14:19:10 -0800 | [diff] [blame] | 57 |     virtual status_t addEventListener(const char* name, nsecs_t phase, Callback* callback, | 
 | 58 |                                       nsecs_t lastCallbackTime) = 0; | 
 | 59 |     virtual status_t removeEventListener(Callback* callback, nsecs_t* outLastCallback) = 0; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 60 |     virtual status_t changePhaseOffset(Callback* callback, nsecs_t phase) = 0; | 
 | 61 |     virtual nsecs_t computeNextRefresh(int periodOffset) const = 0; | 
 | 62 |     virtual void setIgnorePresentFences(bool ignore) = 0; | 
| Ana Krulec | 010d219 | 2018-10-08 06:29:54 -0700 | [diff] [blame] | 63 |     virtual nsecs_t expectedPresentTime() = 0; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 64 |  | 
| Yiwei Zhang | 5434a78 | 2018-12-05 18:06:32 -0800 | [diff] [blame] | 65 |     virtual void dump(std::string& result) const = 0; | 
| Kevin DuBois | 7b743be | 2019-02-27 10:05:48 -0800 | [diff] [blame] | 66 |  | 
 | 67 | protected: | 
 | 68 |     DispSync(DispSync const&) = delete; | 
 | 69 |     DispSync& operator=(DispSync const&) = delete; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 70 | }; | 
 | 71 |  | 
 | 72 | namespace impl { | 
 | 73 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 74 | class DispSyncThread; | 
 | 75 |  | 
 | 76 | // DispSync maintains a model of the periodic hardware-based vsync events of a | 
 | 77 | // display and uses that model to execute period callbacks at specific phase | 
 | 78 | // offsets from the hardware vsync events.  The model is constructed by | 
 | 79 | // feeding consecutive hardware event timestamps to the DispSync object via | 
 | 80 | // the addResyncSample method. | 
 | 81 | // | 
 | 82 | // The model is validated using timestamps from Fence objects that are passed | 
 | 83 | // to the DispSync object via the addPresentFence method.  These fence | 
 | 84 | // timestamps should correspond to a hardware vsync event, but they need not | 
 | 85 | // be consecutive hardware vsync times.  If this method determines that the | 
 | 86 | // current model accurately represents the hardware event times it will return | 
 | 87 | // false to indicate that a resynchronization (via addResyncSample) is not | 
 | 88 | // needed. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 89 | class DispSync : public android::DispSync { | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 90 | public: | 
| Chih-Hung Hsieh | 342b760 | 2016-09-01 11:34:16 -0700 | [diff] [blame] | 91 |     explicit DispSync(const char* name); | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 92 |     ~DispSync() override; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 93 |  | 
| Saurabh Shah | f417453 | 2017-07-13 10:45:07 -0700 | [diff] [blame] | 94 |     void init(bool hasSyncFramework, int64_t dispSyncPresentTimeOffset); | 
 | 95 |  | 
| Andy McFadden | 645b1f7 | 2014-06-10 14:43:32 -0700 | [diff] [blame] | 96 |     // reset clears the resync samples and error value. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 97 |     void reset() override; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 98 |  | 
 | 99 |     // addPresentFence adds a fence for use in validating the current vsync | 
 | 100 |     // event model.  The fence need not be signaled at the time | 
 | 101 |     // addPresentFence is called.  When the fence does signal, its timestamp | 
 | 102 |     // should correspond to a hardware vsync event.  Unlike the | 
 | 103 |     // addResyncSample method, the timestamps of consecutive fences need not | 
 | 104 |     // correspond to consecutive hardware vsync events. | 
 | 105 |     // | 
 | 106 |     // This method should be called with the retire fence from each HWComposer | 
 | 107 |     // set call that affects the display. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 108 |     bool addPresentFence(const std::shared_ptr<FenceTime>& fenceTime) override; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 109 |  | 
 | 110 |     // The beginResync, addResyncSample, and endResync methods are used to re- | 
 | 111 |     // synchronize the DispSync's model to the hardware vsync events.  The re- | 
 | 112 |     // synchronization process involves first calling beginResync, then | 
 | 113 |     // calling addResyncSample with a sequence of consecutive hardware vsync | 
 | 114 |     // event timestamps, and finally calling endResync when addResyncSample | 
 | 115 |     // indicates that no more samples are needed by returning false. | 
 | 116 |     // | 
 | 117 |     // This resynchronization process should be performed whenever the display | 
 | 118 |     // is turned on (i.e. once immediately after it's turned on) and whenever | 
 | 119 |     // addPresentFence returns true indicating that the model has drifted away | 
 | 120 |     // from the hardware vsync events. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 121 |     void beginResync() override; | 
| Alec Mouri | 754c98a | 2019-03-18 18:53:42 -0700 | [diff] [blame] | 122 |     // Adds a vsync sample to the dispsync model. The timestamp is the time | 
 | 123 |     // of the vsync event that fired. periodChanged will return true if the | 
 | 124 |     // vsync period was detected to have changed to mPendingPeriod. | 
 | 125 |     // | 
 | 126 |     // This method will return true if more vsync samples are needed to lock | 
 | 127 |     // down the DispSync model, and false otherwise. | 
 | 128 |     bool addResyncSample(nsecs_t timestamp, bool* periodChanged) override; | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 129 |     void endResync() override; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 130 |  | 
| Andy McFadden | 41d67d7 | 2014-04-25 16:58:34 -0700 | [diff] [blame] | 131 |     // The setPeriod method sets the vsync event model's period to a specific | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 132 |     // value.  This should be used to prime the model when a display is first | 
 | 133 |     // turned on.  It should NOT be used after that. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 134 |     void setPeriod(nsecs_t period) override; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 135 |  | 
| Lajos Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 136 |     // The getPeriod method returns the current vsync period. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 137 |     nsecs_t getPeriod() override; | 
| Lajos Molnar | 67d8bd6 | 2014-09-11 14:58:45 -0700 | [diff] [blame] | 138 |  | 
| Andy McFadden | 645b1f7 | 2014-06-10 14:43:32 -0700 | [diff] [blame] | 139 |     // setRefreshSkipCount specifies an additional number of refresh | 
 | 140 |     // cycles to skip.  For example, on a 60Hz display, a skip count of 1 | 
 | 141 |     // will result in events happening at 30Hz.  Default is zero.  The idea | 
 | 142 |     // is to sacrifice smoothness for battery life. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 143 |     void setRefreshSkipCount(int count) override; | 
| Ruchi Kandoi | f52b3c8 | 2014-04-24 16:42:35 -0700 | [diff] [blame] | 144 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 145 |     // addEventListener registers a callback to be called repeatedly at the | 
 | 146 |     // given phase offset from the hardware vsync events.  The callback is | 
 | 147 |     // called from a separate thread and it should return reasonably quickly | 
 | 148 |     // (i.e. within a few hundred microseconds). | 
| Alec Mouri | 7355eb2 | 2019-03-05 14:19:10 -0800 | [diff] [blame] | 149 |     // If the callback was previously registered, and the last clock time the | 
 | 150 |     // callback was invoked was known to the caller (e.g. via removeEventListener), | 
 | 151 |     // then the caller may pass that through to lastCallbackTime, so that | 
 | 152 |     // callbacks do not accidentally double-fire if they are unregistered and | 
 | 153 |     // reregistered in rapid succession. | 
 | 154 |     status_t addEventListener(const char* name, nsecs_t phase, Callback* callback, | 
 | 155 |                               nsecs_t lastCallbackTime) override; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 156 |  | 
 | 157 |     // removeEventListener removes an already-registered event callback.  Once | 
 | 158 |     // this method returns that callback will no longer be called by the | 
 | 159 |     // DispSync object. | 
| Alec Mouri | 7355eb2 | 2019-03-05 14:19:10 -0800 | [diff] [blame] | 160 |     // outLastCallbackTime will contain the last time that the callback was invoked. | 
 | 161 |     // If the caller wishes to reregister the same callback, they should pass the | 
 | 162 |     // callback time back into lastCallbackTime (see addEventListener). | 
 | 163 |     status_t removeEventListener(Callback* callback, nsecs_t* outLastCallbackTime) override; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 164 |  | 
| Dan Stoza | 84d619e | 2018-03-28 17:07:36 -0700 | [diff] [blame] | 165 |     // changePhaseOffset changes the phase offset of an already-registered event callback. The | 
 | 166 |     // method will make sure that there is no skipping or double-firing on the listener per frame, | 
 | 167 |     // even when changing the offsets multiple times. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 168 |     status_t changePhaseOffset(Callback* callback, nsecs_t phase) override; | 
| Dan Stoza | 84d619e | 2018-03-28 17:07:36 -0700 | [diff] [blame] | 169 |  | 
| Andy McFadden | 41d67d7 | 2014-04-25 16:58:34 -0700 | [diff] [blame] | 170 |     // computeNextRefresh computes when the next refresh is expected to begin. | 
 | 171 |     // The periodOffset value can be used to move forward or backward; an | 
 | 172 |     // offset of zero is the next refresh, -1 is the previous refresh, 1 is | 
 | 173 |     // the refresh after next. etc. | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 174 |     nsecs_t computeNextRefresh(int periodOffset) const override; | 
| Andy McFadden | 41d67d7 | 2014-04-25 16:58:34 -0700 | [diff] [blame] | 175 |  | 
| Steven Thomas | dfde8fa | 2018-04-19 16:00:58 -0700 | [diff] [blame] | 176 |     // In certain situations the present fences aren't a good indicator of vsync | 
 | 177 |     // time, e.g. when vr flinger is active, or simply aren't available, | 
 | 178 |     // e.g. when the sync framework isn't present. Use this method to toggle | 
 | 179 |     // whether or not DispSync ignores present fences. If present fences are | 
 | 180 |     // ignored, DispSync will always ask for hardware vsync events by returning | 
 | 181 |     // true from addPresentFence() and addResyncSample(). | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 182 |     void setIgnorePresentFences(bool ignore) override; | 
| Steven Thomas | dfde8fa | 2018-04-19 16:00:58 -0700 | [diff] [blame] | 183 |  | 
| Ana Krulec | 010d219 | 2018-10-08 06:29:54 -0700 | [diff] [blame] | 184 |     // Determine the expected present time when a buffer acquired now will be displayed. | 
 | 185 |     nsecs_t expectedPresentTime(); | 
 | 186 |  | 
| Andy McFadden | c751e92 | 2014-05-08 14:53:26 -0700 | [diff] [blame] | 187 |     // dump appends human-readable debug info to the result string. | 
| Yiwei Zhang | 5434a78 | 2018-12-05 18:06:32 -0800 | [diff] [blame] | 188 |     void dump(std::string& result) const override; | 
| Andy McFadden | c751e92 | 2014-05-08 14:53:26 -0700 | [diff] [blame] | 189 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 190 | private: | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 191 |     void updateModelLocked(); | 
 | 192 |     void updateErrorLocked(); | 
| Steven Thomas | dfde8fa | 2018-04-19 16:00:58 -0700 | [diff] [blame] | 193 |     void resetLocked(); | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 194 |     void resetErrorLocked(); | 
 | 195 |  | 
 | 196 |     enum { MAX_RESYNC_SAMPLES = 32 }; | 
| Tim Murray | 4a4e4a2 | 2016-04-19 16:29:23 +0000 | [diff] [blame] | 197 |     enum { MIN_RESYNC_SAMPLES_FOR_UPDATE = 6 }; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 198 |     enum { NUM_PRESENT_SAMPLES = 8 }; | 
| Dan Stoza | ef78916 | 2015-05-29 13:00:23 -0700 | [diff] [blame] | 199 |     enum { MAX_RESYNC_SAMPLES_WITHOUT_PRESENT = 4 }; | 
| Brian Anderson | fbc80ae | 2017-05-26 16:23:54 -0700 | [diff] [blame] | 200 |     enum { ACCEPTABLE_ZERO_ERR_SAMPLES_COUNT = 64 }; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 201 |  | 
| Tim Murray | 4a4e4a2 | 2016-04-19 16:29:23 +0000 | [diff] [blame] | 202 |     const char* const mName; | 
 | 203 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 204 |     // mPeriod is the computed period of the modeled vsync events in | 
 | 205 |     // nanoseconds. | 
 | 206 |     nsecs_t mPeriod; | 
 | 207 |  | 
| Alec Mouri | 754c98a | 2019-03-18 18:53:42 -0700 | [diff] [blame] | 208 |     // mPendingPeriod is the proposed period change in nanoseconds. | 
 | 209 |     // If mPendingPeriod differs from mPeriod and is nonzero, it will | 
 | 210 |     // be flushed to mPeriod when we detect that the hardware switched | 
 | 211 |     // vsync frequency. | 
 | 212 |     nsecs_t mPendingPeriod = 0; | 
 | 213 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 214 |     // mPhase is the phase offset of the modeled vsync events.  It is the | 
 | 215 |     // number of nanoseconds from time 0 to the first vsync event. | 
 | 216 |     nsecs_t mPhase; | 
 | 217 |  | 
| Haixia Shi | 676b1f6 | 2015-10-28 16:19:01 -0700 | [diff] [blame] | 218 |     // mReferenceTime is the reference time of the modeled vsync events. | 
 | 219 |     // It is the nanosecond timestamp of the first vsync event after a resync. | 
 | 220 |     nsecs_t mReferenceTime; | 
 | 221 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 222 |     // mError is the computed model error.  It is based on the difference | 
 | 223 |     // between the estimated vsync event times and those observed in the | 
| Brian Anderson | fbc80ae | 2017-05-26 16:23:54 -0700 | [diff] [blame] | 224 |     // mPresentFences array. | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 225 |     nsecs_t mError; | 
 | 226 |  | 
| Brian Anderson | fbc80ae | 2017-05-26 16:23:54 -0700 | [diff] [blame] | 227 |     // mZeroErrSamplesCount keeps track of how many times in a row there were | 
 | 228 |     // zero timestamps available in the mPresentFences array. | 
 | 229 |     // Used to sanity check that we are able to calculate the model error. | 
 | 230 |     size_t mZeroErrSamplesCount; | 
 | 231 |  | 
| Haixia Shi | 676b1f6 | 2015-10-28 16:19:01 -0700 | [diff] [blame] | 232 |     // Whether we have updated the vsync event model since the last resync. | 
 | 233 |     bool mModelUpdated; | 
 | 234 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 235 |     // These member variables are the state used during the resynchronization | 
 | 236 |     // process to store information about the hardware vsync event times used | 
 | 237 |     // to compute the model. | 
| Alec Mouri | 75b0b62 | 2019-03-12 18:56:00 +0000 | [diff] [blame] | 238 |     nsecs_t mResyncSamples[MAX_RESYNC_SAMPLES] = {0}; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 239 |     size_t mFirstResyncSample; | 
 | 240 |     size_t mNumResyncSamples; | 
 | 241 |     int mNumResyncSamplesSincePresent; | 
 | 242 |  | 
 | 243 |     // These member variables store information about the present fences used | 
 | 244 |     // to validate the currently computed model. | 
| Lloyd Pique | 78ce418 | 2018-01-31 16:39:51 -0800 | [diff] [blame] | 245 |     std::shared_ptr<FenceTime> mPresentFences[NUM_PRESENT_SAMPLES]{FenceTime::NO_FENCE}; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 246 |     size_t mPresentSampleOffset; | 
 | 247 |  | 
| Andy McFadden | 645b1f7 | 2014-06-10 14:43:32 -0700 | [diff] [blame] | 248 |     int mRefreshSkipCount; | 
 | 249 |  | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 250 |     // mThread is the thread from which all the callbacks are called. | 
 | 251 |     sp<DispSyncThread> mThread; | 
 | 252 |  | 
 | 253 |     // mMutex is used to protect access to all member variables. | 
 | 254 |     mutable Mutex mMutex; | 
| Fabien Sanglard | c45a7d9 | 2017-03-14 13:24:22 -0700 | [diff] [blame] | 255 |  | 
 | 256 |     // This is the offset from the present fence timestamps to the corresponding | 
 | 257 |     // vsync event. | 
 | 258 |     int64_t mPresentTimeOffset; | 
| Fabien Sanglard | cbf153b | 2017-03-10 17:57:12 -0800 | [diff] [blame] | 259 |  | 
 | 260 |     // Ignore present (retire) fences if the device doesn't have support for the | 
 | 261 |     // sync framework | 
 | 262 |     bool mIgnorePresentFences; | 
| Lloyd Pique | e83f931 | 2018-02-01 12:53:17 -0800 | [diff] [blame] | 263 |  | 
 | 264 |     std::unique_ptr<Callback> mZeroPhaseTracer; | 
| Ana Krulec | 064a82f | 2018-09-11 16:03:03 -0700 | [diff] [blame] | 265 |  | 
 | 266 |     // Flag to turn on logging in systrace. | 
 | 267 |     bool mTraceDetailedInfo = false; | 
| Jamie Gennis | faf77cc | 2013-07-30 15:10:32 -0700 | [diff] [blame] | 268 | }; | 
 | 269 |  | 
| Lloyd Pique | 41be5d2 | 2018-06-21 13:11:48 -0700 | [diff] [blame] | 270 | } // namespace impl | 
 | 271 |  | 
| Lloyd Pique | 78ce418 | 2018-01-31 16:39:51 -0800 | [diff] [blame] | 272 | } // namespace android |