summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/RegionSamplingThread.cpp
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2020-04-22 15:18:31 -0700
committer Ady Abraham <adyabr@google.com> 2020-04-23 13:44:11 -0700
commit5facfb12bea41da2546468b7a1680a606a01e0a6 (patch)
tree07a72c8f5cd2666cf529e09c26f2a9a0d080d6d6 /services/surfaceflinger/RegionSamplingThread.cpp
parenta0bb096dc6af57fdc944260409d1d75d10103276 (diff)
SurfaceFlinger: expected present time directly from VSyncReactor
When SurfaceFlinger calculates what is the vsync time, it does that by asking VSyncReactor what is next anticipated vsync from the wake up time. To handle negative offsets (when SF wakes up more than a vsync period before a vsync event) SF adds a vsync period to that anticipated vsync. This creates a race condition where the offset used at the time of invalidate may be different than the offset used by VSyncReactor calculated at the time of the requestNextVsync(). To fix that, we plumb the first calculated vsync time to SurfaceFlinger. Bug: 154303002 Test: Run app transitions and collect systrace Change-Id: I3f2670c7b0ecb52a85fb07df6d360694b51d5d66
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.cpp')
-rw-r--r--services/surfaceflinger/RegionSamplingThread.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp
index 68cd84f661..9d293b7887 100644
--- a/services/surfaceflinger/RegionSamplingThread.cpp
+++ b/services/surfaceflinger/RegionSamplingThread.cpp
@@ -130,7 +130,7 @@ private:
mVsyncListening = false;
}
- void onDispSyncEvent(nsecs_t /* when */) final {
+ void onDispSyncEvent(nsecs_t /*when*/, nsecs_t /*expectedVSyncTimestamp*/) final {
std::unique_lock<decltype(mMutex)> lock(mMutex);
if (mPhaseIntervalSetting == Phase::ZERO) {