SurfaceFlinger: add a sysprop to ignore present fences
Emulation platform doesn't have accurate present fences.
If VSR is using the the timestamp from these present fences,
then the calculated timeline is jittery and inaccurate.
This change adds a new sysprop,
debug.sf.vsync_reactor_ignore_present_fences, that indicates
VSR to ignore present fences and instead use the vsync callbacks
to calculate the timeline.
Bug: 163165662
Test: Running emulation and collecting systraces
Change-Id: I8785b36d805e08d2cb340e3c15aa2ce4003843db
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index bd43b77..c14e8c8 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3009,6 +3009,11 @@
mRefreshRateConfigs->getRefreshRateFromConfigId(currentConfig).getVsyncPeriod();
mScheduler->onPrimaryDisplayConfigChanged(mAppConnectionHandle, primaryDisplayId, currentConfig,
vsyncPeriod);
+ static auto ignorePresentFences =
+ base::GetBoolProperty("debug.sf.vsync_reactor_ignore_present_fences"s, false);
+ mScheduler->setIgnorePresentFences(
+ ignorePresentFences ||
+ getHwComposer().hasCapability(hal::Capability::PRESENT_FENCE_IS_NOT_RELIABLE));
}
void SurfaceFlinger::updatePhaseConfiguration(const RefreshRate& refreshRate) {