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

Commit b6818447 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SurfaceFlinger: do not choose POWER_SAVING as refresh rate"

parents fe5bede9 67968805
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -514,8 +514,13 @@ Scheduler::RefreshRateType Scheduler::calculateRefreshRateType() {
    // Content detection is on, find the appropriate refresh rate with minimal error
    // TODO(b/139751853): Scan allowed refresh rates only (SurfaceFlinger::mAllowedDisplayConfigs)
    const float rate = static_cast<float>(mFeatures.contentRefreshRate);
    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](const auto& lhs, const auto& rhs) -> bool {
                                return std::abs(lhs.second->fps - rate) <
                                        std::abs(rhs.second->fps - rate);