Set frame rate GTE to Max for MRR
For animation, scroll/fling, and other velocity, the frame rate might
change after start, which can be specified with GTE setFrameRate.
However changing display refresh rate on an MRR
device will jank, so the stand-in solution is to equate GTE votes to Max
for MRR.
Bug: 330222554
Test: atest libsurfaceflinger_unittest
Test: ABTD
Change-Id: I95dda0048ed6ac749c226221f708bd1303924fdb
diff --git a/services/surfaceflinger/Scheduler/LayerInfo.cpp b/services/surfaceflinger/Scheduler/LayerInfo.cpp
index 5f17128..21b72472 100644
--- a/services/surfaceflinger/Scheduler/LayerInfo.cpp
+++ b/services/surfaceflinger/Scheduler/LayerInfo.cpp
@@ -563,8 +563,25 @@
return vote.type == FrameRateCompatibility::NoVote;
}
+bool LayerInfo::FrameRate::isValuelessType() const {
+ // For a valueless frame rate compatibility (type), the frame rate should be unspecified (0 Hz).
+ if (!isApproxEqual(vote.rate, 0_Hz)) {
+ return false;
+ }
+ switch (vote.type) {
+ case FrameRateCompatibility::Min:
+ case FrameRateCompatibility::NoVote:
+ return true;
+ case FrameRateCompatibility::Default:
+ case FrameRateCompatibility::ExactOrMultiple:
+ case FrameRateCompatibility::Exact:
+ case FrameRateCompatibility::Gte:
+ return false;
+ }
+}
+
bool LayerInfo::FrameRate::isValid() const {
- return isNoVote() || vote.rate.isValid() || category != FrameRateCategory::Default;
+ return isValuelessType() || vote.rate.isValid() || category != FrameRateCategory::Default;
}
bool LayerInfo::FrameRate::isVoteValidForMrr(bool isVrrDevice) const {
@@ -572,7 +589,7 @@
return true;
}
- if (category == FrameRateCategory::Default && vote.type != FrameRateCompatibility::Gte) {
+ if (category == FrameRateCategory::Default) {
return true;
}