Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43e23093 authored by Ady Abraham's avatar Ady Abraham Committed by android-build-merger
Browse files

SurfaceFlinger: do not choose POWER_SAVING as refresh rate

am: 7e5db1d1

Change-Id: Ic5285d3a8ae62034146c2ca2c0d652781c5fca05
parents 1d177631 7e5db1d1
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -567,8 +567,13 @@ Scheduler::RefreshRateType Scheduler::calculateRefreshRateType() {
    }

    // Content detection is on, find the appropriate refresh rate with minimal error
    auto iter = min_element(mRefreshRateConfigs.getRefreshRates().cbegin(),
                            mRefreshRateConfigs.getRefreshRates().cend(),
    auto begin = mRefreshRateConfigs.getRefreshRates().cbegin();

    // Skip POWER_SAVING config as it is not a real config
    if (begin->first == RefreshRateType::POWER_SAVING) {
        ++begin;
    }
    auto iter = min_element(begin, mRefreshRateConfigs.getRefreshRates().cend(),
                            [rate = mContentRefreshRate](const auto& l, const auto& r) -> bool {
                                return std::abs(l.second->fps - static_cast<float>(rate)) <
                                        std::abs(r.second->fps - static_cast<float>(rate));