From dd5c2148e97dcf68577a84d6162618e0e5ce4936 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 14 Jan 2025 09:33:08 -0800 Subject: [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 --- services/surfaceflinger/SurfaceFlinger.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index d7d567c6c3..896d13d31d 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3171,12 +3171,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 layerStackToDisplay; { -- cgit v1.2.3-59-g8ed1b