SurfaceFlinger: define a known frame rates list
Keep a list of known frame rates that would be used when we calculated
heuristically the frame rate of a layer. This keeps the signal to the
algorithm that chooses the refresh rate steady and avoid strange
frame rates like 57.2 due to inconsistent presentation timestamps.
Bug: 157540021
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest
Change-Id: I97a24b74605256646e9b8444bd9f3818fe0a4a2a
diff --git a/services/surfaceflinger/tests/unittests/TestableScheduler.h b/services/surfaceflinger/tests/unittests/TestableScheduler.h
index 41b5d49..d5ecae8 100644
--- a/services/surfaceflinger/tests/unittests/TestableScheduler.h
+++ b/services/surfaceflinger/tests/unittests/TestableScheduler.h
@@ -31,7 +31,7 @@
TestableScheduler(const scheduler::RefreshRateConfigs& configs, bool useContentDetectionV2)
: Scheduler([](bool) {}, configs, *this, useContentDetectionV2, true) {
if (mUseContentDetectionV2) {
- mLayerHistory = std::make_unique<scheduler::impl::LayerHistoryV2>();
+ mLayerHistory = std::make_unique<scheduler::impl::LayerHistoryV2>(configs);
} else {
mLayerHistory = std::make_unique<scheduler::impl::LayerHistory>();
}
@@ -43,7 +43,7 @@
: Scheduler(std::move(primaryDispSync), std::move(eventControlThread), configs, *this,
useContentDetectionV2, true) {
if (mUseContentDetectionV2) {
- mLayerHistory = std::make_unique<scheduler::impl::LayerHistoryV2>();
+ mLayerHistory = std::make_unique<scheduler::impl::LayerHistoryV2>(configs);
} else {
mLayerHistory = std::make_unique<scheduler::impl::LayerHistory>();
}