DO_NOT_MERGE Fix primaryRangeIsSingleRate + touch on dVRR
Disable a primaryRangeIsSingleRate section on dVRR and allow late touch
boost to trigger when no layer score. On dVRR display, the primary
physical range may be a single rate,
but late touch boost should still be able to trigger.
Bug: 353142444
Bug: 362379874
Flag: EXEMPT_bugfix
Test: atest libsurfaceflinger_unittest
Test: Twitter scrolling with and without video, with policy backdoor
Test: notification shade scrolling with policy backdoor
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7bedfbf0d7b106702a241a64a79c36205606496c)
Merged-In: Ic5b2b298fe0df357f77ef8f06b1fc0fc248e0498
Change-Id: Ic5b2b298fe0df357f77ef8f06b1fc0fc248e0498
diff --git a/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp b/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
index dd86e4f..bbb3c52 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
+++ b/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
@@ -841,7 +841,8 @@
return score.overallScore == 0;
});
- if (policy->primaryRangeIsSingleRate()) {
+ // TODO(b/364651864): Evaluate correctness of primaryRangeIsSingleRate.
+ if (!mIsVrrDevice.load() && policy->primaryRangeIsSingleRate()) {
// If we never scored any layers, then choose the rate from the primary
// range instead of picking a random score from the app range.
if (noLayerScore) {
@@ -887,8 +888,8 @@
const auto touchRefreshRates = rankFrameRates(anchorGroup, RefreshRateOrder::Descending);
using fps_approx_ops::operator<;
- if (scores.front().frameRateMode.fps < touchRefreshRates.front().frameRateMode.fps) {
- ALOGV("Touch Boost");
+ if (scores.front().frameRateMode.fps <= touchRefreshRates.front().frameRateMode.fps) {
+ ALOGV("Touch Boost [late]");
ATRACE_FORMAT_INSTANT("%s (Touch Boost [late])",
to_string(touchRefreshRates.front().frameRateMode.fps).c_str());
return {touchRefreshRates, GlobalSignals{.touch = true}};