From 7fe69edeb671e90ea8a7a84e7f3ec181283b0dcd Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Mon, 13 Feb 2023 10:13:26 -0800 Subject: SF: Pass latch time for bufferless surface frames Latch time is used to classify jank type as BufferStuffing. This jank classification does not count as missed frames. Layers without buffers do not pass in a latch time to the frametimeline logic. Fix this inconsistency so we do not incorrectly report missed frames for missed layer updates due to buffer stuffing. Test: check perfetto traces and see leashes are also classified as buffer stuffing Fixes: 266666415 Change-Id: Ie211aa3bd5821f6052cf84a62a2e245132a19d90 --- services/surfaceflinger/Layer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'services/surfaceflinger/Layer.cpp') diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 62e31b9f79..f2a8d44c10 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -772,7 +772,7 @@ void Layer::transferAvailableJankData(const std::deque>& hand // transaction // ---------------------------------------------------------------------------- -uint32_t Layer::doTransaction(uint32_t flags) { +uint32_t Layer::doTransaction(uint32_t flags, nsecs_t latchTime) { ATRACE_CALL(); // TODO: This is unfortunate. @@ -800,23 +800,24 @@ uint32_t Layer::doTransaction(uint32_t flags) { mFlinger->mUpdateInputInfo = true; } - commitTransaction(mDrawingState); + commitTransaction(mDrawingState, latchTime); return flags; } -void Layer::commitTransaction(State&) { +void Layer::commitTransaction(State&, nsecs_t currentLatchTime) { // Set the present state for all bufferlessSurfaceFramesTX to Presented. The // bufferSurfaceFrameTX will be presented in latchBuffer. for (auto& [token, surfaceFrame] : mDrawingState.bufferlessSurfaceFramesTX) { if (surfaceFrame->getPresentState() != PresentState::Presented) { // With applyPendingStates, we could end up having presented surfaceframes from previous // states - surfaceFrame->setPresentState(PresentState::Presented); + surfaceFrame->setPresentState(PresentState::Presented, mLastLatchTime); mFlinger->mFrameTimeline->addSurfaceFrame(surfaceFrame); } } mDrawingState.bufferlessSurfaceFramesTX.clear(); + mLastLatchTime = currentLatchTime; } uint32_t Layer::clearTransactionFlags(uint32_t mask) { -- cgit v1.2.3-59-g8ed1b