summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2021-01-07 17:56:08 -0800
committer Ady Abraham <adyabr@google.com> 2021-01-25 15:54:37 -0800
commit35018763c0098ce802d51408f77b13633128041c (patch)
tree82bb49bd09e322e3887ed9219114f54a4d8facab /services/surfaceflinger/SurfaceFlinger.cpp
parent20dcde8e35b003a82e4c14d39c76f93a16ec6e9d (diff)
SurfaceFlinger: handle high refresh rate deny list
Add visibility to SurfaceFlinger into the high refresh rate deny list and let SurfaceFlinger handle it. Previously WM was setting the preferredDisplayModeId on the denied app's window. The old way prevented SurfaceFlinger to use the frame rate override feature as it didn't know that a specific app is causing the refresh rate spec to be limited. With this change, SurfaceFlinger will limit the display refresh rate based on the high refresh rate deny list, and if possible, will use the frame rate override feature to change the display rate to a multiple, allowing other animations to be smooth while the denied app remains in the low refresh rate. Bug: 170502573 Test: SF unit tests Change-Id: Idc8a5fe6bc12dbd949ad5e09ff50e339ffaeac36
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0a51659681..c1fabf8322 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2920,7 +2920,9 @@ void SurfaceFlinger::initScheduler(PhysicalDisplayId primaryDisplayId) {
auto currentConfig = getHwComposer().getActiveMode(primaryDisplayId)->getId();
const auto modes = getHwComposer().getModes(primaryDisplayId);
- mRefreshRateConfigs = std::make_unique<scheduler::RefreshRateConfigs>(modes, currentConfig);
+ mRefreshRateConfigs = std::make_unique<
+ scheduler::RefreshRateConfigs>(modes, currentConfig,
+ android::sysprop::enable_frame_rate_override(true));
const auto& currRefreshRate = mRefreshRateConfigs->getRefreshRateFromConfigId(currentConfig);
mRefreshRateStats =
std::make_unique<scheduler::RefreshRateStats>(*mTimeStats, currRefreshRate.getFps(),
@@ -3873,7 +3875,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(
}
if (what & layer_state_t::eFrameRateChanged) {
if (ValidateFrameRate(s.frameRate, s.frameRateCompatibility,
- "SurfaceFlinger::setClientStateLocked") &&
+ "SurfaceFlinger::setClientStateLocked", privileged) &&
layer->setFrameRate(Layer::FrameRate(Fps(s.frameRate),
Layer::FrameRate::convertCompatibility(
s.frameRateCompatibility),