summaryrefslogtreecommitdiff
path: root/libs/hwui/JankTracker.cpp
diff options
context:
space:
mode:
author Dake Gu <dake@google.com> 2022-06-02 17:42:55 -0700
committer Dake Gu <dake@google.com> 2022-06-07 07:37:43 -0700
commit3a9b4c8b112c3fbd59bca17228ecc772e0879cb3 (patch)
tree0640f03c4c80308e6def78ce8c8a7eb9a47441e8 /libs/hwui/JankTracker.cpp
parent1b076a41fd19c1f6f37fd729fe1823c453f09695 (diff)
Detect doubleStuffed frame when duration is over 2*interval
Current doubleStuffed deadline calculation is based on the assumption that frame duration cannot go beyond 2*interval. But we see on TV with many >2*interval cases and device is still rendering without frame drop. See details in go/jank-tracker-deadline-fix-on-s Test: build adt3_gtv-userdebug on T, verified gfxinfo is no longer reporting a high number of "deadline missed" Test: new test in JankTrackerTests Bug: 189942694 Change-Id: Id9be2d0d232b89c6e145ecec513054ca8c752814
Diffstat (limited to 'libs/hwui/JankTracker.cpp')
-rw-r--r--libs/hwui/JankTracker.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp
index 1e5be6c3eed7..4b0ddd2fa2ef 100644
--- a/libs/hwui/JankTracker.cpp
+++ b/libs/hwui/JankTracker.cpp
@@ -201,8 +201,9 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
// If we are in triple buffering, we have enough buffers in queue to sustain a single frame
// drop without jank, so adjust the frame interval to the deadline.
if (isTripleBuffered) {
- deadline += frameInterval;
- frame.set(FrameInfoIndex::FrameDeadline) += frameInterval;
+ int64_t originalDeadlineDuration = deadline - frame[FrameInfoIndex::IntendedVsync];
+ deadline = mNextFrameStartUnstuffed + originalDeadlineDuration;
+ frame.set(FrameInfoIndex::FrameDeadline) = deadline;
}
// If we hit the deadline, cool!