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

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

Merge "SF: Update fixup on lastFrameMissed only when we violate minFramePeriod" into main

parents b4d3a8ad d03639a0
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -695,9 +695,12 @@ std::optional<TimePoint> VSyncPredictor::VsyncTimeline::nextAnticipatedVSyncTime
        if (lastFrameMissed) {
            // If the last frame missed is the last vsync, we already shifted the timeline. Depends
            // on whether we skipped the frame (onFrameMissed) or not (onFrameBegin) we apply a
            // different fixup. There is no need to to shift the vsync timeline again.
            // different fixup if we are violating the minFramePeriod.
            // There is no need to shift the vsync timeline again.
            if (vsyncTime - missedVsync.vsync.ns() < minFramePeriodOpt->ns()) {
                vsyncTime += missedVsync.fixup.ns();
                SFTRACE_FORMAT_INSTANT("lastFrameMissed");
            }
        } else if (mightBackpressure && lastVsyncOpt) {
            if (!FlagManager::getInstance().vrr_bugfix_24q4()) {
                // lastVsyncOpt does not need to be corrected with the new rate, and
+2 −1
Original line number Diff line number Diff line
@@ -915,7 +915,8 @@ TEST_F(VSyncPredictorTest, adjustsVrrTimeline) {

    vrrTracker.onFrameBegin(TimePoint::fromNs(7000),
                            {TimePoint::fromNs(6500), TimePoint::fromNs(6500)});
    EXPECT_EQ(10500, vrrTracker.nextAnticipatedVSyncTimeFrom(9000, 7000));
    EXPECT_EQ(8500, vrrTracker.nextAnticipatedVSyncTimeFrom(8000, 7000));
    EXPECT_EQ(9500, vrrTracker.nextAnticipatedVSyncTimeFrom(9000, 7000));
}

TEST_F(VSyncPredictorTest, adjustsVrrTimelineTwoClients) {