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

Commit d03639a0 authored by ramindani's avatar ramindani
Browse files

SF: Update fixup on lastFrameMissed only when we violate minFramePeriod

Test: atest VSyncPredictorTest
BUG: 346503493
Flag: EXEMPT bugfix
Change-Id: I94f9e7aa3b4e6e4eeb6eb09505e44972dcfe9288
parent 0d9430de
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) {