SF: Reset VsyncModulator on active display change
Between VsyncModulator::onRefreshRateChange{Initiated,Completed}, if the
active display changes, the newly active display's VsyncConfiguration is
propagated to VsyncModulator via updatePhaseConfiguration, which selects
VsyncConfigType::Early due to the `mRefreshRateChangePending` of the now
inactive display.
Clear `mRefreshRateChangePending` and let `onRefreshRateChangeInitiated`
set it for the newly active display if needed.
In practice, the end result is the same due to the forced modeset for an
active display that was just powered on. However, this will no longer be
true with concurrent displays when the new pacesetter is already powered
on.
Bug: 255635821
Test: DisplayModeSwitchingTest.multiDisplay
Change-Id: If264742a107cf5839d2c820eab23712778c1ae2e
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index b353a48..0d297b9 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -736,6 +736,8 @@
void updateCursorAsync();
void initScheduler(const sp<const DisplayDevice>&) REQUIRES(kMainThreadContext, mStateLock);
+
+ void resetPhaseConfiguration(Fps) REQUIRES(mStateLock, kMainThreadContext);
void updatePhaseConfiguration(Fps) REQUIRES(mStateLock);
/*
@@ -1120,9 +1122,6 @@
std::chrono::nanoseconds presentLatency);
int getMaxAcquiredBufferCountForRefreshRate(Fps refreshRate) const;
- void updateActiveDisplayVsyncLocked(const DisplayDevice& activeDisplay)
- REQUIRES(mStateLock, kMainThreadContext);
-
bool isHdrLayer(const frontend::LayerSnapshot& snapshot) const;
ui::Rotation getPhysicalDisplayOrientation(DisplayId, bool isPrimary) const