SF: hwvsync on for more samples on recalibration
Decrease the amount of time that the VSyncPredictor is using the
idealPeriod (ie, the hwc-reported period) by leaving hwVsync on until
there's enough info (4 additional pulses) to infer device's
measured/actual period.
This will benefit frames that come intermittently, as the vsync's
cumulative error over the larger time gap will be smaller, giving the
timer a better chance of landing closer to the vsync signal when those
one-off frames come in.
Test: 3 new unit tests, 2 other tests modified in substance.
Test: dogfooding
Test: uibench
Fixes: 159896971
Change-Id: Ic3190822e38c5a24d3445ea89ef6d7e34a590077
diff --git a/services/surfaceflinger/Scheduler/VSyncPredictor.h b/services/surfaceflinger/Scheduler/VSyncPredictor.h
index 3ca878d..5f3c418 100644
--- a/services/surfaceflinger/Scheduler/VSyncPredictor.h
+++ b/services/surfaceflinger/Scheduler/VSyncPredictor.h
@@ -52,11 +52,10 @@
*/
void setPeriod(nsecs_t period) final;
- /* Query if the model is in need of more samples to make a prediction at timePoint.
- * \param [in] timePoint The timePoint to inquire of.
+ /* Query if the model is in need of more samples to make a prediction.
* \return True, if model would benefit from more samples, False if not.
*/
- bool needsMoreSamples(nsecs_t timePoint) const;
+ bool needsMoreSamples() const final;
std::tuple<nsecs_t /* slope */, nsecs_t /* intercept */> getVSyncPredictionModel() const;