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

Commit 6b6d542c authored by ramindani's avatar ramindani
Browse files

[SF] Use render rate for the compositorTiming

Vsync Period does not represent the actual
composition rate in the framework anymore,
render rate is the more accurate composition rate.

BUG: 383938139
BUG: 355342197
Flag: EXEMPT bug fix
Test: atest CtsDeqpTestCases --test-filter '*dEQP-EGL.functional.get_frame_timestamps*'
Test: Before fix http://ab/I51300010353712246
Test: After the fix http://ab/I22500010354940353
Change-Id: I33574b3ff347264a19e2e0bcfd2236639aad01a5
parent dfab5194
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3271,12 +3271,12 @@ void SurfaceFlinger::onCompositionPresented(PhysicalDisplayId pacesetterId,

    const auto schedule = mScheduler->getVsyncSchedule();
    const TimePoint vsyncDeadline = schedule->vsyncDeadlineAfter(presentTime);
    const Period vsyncPeriod = schedule->period();
    const Fps renderRate = pacesetterDisplay->refreshRateSelector().getActiveMode().fps;
    const nsecs_t vsyncPhase =
            mScheduler->getVsyncConfiguration().getCurrentConfigs().late.sfOffset;

    const CompositorTiming compositorTiming(vsyncDeadline.ns(), vsyncPeriod.ns(), vsyncPhase,
                                            presentLatency.ns());
    const CompositorTiming compositorTiming(vsyncDeadline.ns(), renderRate.getPeriodNsecs(),
                                            vsyncPhase, presentLatency.ns());

    ui::DisplayMap<ui::LayerStack, const DisplayDevice*> layerStackToDisplay;
    {