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/Scheduler/VsyncModulator.h b/services/surfaceflinger/Scheduler/VsyncModulator.h
index 537cae1..4b01ec3 100644
--- a/services/surfaceflinger/Scheduler/VsyncModulator.h
+++ b/services/surfaceflinger/Scheduler/VsyncModulator.h
@@ -25,6 +25,8 @@
#include <binder/IBinder.h>
#include <utils/Timers.h>
+#include <scheduler/VsyncConfig.h>
+
#include "../WpHash.h"
namespace android::scheduler {
@@ -51,39 +53,8 @@
// This may keep early offsets for an extra frame, but avoids a race with transaction commit.
static const std::chrono::nanoseconds MIN_EARLY_TRANSACTION_TIME;
- // Phase offsets and work durations for SF and app deadlines from VSYNC.
- struct VsyncConfig {
- nsecs_t sfOffset;
- nsecs_t appOffset;
- std::chrono::nanoseconds sfWorkDuration;
- std::chrono::nanoseconds appWorkDuration;
-
- bool operator==(const VsyncConfig& other) const {
- return sfOffset == other.sfOffset && appOffset == other.appOffset &&
- sfWorkDuration == other.sfWorkDuration &&
- appWorkDuration == other.appWorkDuration;
- }
-
- bool operator!=(const VsyncConfig& other) const { return !(*this == other); }
- };
-
using VsyncConfigOpt = std::optional<VsyncConfig>;
- struct VsyncConfigSet {
- VsyncConfig early; // Used for early transactions, and during refresh rate change.
- VsyncConfig earlyGpu; // Used during GPU composition.
- VsyncConfig late; // Default.
- std::chrono::nanoseconds hwcMinWorkDuration; // Used for calculating the
- // earliest present time
-
- bool operator==(const VsyncConfigSet& other) const {
- return early == other.early && earlyGpu == other.earlyGpu && late == other.late &&
- hwcMinWorkDuration == other.hwcMinWorkDuration;
- }
-
- bool operator!=(const VsyncConfigSet& other) const { return !(*this == other); }
- };
-
using Clock = std::chrono::steady_clock;
using TimePoint = Clock::time_point;
using Now = TimePoint (*)();