Merge "Change the position of addAndGetFrameTimestamps when queueBuffer" am: 3d04184bd2 am: 2c09b198fe
Change-Id: I9e0a7fa54b16872e17137904c9607752b358b54d
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index a317aaf..4f8eb6b 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -981,6 +981,17 @@
item.mGraphicBuffer.clear();
}
+ // Update and get FrameEventHistory.
+ nsecs_t postedTime = systemTime(SYSTEM_TIME_MONOTONIC);
+ NewFrameEventsEntry newFrameEventsEntry = {
+ currentFrameNumber,
+ postedTime,
+ requestedPresentTimestamp,
+ std::move(acquireFenceTime)
+ };
+ addAndGetFrameTimestamps(&newFrameEventsEntry,
+ getFrameTimestamps ? &output->frameTimestamps : nullptr);
+
// Call back without the main BufferQueue lock held, but with the callback
// lock held so we can ensure that callbacks occur in order
@@ -1010,17 +1021,6 @@
mCallbackCondition.notify_all();
}
- // Update and get FrameEventHistory.
- nsecs_t postedTime = systemTime(SYSTEM_TIME_MONOTONIC);
- NewFrameEventsEntry newFrameEventsEntry = {
- currentFrameNumber,
- postedTime,
- requestedPresentTimestamp,
- std::move(acquireFenceTime)
- };
- addAndGetFrameTimestamps(&newFrameEventsEntry,
- getFrameTimestamps ? &output->frameTimestamps : nullptr);
-
// Wait without lock held
if (connectedApi == NATIVE_WINDOW_API_EGL) {
// Waiting here allows for two full buffers to be queued but not a