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

Commit 13cfb366 authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: minor fix to RefreshRateConfigs

Incorporating code review feedback from qpr btanch.

Bug: 242283390
Test: SF unit tests
Change-Id: Icd2e562909768be43aea6fc8491aba64a782dd92
parent 0b2413f6
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -431,7 +431,7 @@ auto RefreshRateConfigs::getBestRefreshRateLocked(const std::vector<LayerRequire
                    calculateLayerScoreLocked(layer, mode->getFps(), isSeamlessSwitch);
                    calculateLayerScoreLocked(layer, mode->getFps(), isSeamlessSwitch);
            const float weightedLayerScore = weight * layerScore;
            const float weightedLayerScore = weight * layerScore;


            // Layer with fixed source has a special consideration depends on the
            // Layer with fixed source has a special consideration which depends on the
            // mConfig.frameRateMultipleThreshold. We don't want these layers to score
            // mConfig.frameRateMultipleThreshold. We don't want these layers to score
            // refresh rates above the threshold, but we also don't want to favor the lower
            // refresh rates above the threshold, but we also don't want to favor the lower
            // ones by having a greater number of layers scoring them. Instead, we calculate
            // ones by having a greater number of layers scoring them. Instead, we calculate
@@ -454,9 +454,9 @@ auto RefreshRateConfigs::getBestRefreshRateLocked(const std::vector<LayerRequire
            const bool layerBelowThreshold = mConfig.frameRateMultipleThreshold != 0 &&
            const bool layerBelowThreshold = mConfig.frameRateMultipleThreshold != 0 &&
                    layer.desiredRefreshRate <
                    layer.desiredRefreshRate <
                            Fps::fromValue(mConfig.frameRateMultipleThreshold / 2);
                            Fps::fromValue(mConfig.frameRateMultipleThreshold / 2);
            const bool modeAboveThreshold = layerBelowThreshold &&
                    mode->getFps() >= Fps::fromValue(mConfig.frameRateMultipleThreshold);
            if (fixedSourceLayer && layerBelowThreshold) {
            if (fixedSourceLayer && layerBelowThreshold) {
                const bool modeAboveThreshold =
                        mode->getFps() >= Fps::fromValue(mConfig.frameRateMultipleThreshold);
                if (modeAboveThreshold) {
                if (modeAboveThreshold) {
                    ALOGV("%s gives %s fixed source (above threshold) score of %.4f",
                    ALOGV("%s gives %s fixed source (above threshold) score of %.4f",
                          formatLayerInfo(layer, weight).c_str(), to_string(mode->getFps()).c_str(),
                          formatLayerInfo(layer, weight).c_str(), to_string(mode->getFps()).c_str(),