History log of /frameworks/native/libs/gui/CpuConsumer.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a81bc4975941bff8dbfcb858627dfcd01250c1ed 27-Nov-2017 Chia-I Wu <olv@google.com> libgui: add more IGBC wrappers to ConsumerBase

Add

ConsumerBase::setName
ConsumerBase::setConsumerUsageBits
ConsumerBase::setTransformHint
ConsumerBase::setMaxAcquiredBufferCount
ConsumerBase::getSidebandStream

and remove

BufferItemConsumer::setName
CpuConsumer::setName
GLConsumer::setName
GLConsumer::setDefaultBufferFormat
GLConsumer::setDefaultBufferDataSpace
GLConsumer::setTransformHint
GLConsumer::setMaxAcquiredBufferCount
SurfaceFlingerConsumer::getSidebandStream

at the same time.

Test: libgui_test
Change-Id: I0b81b7759d6d5a7a89eefdfe95440b262e7fa424
/frameworks/native/libs/gui/CpuConsumer.cpp
0530f87f62c8d2b483657427a4f7129500d8fa8d 16-Nov-2017 Chia-I Wu <olv@google.com> libgui: tidy up CpuConsumer

Remove unnecessary freeBufferLocked and destructor.

Test: libgui_test
Change-Id: Ifc81f72a2f9c0deca97294f6b2977bd150430f7c
/frameworks/native/libs/gui/CpuConsumer.cpp
924454f555f0cf3fbef2b5139d398de0e2568567 16-Nov-2017 Chia-I Wu <olv@google.com> libgui: fix and clean up CpuConsumer::unlockBuffer

addReleaseFenceLocked should be called with
AcquiredBuffer::mGraphicBuffer, not the one in ConsumerBase::mSlots.
Otherwise, it breaks ConsumerBase::stillTracking.

Also thanks to stillTracking, we don't need to do the tracking
manually.

Test: libgui_test
Change-Id: Ib69b88263c4619634ae2977b9f811be5a846f446
/frameworks/native/libs/gui/CpuConsumer.cpp
96ad8222f300c4dd918a15192a8a9c1c4c6fd834 17-Nov-2017 Chia-I Wu <olv@google.com> libgui: fix a race in CpuConsumer::lockNextBuffer

mCurrentLockedBuffers must be accessed with the mutex. Constify
mMaxLockedBuffers as well for clarity.

Test: libgui_test
Change-Id: I7c40d135bcf2aa6a90ecff74d6d8107fc530e815
/frameworks/native/libs/gui/CpuConsumer.cpp
7e7256ee0955cb3b93fe40efd4e7627e5a549210 17-Nov-2017 Chia-I Wu <olv@google.com> libgui: add helper to initialize CpuConsumer::LockedBuffer

Add CpuConsumer::lockBufferItem to lock a BufferItem and initialize
a LockedBuffer.

Test: libgui_test
Change-Id: I85fcc80acfc437d1f02d2310fbe194f1f0b98e7f
/frameworks/native/libs/gui/CpuConsumer.cpp
cacfcc669e978964cc8c4cd42ada3677c54b74c3 16-Nov-2017 Chia-I Wu <olv@google.com> libgui: add helper to find CpuConsumer::AcquiredBuffer

Add CpuConsumer::findAcquiredBufferLocked. Rename mBufferPointer to
mLockedBufferId.

This also fixes a nullptr-dereference when unlockBuffer is called
with a LockedBuffer whose data is nullptr.

Test: libgui_test
Change-Id: I36c665099f145731197a6ff8ab940c5d7a326df8
/frameworks/native/libs/gui/CpuConsumer.cpp
541f22658ab1617c9d12c98684ab40248df8749b 11-Feb-2017 Romain Guy <romainguy@google.com> Add RGBA 10:10:10:2 format for surfaces

Bug: 2984164
Test: CtsHardwareTestCases
Change-Id: Ifc90e413f414a19ac09e923e48ec7ff45d3e930b
/frameworks/native/libs/gui/CpuConsumer.cpp
d3e08d4811e13aefd656e3376e7d56e2d37bb388 16-Dec-2016 Romain Guy <romainguy@google.com> Remove RGBX_FP16 format

