diff options
author | 2024-11-07 02:21:30 +0000 | |
---|---|---|
committer | 2024-11-07 02:21:30 +0000 | |
commit | fc843d36f8f8f979fb6542d4f7b29f7e0ef51d02 (patch) | |
tree | cf23061a258403f7e6c245175bf98b338f02dcd3 | |
parent | fc48edc76ed0897b3108439c0ae299e4513765a3 (diff) | |
parent | 7382ddc81c6145267b8579a4ba98a6812944d67e (diff) |
Merge "NoPreference does not supercede Game default override" into main
-rw-r--r-- | services/surfaceflinger/Scheduler/LayerHistory.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/surfaceflinger/Scheduler/LayerHistory.cpp b/services/surfaceflinger/Scheduler/LayerHistory.cpp index 64b85c080e..e45bdfce13 100644 --- a/services/surfaceflinger/Scheduler/LayerHistory.cpp +++ b/services/surfaceflinger/Scheduler/LayerHistory.cpp @@ -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(), |