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
Merged-In: I713fad164fa2f4e0f00a2b4efaae063ac8f4a2b7
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 74882f3..484b719 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -851,7 +851,7 @@
         return hwcDisplayId ? getHwComposer().toPhysicalDisplayId(*hwcDisplayId) : std::nullopt;
     }
 
-    bool previousFrameMissed();
+    bool previousFrameMissed(int graceTimeMs = 0);
     void setVsyncEnabledInHWC(DisplayId displayId, HWC2::Vsync enabled);
 
     /*