Merge "Revert "Recompute the mNextFrameStartUnstuffed on every frame"" into tm-qpr-dev am: 9e11648fb5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18822744 Change-Id: I2053817e4b88984e8d4fd6afa6642cdb03dfb39c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -206,7 +206,6 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
|
|||||||
frame.set(FrameInfoIndex::FrameDeadline) = deadline;
|
frame.set(FrameInfoIndex::FrameDeadline) = deadline;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool computeNextFrameStartUnstuffed = false;
|
|
||||||
// If we hit the deadline, cool!
|
// If we hit the deadline, cool!
|
||||||
if (frame[FrameInfoIndex::GpuCompleted] < deadline) {
|
if (frame[FrameInfoIndex::GpuCompleted] < deadline) {
|
||||||
if (isTripleBuffered) {
|
if (isTripleBuffered) {
|
||||||
@@ -214,8 +213,7 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
|
|||||||
(*mGlobalData)->reportJankType(JankType::kHighInputLatency);
|
(*mGlobalData)->reportJankType(JankType::kHighInputLatency);
|
||||||
|
|
||||||
// Buffer stuffing state gets carried over to next frame, unless there is a "pause"
|
// 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
|
mNextFrameStartUnstuffed += frameInterval;
|
||||||
computeNextFrameStartUnstuffed = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mData->reportJankType(JankType::kMissedDeadline);
|
mData->reportJankType(JankType::kMissedDeadline);
|
||||||
@@ -224,7 +222,14 @@ void JankTracker::finishFrame(FrameInfo& frame, std::unique_ptr<FrameMetricsRepo
|
|||||||
(*mGlobalData)->reportJank();
|
(*mGlobalData)->reportJank();
|
||||||
|
|
||||||
// Janked, store the adjust deadline to detect triple buffering in next frame correctly.
|
// 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);
|
recomputeThresholds(frameInterval);
|
||||||
for (auto& comparison : COMPARISONS) {
|
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();
|
int64_t totalGPUDrawTime = frame.gpuDrawTime();
|
||||||
if (totalGPUDrawTime >= 0) {
|
if (totalGPUDrawTime >= 0) {
|
||||||
mData->reportGPUFrame(totalGPUDrawTime);
|
mData->reportGPUFrame(totalGPUDrawTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user