Skip to content

Commit dd5c214

Browse files
ramindaniAndroid Build Coastguard Worker
authored andcommitted
[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
1 parent 206ba41 commit dd5c214

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,12 +3171,12 @@ void SurfaceFlinger::onCompositionPresented(PhysicalDisplayId pacesetterId,
31713171

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

3178-
const CompositorTiming compositorTiming(vsyncDeadline.ns(), vsyncPeriod.ns(), vsyncPhase,
3179-
presentLatency.ns());
3178+
const CompositorTiming compositorTiming(vsyncDeadline.ns(), renderRate.getPeriodNsecs(),
3179+
vsyncPhase, presentLatency.ns());
31803180

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

0 commit comments

Comments
 (0)