Bug: 32984164
Test: compile
Change-Id: I4e0eadc3066717d4644d71cf2684a617bae34a1f
/frameworks/native/libs/gui/CpuConsumer.cpp
ff415149dc5a83a4eb5960daf2cb2c310ef89847 14-Dec-2016 Romain Guy <romainguy@google.com> Add fp16 pixel and window formats

Bug: 32984164
Test: compile
Change-Id: I8303afbf857796295a280c0d9438a3c403a11437
/frameworks/native/libs/gui/CpuConsumer.cpp
65d9f6d63ab3bad1d835df14c662028a748eb3c5 04-May-2016 Pablo Ceballos <pceballos@google.com> libgui: Prevent segfaulting in abandoned ConsumerBase

mConsumer will be null if the ConsumerBase has been abandoned. Prevent
it from being dereferenced in those cases.

Bug 27718219

Change-Id: I9a3ecadb0655ec61cd2fd15ee98b3e1bef078cff
/frameworks/native/libs/gui/CpuConsumer.cpp
47650f4f66a49e1815ad08ca4fb12a661d133abc 05-Aug-2015 Pablo Ceballos <pceballos@google.com> native: Rename mBuf to mSlot

Remove the union in BufferItem.

Bug: 19769719
Change-Id: I4e496b5aafce0fc5206dc7551a741f9c262c2cd0
/frameworks/native/libs/gui/CpuConsumer.cpp
847f11e215e86b107ab50c1359fc7bc3cd7a3a11 18-May-2015 Michael Lentine <mlentine@google.com> Refactor ConsumerBase and it's derived classes.

Move setDefaultBufferSize, setDefaultBufferFormat, and
setDefaultBufferDataSpace into ConsumerBase and remove them from
CpuConsumer and BufferItemConsumer.

Bug: 19977701

Change-Id: Ic68992464c5da6da7a41c4063a53029a69efcd1b
/frameworks/native/libs/gui/CpuConsumer.cpp
921d1d7a61f527b7bbf42e9ba46bd92342cc7c99 02-Apr-2015 Dan Stoza <stoza@google.com> Revert "libgui: Plumb attach/detach through CpuConsumer"

This reverts commit 20c5672883796c0dedf38f51dc2fc6f140b09ae6.
/frameworks/native/libs/gui/CpuConsumer.cpp
20c5672883796c0dedf38f51dc2fc6f140b09ae6 16-Mar-2015 Dan Stoza <stoza@google.com> libgui: Plumb attach/detach through CpuConsumer

Adds CpuConsumer::{detachNextBuffer,attachAndReleaseBuffer}, which
can be used to more carefully manage the ownership of GraphicBuffers.

Bug: 19628705
Change-Id: Ia7a7e30da6d81eb2367241998f14988db0afc3bf
/frameworks/native/libs/gui/CpuConsumer.cpp
724768f9163ea2483614877895fa74140fbb386e 17-Mar-2015 Dan Stoza <stoza@google.com> Revert "libgui: Plumb attach/detach through CpuConsumer"

This reverts commit 43078e2827211139f0614719c920f3c5bff6c3fa.

Change-Id: Ifef774d9922bb90450384e810e4767b56cc29de3
/frameworks/native/libs/gui/CpuConsumer.cpp
43078e2827211139f0614719c920f3c5bff6c3fa 16-Mar-2015 Dan Stoza <stoza@google.com> libgui: Plumb attach/detach through CpuConsumer

Adds CpuConsumer::{detachNextBuffer,attachAndReleaseBuffer}, which
can be used to more carefully manage the ownership of GraphicBuffers.

Bug: 19628705
Change-Id: Ia7aa1ac59c2f768f2d8a0f35ad23067936a7427c
/frameworks/native/libs/gui/CpuConsumer.cpp
dd26416fe135f93ef2c8570738f8e1ca5e2ca3a3 12-Mar-2015 Dan Stoza <stoza@google.com> libgui: Prepare for IGBC::BufferItem removal

