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

Commit bd9fb126 authored by Ram Indani's avatar Ram Indani Committed by Android (Google) Code Review
Browse files

Merge "Update lastExpectedPresentTime when cadence changes" into main

parents d5333215 f115e508
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -540,8 +540,9 @@ status_t HWComposer::getDeviceCompositionChanges(
    displayData.validateWasSkipped = false;
    {
        std::scoped_lock lock{displayData.expectedPresentLock};
        if (expectedPresentTime > displayData.lastExpectedPresentTimestamp.ns()) {
            displayData.lastExpectedPresentTimestamp = TimePoint::fromNs(expectedPresentTime);
        // TODO(b/296636176) Update displayData.lastFrameInterval for present display commands
        }
    }

    if (canSkipValidate) {
@@ -965,6 +966,11 @@ status_t HWComposer::notifyExpectedPresentIfRequired(PhysicalDisplayId displayId
                isExpectedPresentWithinTimeout(expectedPresentTime, lastExpectedPresentTimestamp,
                                               timeoutOpt, threshold);

        using fps_approx_ops::operator!=;
        if (frameIntervalIsOnCadence && frameInterval != lastFrameInterval) {
            displayData.lastExpectedPresentTimestamp = expectedPresentTime;
        }

        if (expectedPresentWithinTimeout && frameIntervalIsOnCadence) {
            return NO_ERROR;
        }