summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2021-01-25 14:16:54 -0800
committer Vishnu Nair <vishnun@google.com> 2021-01-28 16:56:24 +0000
commit8b30dd1104d26c92acd14df3a100a1ede0b1f47f (patch)
treea3aea0c622f09fe34fad8832ab604005cf1db607 /libs/gui/SurfaceComposerClient.cpp
parentdd5bfa93b0c6633b7372c87fc8d7a83a73a5cd1c (diff)
Allow BlastBufferQueue to acquire an additional buffer
We want to be able to send buffers from BlastBufferQueue to the server as soon as possible. This allows us among other things, dropping the oldest buffer when multiple buffers with timestamps are queued up. To support this behavior with BlastBufferQueue, we need to acquire an additional buffer and send it to SurfaceFlinger. This requires changing the consumer owned by BlastBufferQueue to acquire an additional buffer. This change is safe because we will only acquire the buffer if its not droppable, maintaining the contract with the producer. If the buffer is not droppable, i.e. the producer is in sync mode, once the buffer has been queued, the buffer is owned by the queue until it is released or acquired by the consumer. By acquiring an additional buffer, we transfer the ownership to the consumer earlier. The server has more info to make decisions faster. The producer still has access the same number of buffers and is unaffected. If the producer is in async mode, then this buffer may be released by the producer when trying to queue a buffer. So we check if the buffer is droppable, and we do not acquire the extra buffer in this scenario. Test: atest BlastBufferQueueTests android.media.cts.PresentationSyncTest Bug: b/176507654, b/176967609 Change-Id: I494a9edcbea0b1c297ee75df2b840d8328e59eca
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
0 files changed, 0 insertions, 0 deletions