Switches some dependencies from IGraphicBufferConsumer::BufferItem to
android::BufferItem and adds some methods to facilitate incrementally
changing client code to do the same.

Change-Id: I699ed0a6837076867ca756b28d1ffb2238f7a0d9
/frameworks/native/libs/gui/CpuConsumer.cpp
5b75a513e431c097ae704cba2f7affa6bfaecec9 20-Feb-2015 Eino-Ville Talvala <etalvala@google.com> Add dataSpace to buffer queues; remove old format enums.

- Wire up new dataSpace parameter through buffer queue stack
- Update tests to include the parameter
- Switch eglApi to using dataSpace to indicate sRGB gamma/linear
difference
- Remove RAW_SENSOR in favor of RAW16
- Remove use of sRGB format enums
- Add default dataspace to buffer queue core
- Add query for default dataspace

Change-Id: I070bd2e7c56506055c419004c29e2e3feac725df
/frameworks/native/libs/gui/CpuConsumer.cpp
b3ca72ce1ea0d5e9ef1601dd35520f9fcf23cbca 29-Jan-2015 Lajos Molnar <lajos@google.com> CpuConsumer: fix build error
/frameworks/native/libs/gui/CpuConsumer.cpp
bacce71e40661f908be8f3138ae6c9144c69ba65 29-Jan-2015 Chad Jones <chadj@google.com> Merge commit 'ec41d55b8d018f349f7687cfe491651db600b51d'
ec41d55b8d018f349f7687cfe491651db600b51d 29-Jan-2015 Lajos Molnar <lajos@google.com> am 94ee9b59: Merge "CpuConsumer: lock buffers that could be YUV as ycbcr" into lmp-mr1-dev

* commit '94ee9b5916903e6ee23bb1ce8f688900a4eb6f65':
CpuConsumer: lock buffers that could be YUV as ycbcr
6a26be7c2b1e5a84b5d2105780148016889285e6 23-Jan-2015 Lajos Molnar <lajos@google.com> CpuConsumer: lock buffers that could be YUV as ycbcr

Bug: 17906609
Change-Id: Ic71af69ec3b19ab1224ed3ad5e0a97c60e81cda6
/frameworks/native/libs/gui/CpuConsumer.cpp
a21b7a0686b9d179d4e717678c1f88bb5eed9dc6 10-Dec-2014 Andreas Gampe <agampe@google.com> am b93bca5d: am a59d7a6a: Merge "GUI: Remove unused variables"

* commit 'b93bca5d0831068cd599f905ba43dc8334095d65':
GUI: Remove unused variables
b93bca5d0831068cd599f905ba43dc8334095d65 09-Dec-2014 Andreas Gampe <agampe@google.com> am a59d7a6a: Merge "GUI: Remove unused variables"

* commit 'a59d7a6a66a2b8dcb2d00dbd6371fa89ae45ab04':
GUI: Remove unused variables
7398a5af38a9eead2ac6c87da876ba834b450519 09-Dec-2014 Andreas Gampe <agampe@google.com> GUI: Remove unused variables

For build-system CFLAGS clean-up, remove unused variables.

Bug: 18632512
Change-Id: I79fdcf830683d7278f4bf114cfb76a26da1b88ff
/frameworks/native/libs/gui/CpuConsumer.cpp
dd883c0b08d2a60f89542b9b9f5fdabcb14885c7 18-Nov-2014 Dan Stoza <stoza@google.com> libgui: Enable -Weverything and -Werror

Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

