SF Adds powerOnImminent to the GlobalSignals

This helps with moving the refresh rate selection into
RefreshRateConfigs instead of calling from Scheduler.

BUG: 240743471
Test: atest libsurfaceflinger_unittest
Change-Id: I4dba607e82ddb139be3daebe7f5c764fd5ae418c
diff --git a/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp b/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp
index d270655..00886f0 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp
+++ b/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp
@@ -280,6 +280,15 @@
     ATRACE_CALL();
     ALOGV("%s: %zu layers", __func__, layers.size());
 
+    const auto& activeMode = *getActiveModeItLocked()->second;
+
+    // Keep the display at max refresh rate for the duration of powering on the display.
+    if (signals.powerOnImminent) {
+        ALOGV("Power On Imminent");
+        const auto& max = getMaxRefreshRateByPolicyLocked(activeMode.getGroup());
+        return {max, GlobalSignals{.powerOnImminent = true}};
+    }
+
     int noVoteLayers = 0;
     int minVoteLayers = 0;
     int maxVoteLayers = 0;
@@ -326,7 +335,6 @@
 
     const Policy* policy = getCurrentPolicyLocked();
     const auto& defaultMode = mDisplayModes.get(policy->defaultMode)->get();
-    const auto& activeMode = *getActiveModeItLocked()->second;
 
     // If the default mode group is different from the group of current mode,
     // this means a layer requesting a seamed mode switch just disappeared and