Don't update BufferQueue FrameEventStats when a frame is dropped
Update BlastBufferQueue to match BQ logic. This change in behaviour
was causing a dEQP test failure which relied on actual present timestamps
to generate future desired present timestamps. If a buffer was dropped,
the actual present timestamp retrieved would be 0 causing cascading failures.
Test: atest BLASTFrameEventHistoryTest
Test: CtsDeqpTestCases:dEQP-VK.wsi.android.display_timing.fifo#display_timing
Bug: 186200443
Change-Id: I9589d6e43c5f6dfbe93702b7c43a8fff8712fe24
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index b9a293f..70d8208 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -255,15 +255,18 @@
mTransformHint = stat.transformHint;
mBufferItemConsumer->setTransformHint(mTransformHint);
- mBufferItemConsumer
- ->updateFrameTimestamps(stat.frameEventStats.frameNumber,
- stat.frameEventStats.refreshStartTime,
- stat.frameEventStats.gpuCompositionDoneFence,
- stat.presentFence, stat.previousReleaseFence,
- stat.frameEventStats.compositorTiming,
- stat.latchTime,
- stat.frameEventStats.dequeueReadyTime);
-
+ // Update frametime stamps if the frame was latched and presented, indicated by a
+ // valid latch time.
+ if (stat.latchTime > 0) {
+ mBufferItemConsumer
+ ->updateFrameTimestamps(stat.frameEventStats.frameNumber,
+ stat.frameEventStats.refreshStartTime,
+ stat.frameEventStats.gpuCompositionDoneFence,
+ stat.presentFence, stat.previousReleaseFence,
+ stat.frameEventStats.compositorTiming,
+ stat.latchTime,
+ stat.frameEventStats.dequeueReadyTime);
+ }
currFrameNumber = stat.frameEventStats.frameNumber;
if (mTransactionCompleteCallback &&