SurfaceFlinger: add grace time for present fence to signal
To avoid racing with HWVsync when SF wakeup at a small offset from vsync,
we want to give a small grace period for the present fence to fire
instead of just giving up on this frame.
Bug: 141312250
Test: Set SF offset to 0 and observe systrace
Change-Id: I713fad164fa2f4e0f00a2b4efaae063ac8f4a2b7
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 2a6836e..c922f30 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -780,7 +780,7 @@
bool isDisplayConfigAllowed(int32_t configId) const REQUIRES(mStateLock);
- bool previousFrameMissed();
+ bool previousFrameMissed(int graceTimeMs = 0);
// Populates the expected present time for this frame. For negative offsets, performs a
// correction using the predicted vsync for the next frame instead.