OSDN Git Service

BQ: Add support for single buffer mode
authorPablo Ceballos <pceballos@google.com>
Wed, 7 Oct 2015 22:05:45 +0000 (15:05 -0700)
committerPablo Ceballos <pceballos@google.com>
Tue, 3 Nov 2015 20:03:51 +0000 (12:03 -0800)
commitccdfd60d79a8b7f1ed6401d0f2e8e29166a10584
tree337134c63442b7f737caf43ff44487b0916f9047
parentc899c322ab49639c1e1b012bb5a8b7d52f8497f4
BQ: Add support for single buffer mode

- Adds a single buffer mode to BufferQueue. In this mode designate the
  first dequeued buffer as the shared buffer. All calls to dequeue()
  and acquire() will then return the shared buffer, allowing the
  producer and consumer to share it.
- Modify the buffer slot state tracking. Add a new SHARED state for
  the shared buffer in single buffer mode. Also track how many times
  a buffer has been dequeued/queued/acquired as it's possible for a
  shared buffer to be both dequeued and acquired at the same time, or
  dequeued/acquired multiple times. This tracking is needed to know
  when to drop the buffer out of the SHARED state after single buffer
  mode has been disabled.
- Add plumbing for enabling/disabling single buffer mode from Surface.

Bug 24940410

Change-Id: I3fc550c74bacb5523c049a227111356257386853
20 files changed:
include/gui/BufferQueueCore.h
include/gui/BufferQueueProducer.h
include/gui/BufferSlot.h
include/gui/IGraphicBufferProducer.h
include/gui/Surface.h
include/private/gui/LayerState.h
libs/gui/BufferItem.cpp
libs/gui/BufferQueueConsumer.cpp
libs/gui/BufferQueueCore.cpp
libs/gui/BufferQueueProducer.cpp
libs/gui/BufferSlot.cpp
libs/gui/GLConsumer.cpp
libs/gui/IGraphicBufferProducer.cpp
libs/gui/Surface.cpp
libs/gui/tests/BufferQueue_test.cpp
opengl/libs/EGL/eglApi.cpp
services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
services/surfaceflinger/MonitoredProducer.cpp
services/surfaceflinger/MonitoredProducer.h