diff options
author | 2018-07-13 12:59:48 -0700 | |
---|---|---|
committer | 2018-08-07 12:36:42 -0700 | |
commit | 6d46c1e2bb6ac6a90c7cb4993e920443a6fcecfe (patch) | |
tree | 5fa34eccc6b882c5e86f3ab7542bad2e6103761c /services/surfaceflinger/SurfaceFlinger.cpp | |
parent | 0c2a6f8cc9d5be9e93f247cdbe55729972b8a270 (diff) |
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
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 31e44449b3..1c12bd5b96 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -4855,6 +4855,33 @@ status_t SurfaceFlinger::onTransact( reply->writeBool(getBE().mHwc->isUsingVrComposer()); return NO_ERROR; } + case 1029: { + // Code 1029 is an experimental feature that allows applications to + // simulate a high frequency panel by setting a multiplier and divisor + // on the VSYNC-sf clock. If either the multiplier or divisor are + // 0, then the code will set both to 1 to return the VSYNC-sf clock + // to it's normal frequency. + int multiplier = data.readInt32(); + int divisor = data.readInt32(); + + if ((multiplier == 0) || (divisor == 0)) { + multiplier = 1; + divisor = 1; + } + + if ((multiplier == 1) && (divisor == 1)) { + enableHardwareVsync(); + } else { + disableHardwareVsync(true); + } + getBE().mHwc->getActiveConfig(DisplayDevice::DISPLAY_PRIMARY) + ->scalePanelFrequency(multiplier, divisor); + mPrimaryDispSync->scalePeriod(multiplier, divisor); + + ATRACE_INT("PeriodMultiplier", multiplier); + ATRACE_INT("PeriodDivisor", divisor); + return NO_ERROR; + } } } return err; |