Revert "Revert "Revert "SF: Remove refresh_rate_switching flag."""
This reverts commit aa52b007cb5c96d6124a293ca80c430c7051f7f3.
Reason for revert: The original revert cause a failure: b/148821456. So the revert was created. Which caused a build failure b/148835312. Reverting the original change and fixing the test (that caused build failure) with it.
Bug: 148835312
Bug: 148821456
Bug: 148835894
Test: build, install on coral.
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest
Change-Id: I48964c7c27ef53e8fb03d959ef85ee2ec64e1ed1
diff --git a/services/surfaceflinger/Scheduler/RefreshRateConfigs.h b/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
index fc95959..c4dea0d 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
@@ -164,9 +167,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:
@@ -204,6 +208,8 @@
const RefreshRate* mMinSupportedRefreshRate;
const RefreshRate* mMaxSupportedRefreshRate;
+ const bool mRefreshRateSwitching;
+
mutable std::mutex mLock;
};