This is a squashed commit based on an initial change with a couple of
fixes to avoid breaking certain targets. The source commits are:
d723bd7669b4fc88dc282d8bf8ba5ecb2849d22f
00d504c06ea034befe143e6b8cb34d004670ed02
429ba89cd293633d2f882165066b422c96597df2

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
/frameworks/native/libs/gui/CpuConsumer.cpp
d723bd7669b4fc88dc282d8bf8ba5ecb2849d22f 18-Nov-2014 Dan Stoza <stoza@google.com> libgui: Enable -Weverything and -Werror

Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
/frameworks/native/libs/gui/CpuConsumer.cpp
5273a978337cbee2c1aae2f4d5c1b0e9d8dd6e1c 09-Sep-2014 Dan Albert <danalbert@google.com> resolved conflicts for merge of 86aeb9ef to lmp-dev-plus-aosp

Change-Id: I82fe2b385156d9bdb9e7183e308d7b2a4167b6ce
8b49125f10e3fd991c631e12856ce1ebf5a56d7e 09-Sep-2014 Dan Albert <danalbert@google.com> Make string literal concatenation play nice with C++11.

In C++11 mode, "foo"MACRO_THAT_EXPANDS_TO_STRING gets lexed as a user
defined literal. Add space around the macro.

Change-Id: I2741f5be9c0b1562e0f413d1309ef9d687e89b41
/frameworks/native/libs/gui/CpuConsumer.cpp
d53e052322c658ce7c67b046caaeee4babc0a657 19-Aug-2014 Riley Andrews <riandrews@google.com> Within CpuConsumer, use gralloc lockAsync/unlockAsync

Change-Id: I6b2cd195e111c3c7bf94c8052af4db92e09649a5
/frameworks/native/libs/gui/CpuConsumer.cpp
a5b7513711555c8681eb9391cfafe30fb7d6dd3d 15-Aug-2013 Igor Murashkin <iam@google.com> gui: CpuConsumer::lockNextBuffer change return code when too many bufs acquired

- Return NOT_ENOUGH_DATA instead of INVALID_OPERATION when too many
buffers have already been locked.
- INVALID_OPERATION is nominally used when something irrecoverable happens,
but in this case the client just needs to call unlockBuffer to go back into a
good state.

Bug: 10333400
Change-Id: I3a034d77de85741429f832a90eedd670afa1dc94
/frameworks/native/libs/gui/CpuConsumer.cpp
db89edc94bd2a78226b407f9f7261e202e7fa325 02-Aug-2013 Mathias Agopian <mathias@google.com> All consumers now take an IGraphicBufferConsumer instead of a BufferQueue

this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that

Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
/frameworks/native/libs/gui/CpuConsumer.cpp
595264f1af12e25dce57d7c5b1d52ed86ac0d0c9 17-Jul-2013 Mathias Agopian <mathias@google.com> BufferQueue improvements and APIs changes

this is the first step of a series of improvements to
BufferQueue. A few things happen in this change:

- setSynchronousMode() goes away as well as the SynchronousModeAllowed flag
- BufferQueue now defaults to (what used to be) synchronous mode
- a new "controlled by app" flag is passed when creating consumers and producers
those flags are used to put the BufferQueue in a mode where it
will never block if both flags are set. This is achieved by:
- returning an error from dequeueBuffer() if it would block
- making sure a buffer is always available by replacing
the previous buffer with the new one in queueBuffer()
(note: this is similar to what asynchrnous mode used to be)

Note: in this change EGL's swap-interval 0 is broken; this will be
fixed in another change.

Change-Id: I691f9507d6e2e158287e3039f2a79a4d4434211d
/frameworks/native/libs/gui/CpuConsumer.cpp
8f938a53385a3c6d1c6aa24b3f38437bb2cc47ae 13-Jul-2013 Mathias Agopian <mathias@google.com> always pass the BufferQueue explicitely to consumers

Change-Id: I883b0a7b19d8e722f9ab714ba6f49e658b02ca86
/frameworks/native/libs/gui/CpuConsumer.cpp
1585c4d9fbbba3ba70ae625923b85cd02cb8a0fd 28-Jun-2013 Andy McFadden <fadden@android.com> Pay attention to buffer timestamps

When acquiring a buffer, SurfaceFlinger now computes the expected
presentation time and passes it to the BufferQueue acquireBuffer()
method. If it's not yet time to display the buffer, acquireBuffer()
returns PRESENT_LATER instead of a buffer.

