From 80e8cfe3d73baecc749dba0de0bd7f96c17a5eec Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Fri, 29 Sep 2023 17:03:45 -0700 Subject: [sf-newfe] update default frame rate compatibility Bug: 300701739 Test: presubmit Change-Id: I3dbfd8d7ef6fe801d4d750c1828d09da511ce283 --- services/surfaceflinger/SurfaceFlinger.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 3f52444c40..4d8dc94db5 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2205,8 +2205,12 @@ bool SurfaceFlinger::updateLayerSnapshotsLegacy(VsyncId vsyncId, nsecs_t frameTi void SurfaceFlinger::updateLayerHistory(const frontend::LayerSnapshot& snapshot) { using Changes = frontend::RequestedLayerState::Changes; - if (snapshot.path.isClone() || - !snapshot.changes.any(Changes::FrameRate | Changes::Buffer | Changes::Animation)) { + if (snapshot.path.isClone()) { + return; + } + + if (!snapshot.changes.any(Changes::FrameRate | Changes::Buffer | Changes::Animation) && + (snapshot.clientChanges & layer_state_t::eDefaultFrameRateCompatibilityChanged) == 0) { return; } @@ -2226,6 +2230,11 @@ void SurfaceFlinger::updateLayerHistory(const frontend::LayerSnapshot& snapshot) it->second->recordLayerHistoryAnimationTx(layerProps); } + if (snapshot.clientChanges & layer_state_t::eDefaultFrameRateCompatibilityChanged) { + mScheduler->setDefaultFrameRateCompatibility(snapshot.sequence, + snapshot.defaultFrameRateCompatibility); + } + if (snapshot.changes.test(Changes::FrameRate)) { it->second->setFrameRateForLayerTree(snapshot.frameRate, layerProps); } -- cgit v1.2.3-59-g8ed1b