SF: Extract VsyncConfig to its own header
...such that VsyncConfiguration does not depend on VsyncModulator.
Bug: 241285475
Bug: 241285191
Test: Build
Change-Id: I05b66a4ed2e6721b10ae90bdc6af2e49c22f2a59
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index cb3c94f..6a056d3 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3652,17 +3652,16 @@
void SurfaceFlinger::updatePhaseConfiguration(const Fps& refreshRate) {
mVsyncConfiguration->setRefreshRateFps(refreshRate);
setVsyncConfig(mVsyncModulator->setVsyncConfigSet(mVsyncConfiguration->getCurrentConfigs()),
- refreshRate.getPeriodNsecs());
+ refreshRate.getPeriod());
}
-void SurfaceFlinger::setVsyncConfig(const VsyncModulator::VsyncConfig& config,
- nsecs_t vsyncPeriod) {
+void SurfaceFlinger::setVsyncConfig(const scheduler::VsyncConfig& config, Period vsyncPeriod) {
mScheduler->setDuration(mAppConnectionHandle,
- /*workDuration=*/config.appWorkDuration,
- /*readyDuration=*/config.sfWorkDuration);
+ /* workDuration */ config.appWorkDuration,
+ /* readyDuration */ config.sfWorkDuration);
mScheduler->setDuration(mSfConnectionHandle,
- /*workDuration=*/std::chrono::nanoseconds(vsyncPeriod),
- /*readyDuration=*/config.sfWorkDuration);
+ /* workDuration */ vsyncPeriod,
+ /* readyDuration */ config.sfWorkDuration);
mScheduler->setDuration(config.sfWorkDuration);
}
@@ -4026,7 +4025,7 @@
const auto predictedPresentTime = TimePoint::fromNs(prediction->presentTime);
// The duration for which SF can delay a frame if it is considered early based on the
- // VsyncModulator::VsyncConfig::appWorkDuration.
+ // VsyncConfig::appWorkDuration.
if (constexpr std::chrono::nanoseconds kEarlyLatchMaxThreshold = 100ms;
std::chrono::abs(predictedPresentTime - expectedPresentTime) >= kEarlyLatchMaxThreshold) {
return false;