Re-use reference timing for late hint in SF hint session timing
Late hint in SF hint sessions currently mis-times the HWC present call
waiting for the next valid vsync, since it ignores this time when
determining where HWC started waiting for the release fence, but this
time needs to be included for late hint since it estimates its own
reference frame where this delay occurs. This whole issue can be
circumvented by just re-using reference frame timing in late hint since
it should just be the same.
Bug: b/236741803
Bug: b/195990840
Test: manual testing
Change-Id: I464c29902756658344768602247f9f15ca26fb1a
diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
index 0ed55b2..77dda6c 100644
--- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
+++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
@@ -420,8 +420,11 @@
previousDisplayReferenceTiming->hwcPresentEndTime;
}
- estimatedTiming = referenceTiming.estimateTimelineFromReference(lastFramePresentTime,
- estimatedEndTime);
+ // Late hint can re-use reference timing here since it's estimating its own reference frame
+ estimatedTiming = earlyHint
+ ? referenceTiming.estimateTimelineFromReference(lastFramePresentTime,
+ estimatedEndTime)
+ : referenceTiming;
// Update predicted present finish time with this display's present time
estimatedEndTime = estimatedTiming.hwcPresentEndTime;