Add smooth switch bool for setFrameRateCategory
This allows the platform to have a different behavior depending on
whether a device is MRR or dVRR. When the bool is `true`, MRR devices
(those with DisplayModes that do not have vrr config) will not change
frame rates if it would cause jank. The expected usage is to mark the
bool true when an animation is running.
Bug: 300491171
Test: atest libsurfaceflinger_unittest
Change-Id: I5e87d276c11ecc806ede3e943f0a6498a7b910c4
diff --git a/services/surfaceflinger/Scheduler/LayerInfo.h b/services/surfaceflinger/Scheduler/LayerInfo.h
index d580b58..7d3cffa 100644
--- a/services/surfaceflinger/Scheduler/LayerInfo.h
+++ b/services/surfaceflinger/Scheduler/LayerInfo.h
@@ -71,8 +71,8 @@
LayerHistory::LayerVoteType type = LayerHistory::LayerVoteType::Heuristic;
Fps fps;
Seamlessness seamlessness = Seamlessness::Default;
- // Category is in effect if fps is not specified.
FrameRateCategory category = FrameRateCategory::Default;
+ bool categorySmoothSwitchOnly = false;
// Returns true if the layer explicitly should contribute to frame rate scoring.
bool isNoVote() const { return RefreshRateSelector::isNoVote(type); }
@@ -111,6 +111,7 @@
} vote;
FrameRateCategory category = FrameRateCategory::Default;
+ bool categorySmoothSwitchOnly = false;
FrameRate() = default;