Fix Transaction tracking for FrameTimeline

The current setup only supports one SurfaceFrame per DrawingState for
Transactions. This becomes problematic if more than one Transaction is
submitted for the same vsync, on the same layer. On top of this, the
Blast transactions can have a buffer that could result in a buffer drop.

This change adds the support to hold multiple SurfaceFrames in the
Layer's State. It also adds a bufferSurfaceFrame that's intended only
for Blast Transactions with a Buffer. All other Transactions are tracked
in the bufferlessSurfaceFrames.

Additionally, this change also adds a lastLatchTime. It is needed for
classifying BufferStuffing properly.

Bug: 176106798
Test: open any app from the launcher and at the same time check dumpsys
Change-Id: Id3b8369ca206f8b89be3041e5fc018f1f1be1d23
Merged-In: Id3b8369ca206f8b89be3041e5fc018f1f1be1d23
diff --git a/services/surfaceflinger/RefreshRateOverlay.cpp b/services/surfaceflinger/RefreshRateOverlay.cpp
index 9230e72..49ffc81 100644
--- a/services/surfaceflinger/RefreshRateOverlay.cpp
+++ b/services/surfaceflinger/RefreshRateOverlay.cpp
@@ -238,7 +238,7 @@
     auto buffer = getOrCreateBuffers(*mCurrentFps)[mFrame];
     mLayer->setBuffer(buffer, Fence::NO_FENCE, 0, 0, true, {},
                       mLayer->getHeadFrameNumber(-1 /* expectedPresentTime */),
-                      std::nullopt /* dequeueTime */);
+                      std::nullopt /* dequeueTime */, FrameTimelineInfo{});
 
     mFlinger.mTransactionFlags.fetch_or(eTransactionMask);
 }
@@ -251,7 +251,7 @@
     auto buffer = buffers[mFrame];
     mLayer->setBuffer(buffer, Fence::NO_FENCE, 0, 0, true, {},
                       mLayer->getHeadFrameNumber(-1 /* expectedPresentTime */),
-                      std::nullopt /* dequeueTime */);
+                      std::nullopt /* dequeueTime */, FrameTimelineInfo{});
 
     mFlinger.mTransactionFlags.fetch_or(eTransactionMask);
 }