SF: configure idle timer based on display id
Use the DisplayId when reading the timer configuration from system
properties.
Bug: 188838426
Test: check idle timer can be set separately for each display based
on display id
Change-Id: I9051374a78d99676ace7f1ded6accc8a50b17c79
diff --git a/services/surfaceflinger/Scheduler/RefreshRateConfigs.h b/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
index 0f0fe22..2addc83 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
+++ b/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
@@ -307,14 +307,18 @@
// no threshold is set.
int frameRateMultipleThreshold = 0;
+ // The Idle Timer timeout. 0 timeout means no idle timer.
+ int32_t idleTimerTimeoutMs = 0;
+
// Whether to use idle timer callbacks that support the kernel timer.
- bool supportKernelTimer = false;
+ bool supportKernelIdleTimer = false;
};
- RefreshRateConfigs(const DisplayModes& modes, DisplayModeId currentModeId,
+ RefreshRateConfigs(const DisplayModes&, DisplayModeId,
Config config = {.enableFrameRateOverride = false,
.frameRateMultipleThreshold = 0,
- .supportKernelTimer = false});
+ .idleTimerTimeoutMs = 0,
+ .supportKernelIdleTimer = false});
// Returns whether switching modes (refresh rate or resolution) is possible.
// TODO(b/158780872): Consider HAL support, and skip frame rate detection if the modes only
@@ -350,7 +354,7 @@
Fps displayFrameRate, bool touch) const
EXCLUDES(mLock);
- bool supportsKernelIdleTimer() const { return mConfig.supportKernelTimer; }
+ bool supportsKernelIdleTimer() const { return mConfig.supportKernelIdleTimer; }
void setIdleTimerCallbacks(std::function<void()> platformTimerReset,
std::function<void()> platformTimerExpired,
@@ -368,7 +372,7 @@
if (!mIdleTimer) {
return;
}
- if (kernelOnly && !mConfig.supportKernelTimer) {
+ if (kernelOnly && !mConfig.supportKernelIdleTimer) {
return;
}
mIdleTimer->reset();