SF: enable high refresh rate virtual mode

Add support for SF backdoor to set a multiplier
and divisor on the period for VSYNC-sf and
VSYNC-app from the primary DispSync object.

Bug: 111549030
Test: enable high refresh rate in devOptions and
view with systrace

Change-Id: I4226d5791d8d7ddeae1ad96577713c9c2141ed58
diff --git a/services/surfaceflinger/DispSync.h b/services/surfaceflinger/DispSync.h
index 1be131f..183966f 100644
--- a/services/surfaceflinger/DispSync.h
+++ b/services/surfaceflinger/DispSync.h
@@ -48,6 +48,7 @@
     virtual bool addResyncSample(nsecs_t timestamp) = 0;
     virtual void endResync() = 0;
     virtual void setPeriod(nsecs_t period) = 0;
+    virtual void scalePeriod(const uint32_t multiplier, uint32_t divisor) = 0;
     virtual nsecs_t getPeriod() = 0;
     virtual void setRefreshSkipCount(int count) = 0;
     virtual status_t addEventListener(const char* name, nsecs_t phase, Callback* callback) = 0;
@@ -117,6 +118,12 @@
     // turned on.  It should NOT be used after that.
     void setPeriod(nsecs_t period) override;
 
+    // The scalePeriod method applies the multiplier and divisor to
+    // scale the vsync event model's period.   The function is added
+    // for an experimental test mode and should not be used outside
+    // of that purpose.
+    void scalePeriod(const uint32_t multiplier, uint32_t divisor);
+
     // The getPeriod method returns the current vsync period.
     nsecs_t getPeriod() override;
 
@@ -176,6 +183,7 @@
     // mPeriod is the computed period of the modeled vsync events in
     // nanoseconds.
     nsecs_t mPeriod;
+    nsecs_t mPeriodBase;
 
     // mPhase is the phase offset of the modeled vsync events.  It is the
     // number of nanoseconds from time 0 to the first vsync event.