Add MRR guard logic to SF scheduler
Uses a flag to guard the new dVRR scheduler features
from MRR devices. This is to easily allow development on
dVRR devices and MRR devices separately.
Bug: 330224639
Test: atest libsurfaceflinger_unittest
Test: atest CtsSurfaceControlTestsStaging
Test: dumpsys and observe no category or GTE
Change-Id: I8be520b5630c1a8fbde5f0fb2265e803e46983a8
diff --git a/services/surfaceflinger/Scheduler/RefreshRateSelector.h b/services/surfaceflinger/Scheduler/RefreshRateSelector.h
index 6051e89..a6b0236 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateSelector.h
+++ b/services/surfaceflinger/Scheduler/RefreshRateSelector.h
@@ -406,6 +406,8 @@
std::chrono::milliseconds getIdleTimerTimeout();
+ bool isVrrDevice() const;
+
private:
friend struct TestableRefreshRateSelector;
@@ -513,6 +515,9 @@
std::vector<FrameRateMode> mPrimaryFrameRates GUARDED_BY(mLock);
std::vector<FrameRateMode> mAppRequestFrameRates GUARDED_BY(mLock);
+ // Caches whether the device is VRR-compatible based on the active display mode.
+ bool mIsVrrDevice GUARDED_BY(mLock) = false;
+
Policy mDisplayManagerPolicy GUARDED_BY(mLock);
std::optional<Policy> mOverridePolicy GUARDED_BY(mLock);