The current implementation of the expected-present-time computation
uses approximations and guesswork.

Bug 7900302

Change-Id: If9345611c5983a11a811935aaf27d6388a5036f1
/frameworks/native/libs/gui/CpuConsumer.cpp
b4b63704c02319765625de360a140ef8a59ab43b 06-Jun-2013 Zhijun He <zhijunhe@google.com> CpuConsumer: Add set buffer size and format functions.

Add setDefaultBufferSize() and setDefaultBufferFormat(). ImageReader JNI need
them.

Bug: 9254294
Change-Id: I7d2464d43b0ca73fbb834ed22cecbfbb30eef60c
/frameworks/native/libs/gui/CpuConsumer.cpp
c5d7b7d323bba8772a9005f7d300ad983a04733a 03-May-2013 Lajos Molnar <lajos@google.com> BufferQueue: track buffer-queue by instance vs. by reference

Instead of representing the buffer-queue as a vector of buffer
indices, represent them as a vector of BufferItems (copies).
This allows modifying the buffer slots independent of the queued
buffers.

As part of this change, BufferSlot properties that are only
been relevant in the buffer-queue have been removed.

Also, invalid scalingMode in queueBuffer now returns an error.

ConsumerBase has also changed to allow reuse of the same
buffer slots by different buffers.

Change-Id: If2a698fa142b67c69ad41b8eaca6e127eb3ef75b
Signed-off-by: Lajos Molnar <lajos@google.com>
Related-to-bug: 7093648
/frameworks/native/libs/gui/CpuConsumer.cpp
ea74d3b78d607cde17790a7bb83e6f68ffd34cfd 17-May-2013 Mathias Agopian <mathias@google.com> make the warning timout of Fence::waitForever() implicit and longer

- timeout is now 3 seconds instead of 1
- simplifies the API a bit
- allows us to change/tweak this timeout globaly

Bug: 8988871

Change-Id: I8d3c6ec43a372f602fb3f29856710339f86c0ec9
/frameworks/native/libs/gui/CpuConsumer.cpp
c43946b931de5dafd28f49963f9af78e05390b26 05-May-2013 Eino-Ville Talvala <etalvala@google.com> Add support for HAL_PIXEL_FORMAT_YCbCr_420_888

- Add fields to CpuConsumer::LockedBuffer for new information
- New lock methods for GraphicBuffer and GraphicBufferMapper for
the format

Bug: 8734880
Change-Id: If31f82c62d64b6942cf4cc6e5715585c03273f12
/frameworks/native/libs/gui/CpuConsumer.cpp
042ecee2abf8584585f1f22f661ac6be9689edf4 01-Mar-2013 Eino-Ville Talvala <etalvala@google.com> CpuConsumer: Properly track acquired buffers

CpuConsumer cannot simply assume a slot's buffer is the same buffer
between acquire and release, and therefore it could be possible for
the same slot to get used for a second acquired buffer, if there's a
producer disconnect in between. This would cause a problem when the
first buffer is released by the consumer.

Instead, use an independent list of acquired buffers to properly track
their state.

Bug: 8291751
Change-Id: I0241ad8704e53d47318c7179b13daed8181b1fab
/frameworks/native/libs/gui/CpuConsumer.cpp
eb0d12963d271052c24abb025d698504df9e7573 28-Feb-2013 Eino-Ville Talvala <etalvala@google.com> CpuConsumer: Add optional asynchronous mode

Bug: 8290146
Bug: 8291751

Change-Id: I9c8ac4bff38b0411e987a204e540d018dba6d0b4
/frameworks/native/libs/gui/CpuConsumer.cpp
64d8b1903e4b5f2838818eedcf4fef748b38709c 28-Feb-2013 Eino-Ville Talvala <etalvala@google.com> CpuConsumer: Don't unlock buffers on producer disconnect

Bug: 8291751

