Loading services/surfaceflinger/Scheduler/VSyncPredictor.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -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 Loading services/surfaceflinger/tests/unittests/VSyncPredictorTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading
services/surfaceflinger/Scheduler/VSyncPredictor.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
services/surfaceflinger/tests/unittests/VSyncPredictorTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading