Avoid fake high input latency while vsync drifting

Usually isTrippleBuffered should be true when mSwapDeadline bigger
than IntendedVsync. However, vsync could be drifting on some platforms,
which make isTrippleBuffered to be true and report a fake high input
latency.

So add a small threshold to avoid this case.

Test: Manually
Change-Id: Ib6ff1046cfb94f89f4985361b84ad2d34850f783
Signed-off-by: Gao Shuo <shuo.gao@intel.com>
Signed-off-by: Wu Zhongmin <zhongmin.wu@intel.com>
Signed-off-by: Zhu Tingting <tingting.zhu@intel.com>
This commit is contained in:
Gao Shuo
2019-05-27 14:14:57 +08:00
parent 7a5b9c2d0a
commit 7e05ff35fa

View File

@@ -138,7 +138,7 @@ void JankTracker::finishFrame(const FrameInfo& frame) {
(*mGlobalData)->reportJank();
}
bool isTripleBuffered = mSwapDeadline > frame[FrameInfoIndex::IntendedVsync];
bool isTripleBuffered = (mSwapDeadline - frame[FrameInfoIndex::IntendedVsync]) > (mFrameInterval * 0.1);
mSwapDeadline = std::max(mSwapDeadline + mFrameInterval,
frame[FrameInfoIndex::IntendedVsync] + mFrameInterval);