Expand jank classification
This change expands the jank classification to include new cases like
BufferStuffing and SurfaceFlingerScheduling while also updating the jank
classification logic to be more accurate.
This change also refactors SurfaceFrame by removing the abstraction
class for SurfaceFrame since its now being polled by the layers as well.
Bug: 169890654
Test: libsurfaceflinger_unittest
Change-Id: Ica8ab1d1e4bf2052fffc6247fc5820d96ae8445d
diff --git a/services/surfaceflinger/BufferQueueLayer.h b/services/surfaceflinger/BufferQueueLayer.h
index 5a6b9bc..3551026 100644
--- a/services/surfaceflinger/BufferQueueLayer.h
+++ b/services/surfaceflinger/BufferQueueLayer.h
@@ -146,6 +146,11 @@
// a buffer to correlate the buffer with the vsync id. Can only be accessed
// with the SF state lock held.
std::optional<int64_t> mFrameTimelineVsyncId;
+
+ // Keeps track of the time SF latched the last buffer from this layer.
+ // Used in buffer stuffing analysis in FrameTimeline.
+ // TODO(b/176106798): Find a way to do this for BLASTBufferQueue as well.
+ nsecs_t mLastLatchTime = 0;
};
} // namespace android