Revert "SF: Remove refresh_rate_switching flag."
This reverts commit 8c6f3f6bd0c5edce7aa9bfd61b64dd2e7dc43deb.
Reason for revert: Crashes on ToT (b/148822765, b/148821456)
Change-Id: If1bc13b33321727244c3b0f15a0e7b30665d1c43
diff --git a/services/surfaceflinger/Scheduler/RefreshRateConfigs.h b/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
index c762efd..80d42cc 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
+++ b/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
@@ -94,6 +94,9 @@
// Returns true if config is allowed by the current policy.
bool isConfigAllowed(HwcConfigIndexType config) const EXCLUDES(mLock);
+ // Returns true if this device is doing refresh rate switching. This won't change at runtime.
+ bool refreshRateSwitchingSupported() const { return mRefreshRateSwitching; }
+
// Describes the different options the layer voted for refresh rate
enum class LayerVoteType {
NoVote, // Doesn't care about the refresh rate
@@ -161,9 +164,10 @@
nsecs_t vsyncPeriod = 0;
};
- RefreshRateConfigs(const std::vector<InputConfig>& configs,
+ RefreshRateConfigs(bool refreshRateSwitching, const std::vector<InputConfig>& configs,
HwcConfigIndexType currentHwcConfig);
- RefreshRateConfigs(const std::vector<std::shared_ptr<const HWC2::Display::Config>>& configs,
+ RefreshRateConfigs(bool refreshRateSwitching,
+ const std::vector<std::shared_ptr<const HWC2::Display::Config>>& configs,
HwcConfigIndexType currentConfigId);
private:
@@ -201,6 +205,8 @@
const RefreshRate* mMinSupportedRefreshRate;
const RefreshRate* mMaxSupportedRefreshRate;
+ const bool mRefreshRateSwitching;
+
mutable std::mutex mLock;
};