SF: Offsets should be dependend on the refresh rate.
When switching to 90Hz, the time between vsync pulses is only 11ms, so it
doesn't make sense to have 6msec offsets. Adding the flags will allow us
to experiment with different offsets in the later stages through device.mk
file for two different refresh rates. Eventually, the refresh rates should
be coupled with the configs that indicate the refresh rate.
Bug: 122905996
Test: Added Fake class to inject into tests to keep consistant results.
Change-Id: Iffe7eb9dae6cd655c83e5b576306e3883ef1a56d
diff --git a/services/surfaceflinger/Scheduler/DispSync.cpp b/services/surfaceflinger/Scheduler/DispSync.cpp
index 9b2a6fc..075e238 100644
--- a/services/surfaceflinger/Scheduler/DispSync.cpp
+++ b/services/surfaceflinger/Scheduler/DispSync.cpp
@@ -757,18 +757,7 @@
const uint32_t hwcLatency = 0;
// Ask DispSync when the next refresh will be (CLOCK_MONOTONIC).
- const nsecs_t nextRefresh = computeNextRefresh(hwcLatency);
-
- // The DispSync time is already adjusted for the difference between
- // vsync and reported-vsync (SurfaceFlinger::dispSyncPresentTimeOffset), so
- // we don't need to factor that in here. Pad a little to avoid
- // weird effects if apps might be requesting times right on the edge.
- nsecs_t extraPadding = 0;
- if (SurfaceFlinger::vsyncPhaseOffsetNs == 0) {
- extraPadding = 1000000; // 1ms (6% of 60Hz)
- }
-
- return nextRefresh + extraPadding;
+ return computeNextRefresh(hwcLatency);
}
} // namespace impl