summaryrefslogtreecommitdiffstats
path: root/libs/gui/include
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2019-03-28 00:44:03 +0100
committerJorim Jaggi <jjaggi@google.com>2019-04-02 22:40:12 +0200
commit35b4e3839a2eb405bd172351042f81d842183715 (patch)
tree39ee0e9f82836355b195abfcc7c8b66a88868af7 /libs/gui/include
parent6ae550323264bacc45da2d8fca90534d02815308 (diff)
downloadandroid_frameworks_native-35b4e3839a2eb405bd172351042f81d842183715.tar.gz
android_frameworks_native-35b4e3839a2eb405bd172351042f81d842183715.tar.bz2
android_frameworks_native-35b4e3839a2eb405bd172351042f81d842183715.zip
Wait for buffer allocation
In dequeueBuffer, if we don't have a free slot but are in the process of allocating, we wait for that to complete instead of kicking off our own allocation, as it's likely that the allocation from allocateBuffers is able to finish earlier than if we'd kick off our own allocation. Test: Swipe up, see less initial buffer dequeue delay Fixes: 111517695 Change-Id: I735d68e87fc7e2ff5b7ec3595f0ced5a94ebbf9c
Diffstat (limited to 'libs/gui/include')
-rw-r--r--libs/gui/include/gui/BufferQueueProducer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/gui/include/gui/BufferQueueProducer.h b/libs/gui/include/gui/BufferQueueProducer.h
index b6e98862f..415e2a616 100644
--- a/libs/gui/include/gui/BufferQueueProducer.h
+++ b/libs/gui/include/gui/BufferQueueProducer.h
@@ -253,6 +253,13 @@ private:
// slot is not yet available.
nsecs_t mDequeueTimeout;
+ // If set to true, dequeueBuffer() is currently waiting for buffer allocation to complete.
+ bool mDequeueWaitingForAllocation;
+
+ // Condition variable to signal allocateBuffers() that dequeueBuffer() is no longer waiting for
+ // allocation to complete.
+ std::condition_variable mDequeueWaitingForAllocationCondition;
+
}; // class BufferQueueProducer
} // namespace android