OSDN Git Service

BQ: Resend queued buffer handles after disconnect
authorDan Stoza <stoza@google.com>
Tue, 21 Mar 2017 20:43:22 +0000 (13:43 -0700)
committerDan Stoza <stoza@google.com>
Wed, 22 Mar 2017 21:24:47 +0000 (14:24 -0700)
commitd4c6f9912fa4f9d6a5a2e51672adf27c7a1c8624
treec390b78edbab46b2ecabead25a0e1162d09a2ac6
parenta2d4886b53c37a8f47d525e3b9705d8e25cd85c0
BQ: Resend queued buffer handles after disconnect

When the producer disconnects from a BufferQueue, all of its slots are
cleared and buffers in the queue are marked as stale. When the slots
are cleared, we notify the consumer that buffers were released so that
it can clear its cache of slot-to-buffer mappings.

However, when we were marking queued buffers as stale, we were not
clearing the bit that dictates whether the BQ needs to send a buffer
handle upon acquire, so in the case where the producer queues a buffer
and disconnects, and then the consumer acquires that queued buffer,
the consumer doesn't get the buffer handle, nor can it retrieve it from
its cache, because it has (or should have) already cleared it.

This change clears that bit upon disconnect.

Bug: 36453246
Test: New test in libgui_tests + Vulkan CTS test from bug
Change-Id: Ic27f119a4164878257c3841b4e1d421694159774
libs/gui/BufferQueueCore.cpp
libs/gui/tests/BufferQueue_test.cpp