SF: Avoid forcing modeset during boot
When SF activates the primary display during boot, there is no need to
force setDesiredActiveMode, because DM is about to send its policy via
setDesiredDisplayModeSpecs.
Fixes: 269470715
Test: DisplayModeSwitchingTest.multiDisplay
Change-Id: I4b2ce528037d2f6820376581a44d47246e566040
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 015399c..cfcb4ed 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -7680,8 +7680,13 @@
const DisplayDevice& activeDisplay) {
ATRACE_CALL();
+ // For the first display activated during boot, there is no need to force setDesiredActiveMode,
+ // because DM is about to send its policy via setDesiredDisplayModeSpecs.
+ bool forceApplyPolicy = false;
+
if (inactiveDisplayPtr) {
inactiveDisplayPtr->getCompositionDisplay()->setLayerCachingTexturePoolEnabled(false);
+ forceApplyPolicy = true;
}
mActiveDisplayId = activeDisplay.getPhysicalId();
@@ -7698,8 +7703,8 @@
// that case, its preferred mode has not been propagated to HWC (via setDesiredActiveMode). In
// either case, the Scheduler's cachedModeChangedParams must be initialized to the newly active
// mode, and the kernel idle timer of the newly active display must be toggled.
- constexpr bool kForce = true;
- applyRefreshRateSelectorPolicy(mActiveDisplayId, activeDisplay.refreshRateSelector(), kForce);
+ applyRefreshRateSelectorPolicy(mActiveDisplayId, activeDisplay.refreshRateSelector(),
+ forceApplyPolicy);
}
status_t SurfaceFlinger::addWindowInfosListener(