@@ -374,11 +374,7 @@ bool VSyncPredictor::isVSyncInPhase(nsecs_t timePoint, Fps frameRate) {
374374 purgeTimelines (now);
375375
376376 for (auto & timeline : mTimelines ) {
377- const bool isVsyncValid = FlagManager::getInstance ().vrr_bugfix_24q4 ()
378- ? timeline.isWithin (TimePoint::fromNs (vsync)) ==
379- VsyncTimeline::VsyncOnTimeline::Unique
380- : timeline.validUntil () && timeline.validUntil ()->ns () > vsync;
381- if (isVsyncValid) {
377+ if (timeline.isWithin (TimePoint::fromNs (vsync)) == VsyncTimeline::VsyncOnTimeline::Unique) {
382378 return timeline.isVSyncInPhase (model, vsync, frameRate);
383379 }
384380 }
@@ -413,15 +409,10 @@ void VSyncPredictor::setRenderRate(Fps renderRate, bool applyImmediately) {
413409 mLastCommittedVsync = TimePoint::fromNs (0 );
414410
415411 } else {
416- if (FlagManager::getInstance ().vrr_bugfix_24q4 ()) {
417- // We need to freeze the timeline at the committed vsync, and
418- // then use with threshold adjustments when required to avoid
419- // marginal errors when checking the vsync on the timeline.
420- mTimelines .back ().freeze (mLastCommittedVsync );
421- } else {
422- mTimelines .back ().freeze (
423- TimePoint::fromNs (mLastCommittedVsync .ns () + mIdealPeriod .ns () / 2 ));
424- }
412+ // We need to freeze the timeline at the committed vsync, and
413+ // then use with threshold adjustments when required to avoid
414+ // marginal errors when checking the vsync on the timeline.
415+ mTimelines .back ().freeze (mLastCommittedVsync );
425416 }
426417 mTimelines .emplace_back (mLastCommittedVsync , mIdealPeriod , renderRate);
427418 purgeTimelines (TimePoint::fromNs (mClock ->now ()));
@@ -646,11 +637,7 @@ void VSyncPredictor::purgeTimelines(android::TimePoint now) {
646637 }
647638
648639 while (mTimelines .size () > 1 ) {
649- const auto validUntilOpt = mTimelines .front ().validUntil ();
650- const bool isTimelineOutDated = FlagManager::getInstance ().vrr_bugfix_24q4 ()
651- ? mTimelines .front ().isWithin (now) == VsyncTimeline::VsyncOnTimeline::Outside
652- : validUntilOpt && *validUntilOpt < now;
653- if (isTimelineOutDated) {
640+ if (mTimelines .front ().isWithin (now) == VsyncTimeline::VsyncOnTimeline::Outside) {
654641 mTimelines .pop_front ();
655642 } else {
656643 break ;
@@ -702,12 +689,6 @@ std::optional<TimePoint> VSyncPredictor::VsyncTimeline::nextAnticipatedVSyncTime
702689 SFTRACE_FORMAT_INSTANT (" lastFrameMissed" );
703690 }
704691 } else if (mightBackpressure && lastVsyncOpt) {
705- if (!FlagManager::getInstance ().vrr_bugfix_24q4 ()) {
706- // lastVsyncOpt does not need to be corrected with the new rate, and
707- // it should be used as is to avoid skipping a frame when changing rates are
708- // aligned at vsync time.
709- lastVsyncOpt = snapToVsyncAlignedWithRenderRate (model, *lastVsyncOpt);
710- }
711692 const auto vsyncDiff = vsyncTime - *lastVsyncOpt;
712693 if (vsyncDiff <= minFramePeriodOpt->ns () - threshold) {
713694 // avoid a duplicate vsync
@@ -726,10 +707,7 @@ std::optional<TimePoint> VSyncPredictor::VsyncTimeline::nextAnticipatedVSyncTime
726707 }
727708
728709 SFTRACE_FORMAT_INSTANT (" vsync in %.2fms" , float (vsyncTime - TimePoint::now ().ns ()) / 1e6f);
729- const bool isVsyncInvalid = FlagManager::getInstance ().vrr_bugfix_24q4 ()
730- ? isWithin (TimePoint::fromNs (vsyncTime)) == VsyncOnTimeline::Outside
731- : mValidUntil && vsyncTime > mValidUntil ->ns ();
732- if (isVsyncInvalid) {
710+ if (isWithin (TimePoint::fromNs (vsyncTime)) == VsyncOnTimeline::Outside) {
733711 SFTRACE_FORMAT_INSTANT (" no longer valid for vsync in %.2f" ,
734712 static_cast <float >(vsyncTime - TimePoint::now ().ns ()) / 1e6f);
735713 return std::nullopt ;
@@ -785,9 +763,7 @@ bool VSyncPredictor::VsyncTimeline::isVSyncInPhase(Model model, nsecs_t vsync, F
785763 return ticks<std::milli, float >(TimePoint::fromNs (timePoint) - now);
786764 };
787765
788- Fps displayFps = !FlagManager::getInstance ().vrr_bugfix_24q4 () && mRenderRateOpt
789- ? *mRenderRateOpt
790- : Fps::fromPeriodNsecs (mIdealPeriod .ns ());
766+ Fps displayFps = Fps::fromPeriodNsecs (mIdealPeriod .ns ());
791767 const auto divisor = RefreshRateSelector::getFrameRateDivisor (displayFps, frameRate);
792768 const auto now = TimePoint::now ();
793769
0 commit comments