SurfaceFlinger: fix Sf/App offsets provided in getDisplayConfigs()
In getDisplayConfigs() SF needs to return the corresponding offsets
based on the config it is requested for and not the current config.
Test: manual
Fixes: 130257355
Change-Id: Ie151701cb8765c8bdaea683f328d9c43065ba6b0
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index fb0c712..716da12 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -860,7 +860,9 @@
info.xdpi = xdpi;
info.ydpi = ydpi;
info.fps = 1e9 / hwConfig->getVsyncPeriod();
- info.appVsyncOffset = mPhaseOffsets->getCurrentAppOffset();
+ const auto refreshRateType = mRefreshRateConfigs.getRefreshRateType(hwConfig->getId());
+ const auto offset = mPhaseOffsets->getOffsetsForRefreshRate(refreshRateType);
+ info.appVsyncOffset = offset.late.app;
// This is how far in advance a buffer must be queued for
// presentation at a given time. If you want a buffer to appear
@@ -874,8 +876,7 @@
//
// We add an additional 1ms to allow for processing time and
// differences between the ideal and actual refresh rate.
- info.presentationDeadline =
- hwConfig->getVsyncPeriod() - mPhaseOffsets->getCurrentSfOffset() + 1000000;
+ info.presentationDeadline = hwConfig->getVsyncPeriod() - offset.late.sf + 1000000;
// All non-virtual displays are currently considered secure.
info.secure = true;