[SF] Use the full frame rates range for supportedRefreshRates api
Test: atest android.display.cts.DisplayTest && atest RefreshRateSelectorTest
BUG: 380624084
Flag: EXEMPT bugfix
Change-Id: If5d3a23466666c4e6912bcec33cc8af4fcf2ecce
diff --git a/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp b/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
index 668fa54..97f1f8f 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
+++ b/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
@@ -1532,6 +1532,9 @@
mPrimaryFrameRates = filterRefreshRates(policy->primaryRanges, "primary");
mAppRequestFrameRates = filterRefreshRates(policy->appRequestRanges, "app request");
+ mAllFrameRates = filterRefreshRates(FpsRanges(getSupportedFrameRateRangeLocked(),
+ getSupportedFrameRateRangeLocked()),
+ "full frame rates");
}
bool RefreshRateSelector::isVrrDevice() const {
@@ -1560,16 +1563,24 @@
std::vector<float> RefreshRateSelector::getSupportedFrameRates() const {
std::scoped_lock lock(mLock);
// TODO(b/356986687) Remove the limit once we have the anchor list implementation.
- const size_t frameRatesSize = std::min<size_t>(11, mPrimaryFrameRates.size());
+ const size_t frameRatesSize = std::min<size_t>(11, mAllFrameRates.size());
std::vector<float> supportedFrameRates;
supportedFrameRates.reserve(frameRatesSize);
- std::transform(mPrimaryFrameRates.rbegin(),
- mPrimaryFrameRates.rbegin() + static_cast<int>(frameRatesSize),
+ std::transform(mAllFrameRates.rbegin(),
+ mAllFrameRates.rbegin() + static_cast<int>(frameRatesSize),
std::back_inserter(supportedFrameRates),
[](FrameRateMode mode) { return mode.fps.getValue(); });
return supportedFrameRates;
}
+FpsRange RefreshRateSelector::getSupportedFrameRateRangeLocked() const {
+ using fps_approx_ops::operator<;
+ if (mMaxRefreshRateModeIt->second->getPeakFps() < kMinSupportedFrameRate) {
+ return {mMaxRefreshRateModeIt->second->getPeakFps(), kMinSupportedFrameRate};
+ }
+ return {kMinSupportedFrameRate, mMaxRefreshRateModeIt->second->getPeakFps()};
+}
+
auto RefreshRateSelector::getIdleTimerAction() const -> KernelIdleTimerAction {
std::lock_guard lock(mLock);