From 3d4039d7a291cd9b6f2dd4b46fcdb576f2db3356 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 23 Sep 2016 16:31:30 -0700 Subject: Use FenceTime to share fence times and reduce open fds. FenceTimes are created and shared for each Fence that FrameTimestampHistory and FrameTracker care about. On the consumer side, the FenceTimes are also added to shared timelines that are owned by SurfaceFlinger or unshared timelines owned by Layer. The timelines are checked at the end of every frame to minimize the number of file descriptors open. On the producer side, the FenceTimes are added to the ConsumerFrameEventHistory instead, since the timelines that would be tracked by SurfaceFlinger are not shared with anyone else in the consumer's process. The timelines are checked just after a frame is queued to minimize the number of file descriptors open. Test: adb shell /data/nativetest/libgui_test/libgui_test --gtest_filter=*GetFrameTimestamps* Change-Id: Ifd4301affe1b24705b2bee7608c5a2c09dfb4041 --- libs/gui/BufferQueueConsumer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/gui/BufferQueueConsumer.cpp') diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp index ee4c58cfce..d66aa1acf5 100644 --- a/libs/gui/BufferQueueConsumer.cpp +++ b/libs/gui/BufferQueueConsumer.cpp @@ -205,6 +205,7 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer, // was cached when it was last queued. outBuffer->mGraphicBuffer = mSlots[slot].mGraphicBuffer; outBuffer->mFence = Fence::NO_FENCE; + outBuffer->mFenceTime = FenceTime::NO_FENCE; outBuffer->mCrop = mCore->mSharedBufferCache.crop; outBuffer->mTransform = mCore->mSharedBufferCache.transform & ~static_cast( -- cgit v1.2.3-59-g8ed1b