SurfaceFlinger: fix refresh rate override when changing refresh rate
If an app's frame rate is same as the display refresh rate, keep it
on the frame rate override list. The reason for this is if an app
is added to the list after the display refresh rate changed, the few
first frames would be running the the display refresh rate and not at
the override one.
Test: atest FrameRateOverrideHostTest
Test: run TouchLatency while changing refresh rates and collect systrace
Bug: 182544360
Change-Id: I66472a1230affae9336520083f0950ae252ede02
diff --git a/services/surfaceflinger/Scheduler/VSyncTracker.h b/services/surfaceflinger/Scheduler/VSyncTracker.h
index 2cd9b3d..95750ad 100644
--- a/services/surfaceflinger/Scheduler/VSyncTracker.h
+++ b/services/surfaceflinger/Scheduler/VSyncTracker.h
@@ -17,6 +17,7 @@
#pragma once
#include <utils/Timers.h>
+#include "Fps.h"
#include "VSyncDispatch.h"
namespace android::scheduler {
@@ -69,12 +70,12 @@
virtual bool needsMoreSamples() const = 0;
/*
- * Checks if a vsync timestamp is in phase for a given divider.
+ * Checks if a vsync timestamp is in phase for a frame rate
*
* \param [in] timePoint A vsync timestamp
- * \param [in] divider The divider to check for
+ * \param [in] frameRate The frame rate to check for
*/
- virtual bool isVSyncInPhase(nsecs_t timePoint, int divider) const = 0;
+ virtual bool isVSyncInPhase(nsecs_t timePoint, Fps frameRate) const = 0;
virtual void dump(std::string& result) const = 0;