SurfaceFlinger: call to changeRefreshRate on state change only
Check if Scheduler's idle timer / content detection changed before
calling to changeRefreshRate to avoid sending config changed events when
those are not neeed.
Test: scroll within calendar app and observe systraces
Bug: 130759239
Change-Id: If7bce0ac096630918decbf62c568baa5e17408f2
diff --git a/services/surfaceflinger/Scheduler/Scheduler.h b/services/surfaceflinger/Scheduler/Scheduler.h
index 134dc0b..34327b5 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.h
+++ b/services/surfaceflinger/Scheduler/Scheduler.h
@@ -193,8 +193,6 @@
void expiredTimerCallback();
// Sets vsync period.
void setVsyncPeriod(const nsecs_t period);
- // Media feature's function to change the refresh rate.
- void contentChangeRefreshRate(ContentFeatureState contentFeatureState, uint32_t refreshRate);
// Idle timer feature's function to change the refresh rate.
void timerChangeRefreshRate(IdleTimerState idleTimerState);
// Calculate the new refresh rate type
@@ -254,7 +252,8 @@
ContentFeatureState mCurrentContentFeatureState GUARDED_BY(mFeatureStateLock) =
ContentFeatureState::CONTENT_DETECTION_OFF;
IdleTimerState mCurrentIdleTimerState GUARDED_BY(mFeatureStateLock) = IdleTimerState::RESET;
- uint32_t mContentRefreshRate;
+ uint32_t mContentRefreshRate GUARDED_BY(mFeatureStateLock);
+ RefreshRateType mRefreshRateType GUARDED_BY(mFeatureStateLock);
const scheduler::RefreshRateConfigs& mRefreshRateConfigs;
};