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

Commit dd5c2148 authored by ramindani's avatar ramindani Committed by Android Build Coastguard Worker
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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6b6d542c5c002e2247aacdb1aec79868c0c4a809)
Merged-In: I33574b3ff347264a19e2e0bcfd2236639aad01a5
Change-Id: I33574b3ff347264a19e2e0bcfd2236639aad01a5
parent 206ba410
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -3171,12 +3171,12 @@ void SurfaceFlinger::onCompositionPresented(PhysicalDisplayId pacesetterId,


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


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


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