Change-Id: I062a3d34b41183d07fb6b9109cdb6bf0c0c75672
/frameworks/native/libs/gui/CpuConsumer.cpp
ba607d53c6a94ea8c4c12571980c4ad159af308b 01-Oct-2012 Jesse Hall <jessehall@google.com> Add Fence::waitForever which logs a warning timeout, and use it

Bug: 7217641
Change-Id: If0c1a613ead307c4045a47824174bf40c72bc7d7
/frameworks/native/libs/gui/CpuConsumer.cpp
b27254154642575dfb4bbfa79fbedde7d7ee23dd 06-Sep-2012 Jamie Gennis <jgennis@google.com> libgui: move fence handling into ConsumerBase

This change moves some common fence handling code into the base class for
BufferQueue consumer classes. It also makes the ConsumerBase class initialize
a buffer slot's fence with the acquire fence every time a buffer is acquired.

Change-Id: I0bd88bc269e919653b659bfb3ebfb04dd61692a0
/frameworks/native/libs/gui/CpuConsumer.cpp
72f096fb1ad0a0deadbfac5f88627461905d38e8 28-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: use max acquired buffer count

This change makes BufferQueue derive the min undequeued buffer count from a max
acquired buffer count that is set by the consumer. This value may be set at
any time that a producer is not connected to the BufferQueue rather than at
BufferQueue construction time.

Change-Id: Icf9f1d91ec612a079968ba0a4621deffe48f4e22
/frameworks/native/libs/gui/CpuConsumer.cpp
e232fdca2a62dc5e81b550f5be8710e36174e7a6 21-Aug-2012 Eino-Ville Talvala <etalvala@google.com> Add BufferItemConsumer, a simple BufferQueue consumer.

BufferItemConsumer allows for acquiring BufferQueue's BufferItems,
which contain all the data and metadata the BufferQueue has for a
given graphics buffer.

This consumer is useful when direct access to the native buffer_handles
is needed by the client.

Also includes a minor cleanup of CpuConsumer's use of 'virtual'.

Bug: 6243944
Change-Id: If7dc4192b15ac499555f1eda42a85140f2434795
/frameworks/native/libs/gui/CpuConsumer.cpp
f57e7540d4cf799f18fe87d3536c55f1e0064931 21-Aug-2012 Eino-Ville Talvala <etalvala@google.com> CpuConsumer: inherit from ConsumerBase

Change-Id: I55178b1d673ffa0fbc6e63ef47642c64d4d03228
/frameworks/native/libs/gui/CpuConsumer.cpp
b42b1ac1587aebda5e2f334d95b620271fafba4e 28-Jun-2012 Jesse Hall <jessehall@google.com> Return fence from acquireBuffer

Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
/frameworks/native/libs/gui/CpuConsumer.cpp
ef19414bd8b77a26f5751f3845be79025a8263fe 14-Jun-2012 Jesse Hall <jessehall@google.com> Transfer HWC release fences to BufferQueue

After a HWC set, each SurfaceFlinger Layer retrieves the release fence
HWC returned and gives it to the layer's SurfaceTexture. The
SurfaceTexture accumulates the fences into a merged fence until the
next updateTexImage, then passes the merged fence to the BufferQueue
in releaseBuffer.

In a follow-on change, BufferQueue will return the fence along with
the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the
fence to signal before returning.

The releaseFence default value for BufferQueue::releaseBuffer() is
temporary to avoid transient build breaks with a multi-project
checkin. It'll disappear in the next change.

Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9
/frameworks/native/libs/gui/CpuConsumer.cpp
e41b318bc4708e1dee9364e73215ff0d51fb76a1 17-Apr-2012 Eino-Ville Talvala <etalvala@google.com> Add a BufferQueue CPU consumer.

Aimed for use cases where gralloc buffers need to be consumed by CPU
users, such as camera image data streams.

The CpuConsumer is a synchronous queue, which exposes raw pointers to
the underlying graphics buffers to applications. Multiple buffers may
be acquired at once, up to the limit set at time of construction.

Change-Id: If1d99f12471438e95a69696e40685948778055fd
/frameworks/native/libs/gui/CpuConsumer.cpp