SF: Revamp frequencyScale backdoor
Update the frequencyScale backdoor (1029) to do a primary
display hot unplug-plug so that the updated frequency makes
it to the DisplayManager
Test: adb shell service call SurfaceFlinger 1029 i32 2 i32 3
Change-Id: Id93a5946ee19fbe9925789ba3294cbf213a52c30
diff --git a/services/surfaceflinger/Scheduler/DispSync.cpp b/services/surfaceflinger/Scheduler/DispSync.cpp
index 9d9acd3..54a1b51 100644
--- a/services/surfaceflinger/Scheduler/DispSync.cpp
+++ b/services/surfaceflinger/Scheduler/DispSync.cpp
@@ -521,16 +521,18 @@
mThread->updateModel(mPeriod, mPhase, mReferenceTime);
}
-void DispSync::scalePeriod(uint32_t multiplier, uint32_t divisor) {
+void DispSync::scalePeriod(HWC2::Device::FrequencyScaler frequencyScaler) {
Mutex::Autolock lock(mMutex);
// if only 1 of the properties is updated, we will get to this
// point "attempting" to set the scale to 1 when it is already
// 1. Check that special case so that we don't do a useless
// update of the model.
- if ((multiplier == 1) && (divisor == 1) && (mPeriod == mPeriodBase)) return;
+ if ((frequencyScaler.multiplier == 1) &&
+ (frequencyScaler.divisor == 1) &&
+ (mPeriod == mPeriodBase)) return;
- mPeriod = mPeriodBase * multiplier / divisor;
+ mPeriod = mPeriodBase * frequencyScaler.multiplier / frequencyScaler.divisor;
mThread->updateModel(mPeriod, mPhase, mReferenceTime);
}