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

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

Merge "NoPreference does not supercede Game default override" into main

parents fc48edc7 7382ddc8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -308,6 +308,12 @@ void LayerHistory::partitionLayers(nsecs_t now, bool isVrrDevice) {
                const auto setFrameRateVoteType =
                        info->isVisible() ? voteType : LayerVoteType::NoVote;

                const bool hasSetFrameRateOpinion = frameRate.isValid() && !frameRate.isNoVote();
                const bool hasCategoryOpinion =
                        frameRate.category != FrameRateCategory::NoPreference &&
                        frameRate.category != FrameRateCategory::Default;
                const bool hasFrameRateOpinion = hasSetFrameRateOpinion || hasCategoryOpinion;

                if (gameModeFrameRateOverride.isValid()) {
                    info->setLayerVote({gameFrameRateOverrideVoteType, gameModeFrameRateOverride});
                    SFTRACE_FORMAT_INSTANT("GameModeFrameRateOverride");
@@ -315,7 +321,7 @@ void LayerHistory::partitionLayers(nsecs_t now, bool isVrrDevice) {
                        trace(*info, gameFrameRateOverrideVoteType,
                              gameModeFrameRateOverride.getIntValue());
                    }
                } else if (frameRate.isValid() && frameRate.isVoteValidForMrr(isVrrDevice)) {
                } else if (hasFrameRateOpinion && frameRate.isVoteValidForMrr(isVrrDevice)) {
                    info->setLayerVote({setFrameRateVoteType,
                                        isValuelessVote ? 0_Hz : frameRate.vote.rate,
                                        frameRate.vote.seamlessness, frameRate.category});
@@ -332,7 +338,7 @@ void LayerHistory::partitionLayers(nsecs_t now, bool isVrrDevice) {
                              gameDefaultFrameRateOverride.getIntValue());
                    }
                } else {
                    if (frameRate.isValid() && !frameRate.isVoteValidForMrr(isVrrDevice)) {
                    if (hasFrameRateOpinion && !frameRate.isVoteValidForMrr(isVrrDevice)) {
                        SFTRACE_FORMAT_INSTANT("Reset layer to ignore explicit vote on MRR %s: %s "
                                               "%s %s",
                                               info->getName().c_str(),