Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50689e86 authored by Matt Buckley's avatar Matt Buckley
Browse files

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
parent c6b9d38c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -420,8 +420,11 @@ std::optional<nsecs_t> PowerAdvisor::estimateWorkDuration(bool earlyHint) {
                    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;