summaryrefslogtreecommitdiff
path: root/libs/hwui/JankTracker.cpp
diff options
context:
space:
mode:
author Dake Gu <dake@google.com> 2022-06-10 01:09:00 +0000
committer Dake Gu <dake@google.com> 2022-06-10 01:09:00 +0000
commitf71128f8f42a78c30f3a8581bafb4d5e5192d86d (patch)
tree0640f03c4c80308e6def78ce8c8a7eb9a47441e8 /libs/hwui/JankTracker.cpp
parent89434a2523f06f7e2bb2bcc1497aebb52567b66d (diff)
Revert "Recompute the mNextFrameStartUnstuffed on every frame"
This reverts commit 89434a2523f06f7e2bb2bcc1497aebb52567b66d. Reason for revert: regression uibench_deadline_missed-mean Change-Id: I122cc2f42411342cc6945f0bd85106f31dd8977b
Diffstat (limited to 'libs/hwui/JankTracker.cpp')
-rw-r--r--libs/hwui/JankTracker.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp
index c5c2d159bf03..4b0ddd2fa2ef 100644
--- a/libs/hwui/JankTracker.cpp
+++ b/libs/hwui/JankTracker.cpp
@@ -206,7 +206,6 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
frame.set(FrameInfoIndex::FrameDeadline) = deadline;
}
- bool computeNextFrameStartUnstuffed = false;
// If we hit the deadline, cool!
if (frame[FrameInfoIndex::GpuCompleted] < deadline) {
if (isTripleBuffered) {
@@ -214,8 +213,7 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
(*mGlobalData)->reportJankType(JankType::kHighInputLatency);
// Buffer stuffing state gets carried over to next frame, unless there is a "pause"
- // Instead of increase by frameInterval, recompute to catch up the drifting vsync
- computeNextFrameStartUnstuffed = true;
+ mNextFrameStartUnstuffed += frameInterval;
}
} else {
mData->reportJankType(JankType::kMissedDeadline);
@@ -224,7 +222,14 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
(*mGlobalData)->reportJank();
// Janked, store the adjust deadline to detect triple buffering in next frame correctly.
- computeNextFrameStartUnstuffed = true;
+ nsecs_t jitterNanos = frame[FrameInfoIndex::GpuCompleted]
+ - frame[FrameInfoIndex::Vsync];
+ nsecs_t lastFrameOffset = jitterNanos % frameInterval;
+
+ // Note the time when the next frame would start in an unstuffed situation. If it starts
+ // earlier, we are in a stuffed situation.
+ mNextFrameStartUnstuffed = frame[FrameInfoIndex::GpuCompleted]
+ - lastFrameOffset + frameInterval;
recomputeThresholds(frameInterval);
for (auto& comparison : COMPARISONS) {
@@ -249,16 +254,6 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
}
}
- if (computeNextFrameStartUnstuffed) {
- nsecs_t jitterNanos = frame[FrameInfoIndex::GpuCompleted] - frame[FrameInfoIndex::Vsync];
- nsecs_t lastFrameOffset = jitterNanos % frameInterval;
-
- // Note the time when the next frame would start in an unstuffed situation. If it starts
- // earlier, we are in a stuffed situation.
- mNextFrameStartUnstuffed =
- frame[FrameInfoIndex::GpuCompleted] - lastFrameOffset + frameInterval;
- }
-
int64_t totalGPUDrawTime = frame.gpuDrawTime();
if (totalGPUDrawTime >= 0) {
mData->reportGPUFrame(totalGPUDrawTime);