History log of /frameworks/native/libs/gui/BufferQueue.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8dc55396fc9bc425b5e2c82e76a38080f2a655ff 04-Nov-2014 Dan Stoza <stoza@google.com> Add a BufferItem parameter to onFrameAvailable

Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents. Also
adds an onFrameReplaced callback, which is necessary if the consumer
wants to do anything more than simple queue length tracking.

Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
/frameworks/native/libs/gui/BufferQueue.cpp
e0d5862ad85f7bf4feb1eee9444bf3a5b49c5842 22-Apr-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Finally remove the BufferQueue constructor itself. From now on, all
BufferQueues must be created through the createBufferQueue method.

Bug: 13415624
Change-Id: I192bf9430265bab761dcd59db1f02c9d0ac4feed
/frameworks/native/libs/gui/BufferQueue.cpp
fb39827ebce4637dcba03770f6644cf67e932e06 21-Apr-2014 Dan Stoza <stoza@google.com> Merge "BufferQueue: Increase max slots from 32 to 64"
febd4f4f462444bfcb3f0618d07ac77e3fc1f6ad 10-Apr-2014 Dan Stoza <stoza@google.com> BufferQueue: Increase max slots from 32 to 64

Increases NUM_BUFFER_SLOTS from 32 to 64 and changes the mask
returned by IGBC::getReleasedBuffers from 32 to 64 bits.

Bug: 13174352
Change-Id: Ie8ef0853916cfb91f83881c7241886bb1950f01a
/frameworks/native/libs/gui/BufferQueue.cpp
d9822a3843017444364899afc3c23fb5be6b9cb9 28-Mar-2014 Dan Stoza <stoza@google.com> BufferQueueProducer: add detachNextBuffer

Adds a new method, IGBP::detachNextBuffer, that effectively does
dequeue + request + detach in a single call, but does not need to
know anything about the dequeued buffer, and will not block on
dequeue. This is mostly for the upcoming StreamSplitter to use in
its onBufferReleased callback.

Change-Id: Ie88a69de109003acebaa486a5b44c8a455726550
/frameworks/native/libs/gui/BufferQueue.cpp
fd34b65f717b84fa06d8c37f41b070f41d0ad3a3 11-Apr-2014 Dan Stoza <stoza@google.com> Merge "BufferQueue: Add producer buffer-released callback"
b3d0bdf0dbc19f0a0d7d924693025371e24828fd 08-Apr-2014 Dan Stoza <stoza@google.com> BufferQueue: Remove Bn version of create*

It turns out that there's no reason to have both I* and Bn* versions
of the createBufferQueue method, so I removed the Bn* version.

Change-Id: I66aeb09e10458ae540ddf1f38d2d0154ea8f315b
/frameworks/native/libs/gui/BufferQueue.cpp
f0eaf25e9247edf4d124bedaeb863f7abdf35a3e 21-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Add producer buffer-released callback

Add a callback to the producer side, onBufferReleased, which will be
called every time the consumer releases a buffer back to the
BufferQueue. This will enable a buffer stream splitter to work
autonomously without having to block on dequeueBuffer.

The binder object used for the callback replaces the generic IBinder
token that was passed into IGraphicBufferProducer::connect to detect
the death of the producer. If a producer does not wish to listen for
buffer release events, it can pass in an instance of the
DummyProducerListener class defined in IProducerListener.h, if it even
cares about death events (BufferQueue doesn't enforce the token being
non-NULL, though perhaps we should).

Change-Id: I23935760673524abeafea2b58dccc3583b368710
/frameworks/native/libs/gui/BufferQueue.cpp
73ed82f809a40560fd3a6d53d18e5c846362d764 13-Mar-2014 Jesse Hall <jessehall@google.com> Merge "Add sideband streams to BufferQueue and related classes"
f522af7eb6048c2efae77d7b94960bc49c003e0e 12-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Allow returning interfaces as I*/Bn*

This adds a second createBufferQueue method that returns
sp<IGraphicBuffer*> interfaces instead of sp<BnGraphicBuffer*>, since
most clients don't actually need the Binderized versions (but some
might).

Change-Id: Iaf4f719c96ddb6f704afc75cf52be22588173e32
/frameworks/native/libs/gui/BufferQueue.cpp
399184a4cd728ea1421fb0bc1722274a29e38f4a 04-Mar-2014 Jesse Hall <jessehall@google.com> Add sideband streams to BufferQueue and related classes

Sideband streams are essentially a device-specific buffer queue that
bypasses the BufferQueue system. They can be used for situations with
hard real-time requirements like high-quality TV and video playback
with A/V sync. A handle to the stream is provided by the source HAL,
and attached to a BufferQueue. The sink HAL can read buffers via the
stream handle rather than acquiring individual buffers from the
BufferQueue.

Change-Id: Ib3f262eddfc520f4bbe3d9b91753ed7dd09d3a9b
/frameworks/native/libs/gui/BufferQueue.cpp
9f3053de78630815d60cf48a2cf2348cc5867c45 07-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Allow detaching/reattaching buffers

Adds detachBuffer and attachBuffer calls to both the producer and
consumer sides of BufferQueue. Buffers may be detached while dequeued
by the producer or acquired by the consumer, and when attached, enter
the dequeued and acquired states, respectively.

Bug: 13173343
Change-Id: Ic152692b0a94d99e0135b9bfa62747dab2a54220
/frameworks/native/libs/gui/BufferQueue.cpp
3e96f1982fda358424b0b75f394cbf7c1794a072 03-Mar-2014 Dan Stoza <stoza@google.com> Change BufferQueue into producer/consumer wrapper

Now that BufferQueue has been split into core + producer + consumer,
rewrite BufferQueue to be a thin layer over a producer and consumer
interface. Eventually, this layer will be deprecated in favor of
only using either the producer or consumer interface, as applicable.

Change-Id: I340ae5f5b633b244fb594615ff52ba50b9e2f7e4
/frameworks/native/libs/gui/BufferQueue.cpp
7ea777f097784492f880623067becac1b276f884 19-Nov-2013 Igor Murashkin <iam@google.com> gui: Add tests for IGraphicBufferProducer

* Basic tests only. Needs more complicated queue/dequeue tests.
* Also needs consumer-side tests to really be thorough.

Change-Id: I1099dd56d65b6e9dfa15377726d6054ce657c0ca
/frameworks/native/libs/gui/BufferQueue.cpp
7d2d160cdc3cba9f4454f38433c94b68376cb843 13-Nov-2013 Igor Murashkin <iam@google.com> gui: Update header docs for IGraphicBufferConsumer/Producer/BufferQueue

Also fix compiler warnings for libgui

Change-Id: I0ee38d9ad5eaa82d55bf812d291da8c433581cef
/frameworks/native/libs/gui/BufferQueue.cpp
0012dbc3c6015ace91275f022116e52da9adc4c6 19-Oct-2013 Andy McFadden <fadden@android.com> am 251b11c2: am 85075869: Wait for buffers to drain

* commit '251b11c2045b2ae97f2ab270a65e11b4ca49b1b6':
Wait for buffers to drain
8507586903fa803abf535853a169913f2cf2e555 19-Oct-2013 Andy McFadden <fadden@android.com> Wait for buffers to drain

When a BufferQueue producer disconnects and reconnects, we retain
the previously-queued buffers but empty the slots. This allows
the number of queued buffers to grow without limit. The low-memory
killer does not approve.

Bug 11069934

Change-Id: Ia2eaa954c7a3904b54209a3701dba01689e204d8
/frameworks/native/libs/gui/BufferQueue.cpp
bd381c6164cc7b661dfc3fd7c15696f4225ac810 02-Oct-2013 Jamie Gennis <jgennis@google.com> am 6be1d210: am f0cf5f10: BufferQueue: fix a test crash

* commit '6be1d210eef392f5745d58a0033572b1af4b2f2a':
BufferQueue: fix a test crash
f0cf5f103cf9c54d59de4ed6f1d8ddd2302dec1b 26-Sep-2013 Jamie Gennis <jgennis@google.com> BufferQueue: fix a test crash

Bug: 10935880
Change-Id: If76e9fb055103bad0db7e6c16487532671573149
/frameworks/native/libs/gui/BufferQueue.cpp
6de9653ac876a4cae03d32c1134c56c795b1b11c 20-Sep-2013 Christopher Ferris <cferris@google.com> Merge "Remove unnecessary include."
d142f4b787abae7a5c392ded0dd2741574a0bce2 20-Sep-2013 Christopher Ferris <cferris@google.com> Remove unnecessary include.

All these files are including utils/CallStack.h, but none of the code
uses any CallStack objects.

Change-Id: I38c3a346a3bd0ddbff368d0f7f8b3f3d78fc0432
/frameworks/native/libs/gui/BufferQueue.cpp
c1c05de415854eb7a13a16b7e22a22de8515123a 18-Sep-2013 Mathias Agopian <mathias@google.com> fix camera API 2.0 orientation

we add a flag to ANativeWindow::setBufferTransform that means
"apply the inverse rotation of the display this buffer is displayed
onto to".

Bug: 10804238
Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
/frameworks/native/libs/gui/BufferQueue.cpp
365857df8b94c959dea984a63013f6e7730ef976 12-Sep-2013 Mathias Agopian <mathias@google.com> Make sure do disconnect from a BQ when its client dies.

Bug: 5679534

Change-Id: If447e8673df83fe0b1d6210641e0a48522501a53
/frameworks/native/libs/gui/BufferQueue.cpp
8db92553e9e6263cd41eaf1a1ebc9e3f88f92b5f 30-Aug-2013 Jesse Hall <jessehall@google.com> Force async behavior for the virtual display output BufferQueue

Bug: 10551087
Change-Id: I40bbb2b87d64420939a0ea309254f281437dab56
/frameworks/native/libs/gui/BufferQueue.cpp
3c25621ad7d13f64d3ab95a27fa970fbc9998f73 16-Aug-2013 Andy McFadden <fadden@android.com> Re-enable frame dropping for non-auto timestamps

This change adds an entire field to note whether the timestamp was
auto-generated by Surface or supplied by the application.

The value is used when deciding whether or not to drop frames based
on buffer presentation timestamps. If a desired presentation time
was set explicitly, BufferQueue will use that value to decide if a
frame should be dropped. If the timestamp was generated by Surface
at the time the buffer was queued, the timestamp is ignored.

Bug 10151804

Change-Id: Ibd571a7578351063b813cbdad2ddbeed70655ba5
/frameworks/native/libs/gui/BufferQueue.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/BufferQueue.cpp
687821c05b5a85db1b172e7599861c803d268a8d 05-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Merge "BufferQueue: Support query of consumer usage bits"
d9ba9707b0ab5c53e34d8ce9a5e71c41b85bb8da 03-Aug-2013 Andy McFadden <fadden@android.com> Merge "Roll back recent change"
4b49e08385a96398aa2633e096fe916dc9f08768 03-Aug-2013 Andy McFadden <fadden@android.com> Roll back recent change

Disable dropping of frames based on timestamp. Resume auto-
generating timestamps in Surface.

Bug 10151804

Change-Id: I15de26158e1d7ef22a5b150e685a126dc48ae2b4
/frameworks/native/libs/gui/BufferQueue.cpp
c1c39f8807f5b3dad9ca221d912f7cd4f4f74d9c 02-Aug-2013 Mathias Agopian <mathias@google.com> Merge "Binderize the consumer side of BufferQueue"
86cd09d388d8f6dd52ec1b3e19170966e99caacb 02-Aug-2013 Andy McFadden <fadden@android.com> Merge "Drop frames based on presentation timestamp"
a4e19521ac4563f2ff6517bcfd63d9b8d33a6d0b 01-Aug-2013 Mathias Agopian <mathias@google.com> Binderize the consumer side of BufferQueue

While currently untested, this should allow to move the
BuffereQueue in the consumer process and have everything
work as usual.

Bug: 9265647

Change-Id: I9ca8f099f7c65b9a27b7e7a3643b46d1b58eacfc
/frameworks/native/libs/gui/BufferQueue.cpp
14fab7dd794cd6bf29e6425340683c6221062b3c 01-Aug-2013 Andy McFadden <fadden@android.com> Drop frames based on presentation timestamp

If there are two or more buffers pending that are ready for
immediate presentation, drop all but the last one.

Any code that didn't explicitly specify timestamps for buffers
was using the default value (auto-generated "now"). As a result,
surfaceflinger would drop frames whenever more than one buffer
was queued. We now use zero as the auto-generated timestamp,
and we don't set the timestamp in eglBeginFrame().

Change-Id: I187f42d33de227cd3411ff0dcd3b9ce1961457eb
/frameworks/native/libs/gui/BufferQueue.cpp
ba93b3f8e403636b614a4a379f9421bc70dca84f 02-Aug-2013 Mathias Agopian <mathias@google.com> log an error when dequeueBuffer gets a NULL Fence

Bug: 9858745
Change-Id: If35d6a7d770bf0a42d55bc55880a9ddb721fcfd0
/frameworks/native/libs/gui/BufferQueue.cpp
f7c6087bcc6a85cc82fd8dd83566550f880600ec 30-Jul-2013 Eino-Ville Talvala <etalvala@google.com> BufferQueue: Support query of consumer usage bits

Bug: 9592202
Change-Id: I61a17758200e61adaca695b426db3df0f6637d4c
/frameworks/native/libs/gui/BufferQueue.cpp
ad678e18b66f495efa78dc3b9ab99b579945c9e2 24-Jul-2013 Mathias Agopian <mathias@google.com> single buffer mode for BufferQueue

Bug: 9891035
Change-Id: Id1ab5f911a6dc4c1d8235e65775b3d3635231ad4
/frameworks/native/libs/gui/BufferQueue.cpp
9642dba11046bf4ae6fe9db285e07ef9075da64e 25-Jul-2013 Mathias Agopian <mathias@google.com> Merge "Fix a race in BufferQueue"
6bac363cbdca7f5c4135d66c0e379475ecbd7319 24-Jul-2013 Mathias Agopian <mathias@google.com> Fix a race in BufferQueue

BufferQueue::dequeueBuffer() could incorrectly return
WOULD_BLOCK while in "cannot block" mode if it happened
while a consumer acquired the last allowed buffer
before releasing the old one (which is a valid thing
to do).

Change-Id: I318e5408871ba85e068ea9ef4dc9b578f1bb1043
/frameworks/native/libs/gui/BufferQueue.cpp
207c1e287c129e7ebf679a3aaf2076c3c47c1afb 23-Jul-2013 Mathias Agopian <mathias@google.com> fix log messages and bogus error message

also assert when releasing a buffer and it has
been queued

Change-Id: I6f78d9ceb406ec85ff46c7b6d0c047b14063e3d0
/frameworks/native/libs/gui/BufferQueue.cpp
26a6f37cc06b8014edcedbee8d5558ca7da9abe3 19-Jul-2013 Mathias Agopian <mathias@google.com> make sure to reset the framenumber when a buffer is marked FREE

Change-Id: Ic45929f35553de209801f74e8006fb1bf0b25b45
/frameworks/native/libs/gui/BufferQueue.cpp
7cdd786fa80cf03551291ae8feca7b77583be1c5 19-Jul-2013 Mathias Agopian <mathias@google.com> Make ANW.setSwapInterval(0) work again

we can now queue/dequeue a buffer in asynchrnous mode by using the
async parameter to these calls. async mode is only specified
with those calls (it is not modal anymore).

as a consequence it can only be specified when the buffer count
is not overidden, as error is returned otherwise.

Change-Id: Ic63f4f96f671cb9d65c4cecbcc192615e09a8b6b
/frameworks/native/libs/gui/BufferQueue.cpp
a3fbda3cef04d51a35a3eb64b2f744a989800856 19-Jul-2013 Mathias Agopian <mathias@google.com> BuffferQueue disconnect is now always asynchrnous

we tag queued buffers with the "bufferqueue cannot block" flag
and use that bit to discard a buffer in the queue by new ones
comming in. this allows us to remove the buffer queue drain in
disconnect while maintaining the right behaviour if it gets
connected again (since each buffer remembers how it was enqueued).

Change-Id: I1e703d363a687b70b19ba49cef32213116e8bd3f
/frameworks/native/libs/gui/BufferQueue.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/BufferQueue.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/BufferQueue.cpp
9e3cb55b8f6f007906872decfe3b8a2541e94dd2 07-May-2013 Lajos Molnar <lajos@google.com> BufferQueue: remove freeAllBuffersExceptHeadLocked()

Now that we are having separate buffer-instances for the buffer-
queue, we can free all buffers; we don't have to keep the head
alive.

Change-Id: I023e9161a2501d99333f8868ce438afa914ec50f
Signed-off-by: Lajos Molnar <lajos@google.com>
Related-to-bug: 7093648
/frameworks/native/libs/gui/BufferQueue.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/BufferQueue.cpp
74d211ae26a0257c6075a823812e40b55aa1e653 22-Apr-2013 Mathias Agopian <mathias@google.com> clean-up/simplify all dump() APIs

remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
/frameworks/native/libs/gui/BufferQueue.cpp
753e3415cdaa99f9453d1ea71b163bf1b148e127 05-Apr-2013 Andy McFadden <fadden@android.com> Updated comments

Updated many comments. Added one minor error check.

Change-Id: Ib935dd99d417bada91d2e198008a50dd94269316
/frameworks/native/libs/gui/BufferQueue.cpp
4c00cc11141da7d159eb2323b186ed344115c0f1 16-Mar-2013 Jesse Hall <jessehall@google.com> Fix argument types in IGraphicBufferProducer methods

Bug: 8384764
Change-Id: I7a3f1e1a0584a70af04f9eafef900505389d2202
/frameworks/native/libs/gui/BufferQueue.cpp
d2d5a64aa21cfc548c8c8333d1b36979e5e5a640 12-Mar-2013 Mathias Agopian <mathias@google.com> workaround a deadlock when taking screenshots into a surface

When disconnecting from BufferQueue, we now drain the queue
except the head (which means in the screenshot case we won't
have to block, but we might not have a buffer to show, this
will appear as an error in the log).

Bug: 8362363
Change-Id: If80989aac3c917beea2ebddf3cbb502849d394da
/frameworks/native/libs/gui/BufferQueue.cpp
1df8c345854155cbbcb9f80de9d12d66ea70ac08 20-Dec-2012 Jamie Gennis <jgennis@google.com> libgui: disallow NULL Fence pointers

This change eliminates the uses of a NULL sp<Fence> indicating that no waiting
is required. Instead we use a non-NULL but invalid Fence object for which the
wait methods will return immediately.

Bug: 7892871
Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
/frameworks/native/libs/gui/BufferQueue.cpp
2adaf04fab35cf47c824d74d901b54094e01ccd3 18-Dec-2012 Andy McFadden <fadden@android.com> Rename ISurfaceTexture and SurfaceTexture

The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
/frameworks/native/libs/gui/BufferQueue.cpp
bf974abe92f7495529916fe0f483f3b56e7c30e3 05-Dec-2012 Andy McFadden <fadden@android.com> Refactor SurfaceTexture a bit.

Rearranges updateTexImage() so that the SurfaceFlinger-specific
behavior is in a new SurfaceFlingerConsumer subclass.

SurfaceTexture behavior should not be altered. Instead of
acquire-bind-release we now do acquire-release-bind, but since
it's all done with the lock held there shouldn't be any
externally-visible change.

Change-Id: Ia566e4727945e2cfb9359fc6d2a8f8af64d7b7b7
/frameworks/native/libs/gui/BufferQueue.cpp
73d5662e4c1639e0aa462d420433fe7efa248245 20-Nov-2012 Mathias Agopian <mathias@google.com> fix typo that broke all the builds

cherry pick into master since auto-merger is blocked

Bug: 7584338
Change-Id: Ie7d7c238de1fd224b3b0bae9669a8dcb2f700a79
/frameworks/native/libs/gui/BufferQueue.cpp
2a8c49eb5dd51b2e60c9a78bea00870867d91c03 16-Nov-2012 Mathias Agopian <mathias@google.com> fix an out-of-bounds memory access

in this particular case, this OOB is always harmless
(and that's why it didn't get fixed from MR1), however,
it interfers with valgrind debugging.

Change-Id: Ic977e03287e59c4b124a89146c9023bd0cb540a8
/frameworks/native/libs/gui/BufferQueue.cpp
1efe099a51e2231bd938a6afcf66e6584deec0f2 05-Oct-2012 Jamie Gennis <jgennis@google.com> BufferQueue: alloc without holding the lock

This change makes BufferQueue::dequeueBuffer release its mutex before
allocating new buffers. This should alleviate lock contention in
SurfaceFlinger where SF's main thread can get blocked waiting for an allocation
operation to complete.

Bug: 7335075
Change-Id: I1b000539cc616a695afab2e9c68507db69e57b13
/frameworks/native/libs/gui/BufferQueue.cpp
3fd12e41afcf323fdb99a4cf6bef0f904d72cc8b 03-Oct-2012 Jamie Gennis <jgennis@google.com> libgui: fix up compile options

This change adds debug info to SurfaceFlinger's dumpsys to indicate that the
USE_WAIT_SYNC compile option was enabled, and it removes the
ALLOW_DEQUEUE_CURRENT_BUFFER option.

Bug: 7238122
Change-Id: I70e08e34c2ef58aa6d2f88229e781a119f84b5a9
/frameworks/native/libs/gui/BufferQueue.cpp
6905205c8d130b6ea3a813c1b9283492ed183367 15-Sep-2012 Andy McFadden <fadden@android.com> Fix transform hints

The hints were being set a little too late, so the pre-rotation stuff
wasn't quite working.

Bug 7054997

Change-Id: Id8d5c626db7a76f768ba762a145b315878ee08e6
/frameworks/native/libs/gui/BufferQueue.cpp
c68f2ecfa02037144d1a3856f637a77f523cf416 31-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: add a setMaxAcquiredBufferCount check

This change adds a check to verify the validity of the value passed to
setMaxAcquiredBufferCount.

Change-Id: I39730557aa58261e678bd6e4fce11bab78e98362
/frameworks/native/libs/gui/BufferQueue.cpp
5e5efde7874a9fab650fd4b724ceef46db850470 29-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: add a check for the max acquired bufs

This change adds an error check to ensure that consumers don't acquire more
buffers than the maximum that they set.

Change-Id: I026643564bde52732e4ee6146972b207ddbbba77
/frameworks/native/libs/gui/BufferQueue.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/BufferQueue.cpp
e191e6c34829aec406a9cfe3e95211f884a311ff 25-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: simplify max buffer count handling

This change reworks how the maximum buffer count is computed.

Change-Id: I7d3745814b9bd6f6f447f86bfea8eb7729914ebf
/frameworks/native/libs/gui/BufferQueue.cpp
31a353da225af5329735451c761b430d82dfda1b 25-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: clean up buffer counting

This change is a clean up of some of the handling of the maximum number of
buffers that are allowed at once. It mostly renames a few member variables and
methods, but it includes a couple small refactorings.

Change-Id: I9959310f563d09583548d4291e1050a7bbc7d87d
/frameworks/native/libs/gui/BufferQueue.cpp
1a4d883dcc1725892bfb5c28dec255a233186524 03-Aug-2012 Jamie Gennis <jgennis@google.com> surfaceflinger: refactor FrambufferSurface

This change refactors the FramebufferSurface class to inherit from the new
ConsumerBase class.

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

Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
/frameworks/native/libs/gui/BufferQueue.cpp
c777b0b3b9b0ea5d8e378fccde6935765e28e329 28-Jun-2012 Jesse Hall <jessehall@google.com> Pass fences with buffers from SurfaceTextureClient

Change-Id: I09b49433788d01e8b2b3684bb4d0112be29538d3
/frameworks/native/libs/gui/BufferQueue.cpp
f78575400977f644cf0b12beb2fa5fc278b6ed4c 15-Jun-2012 Jesse Hall <jessehall@google.com> Pass fences from BufferQueue to SurfaceTextureClient

ISurfaceTexture::dequeueBuffer now returns the buffer's fence for the
client to wait on. For BufferQueue, this means passing it through
Binder so it can be returned to the SurfaceTextureClient. Now
SurfaceTextureClient is responsible for waiting on the fence in
dequeueBuffer instead of BufferQueue: one step closer to the goal.

Change-Id: I677ae758bcd23acee2d784b8cec11b32cccc196d
/frameworks/native/libs/gui/BufferQueue.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/BufferQueue.cpp
3e87601170141229d661df93e2f59e1ced73474b 08-Jun-2012 Mathias Agopian <mathias@google.com> Implement SurfaceFlinger's ANW on top of BufferQueue

SF now has its own implementation of ANW for the
framebuffer and it uses BufferQueue. FramebufferNativeWindow
is now only used by stand-alone apps.

Change-Id: Iddeb24087df62bd92b0f78e391dda9b97ddc859c
/frameworks/native/libs/gui/BufferQueue.cpp
f899e4113a5b5545cd91b4625514d0ab0d33751c 19-May-2012 Mathias Agopian <mathias@google.com> Remove misleading and wrong ALOGW

Bug: 6476587
Change-Id: I4345f1100db02786bb50ad83ca7b559cad301706
/frameworks/native/libs/gui/BufferQueue.cpp
b7a6b96301c00c630610df4cb55a45d666200817 14-May-2012 Jamie Gennis <jgennis@google.com> libgui: remove setPostTransformCrop

This change removes the setPostTransformCrop function from
SurfaceTextureClient. It also includes a small logging fix in BufferQueue.

Bug: 6299171
Change-Id: Ifd0ed05b95dad6085e7a8267fda4d69b76ea3bad
/frameworks/native/libs/gui/BufferQueue.cpp
cd1806e210f2633423f0fb14d39fa00d03974223 10-May-2012 Jamie Gennis <jgennis@google.com> libgui: improve some logging and dumping

This change updates some of the SurfaceTextureClient and BufferQueue logging
and dumping to include the crop, transform and scaling mode. It also removes
the uses of the NO_SCALE_CROP scaling mode enum, which was added by accident in
a previous change.

Change-Id: I62912716a1e48885fb22f12b92678aa13f10fcd9
Bug: 6470541
/frameworks/native/libs/gui/BufferQueue.cpp
d72f233ffa125856a44976a50a66ceb669f49ab2 07-May-2012 Jamie Gennis <jgennis@google.com> libgui: Add support for post-xform crops.

This change adds support for specifying a crop rectangle to a
SurfaceTextureClient that is in post-transformed coordinate space.

Change-Id: I247901de343e71b32850f7ae3bac62dfa612ad3d
Bug: 6299171
/frameworks/native/libs/gui/BufferQueue.cpp
efc7ab6dcea8c22ddd7c0259ef4ab4bbf1e93044 18-Apr-2012 Jamie Gennis <jgennis@google.com> libgui: Add plumbing for active rectangle

This change adds the plumbing to SurfaceTextureClient, BufferQueue, and
SurfaceTexture to get the active rectangle passed to the ANativeWindow to
the buffer consumer.

Change-Id: I35da0889b266327ebb079b6a7136fa3e2e8b00e6
/frameworks/native/libs/gui/BufferQueue.cpp
2488b20aec097accb20a853d9876bb0a5dc04636 21-Apr-2012 Mathias Agopian <mathias@google.com> add a way to query whether an ANativeWindow consumer is running ahead of the producer

Change-Id: Ibccfa1feb56db2ab11f0c0934ce2d570a2b65ae2
/frameworks/native/libs/gui/BufferQueue.cpp
24202f5676c32edeef6544cf36e06b9fc970dbde 23-Apr-2012 Mathias Agopian <mathias@google.com> update the binder protocol for connect to match that of queueBuffer

indeed, connect and queueBuffer return the same data, so it's
easier to have them use the same protocol.

Change-Id: I4f9fa3be0a80c9ab0a7a4039b282ae843aab02e1
/frameworks/native/libs/gui/BufferQueue.cpp
6c47034f5ec30041c54d8f0479b01bce566440df 18-Apr-2012 Eino-Ville Talvala <etalvala@google.com> Fix BufferQueue verbose log

Change-Id: Id80742b5c1fd2960cc2eda3a9ba2db1078df5320
/frameworks/native/libs/gui/BufferQueue.cpp
85b217668d6840c8e6a109adfb99461313676f8d 14-Apr-2012 Eino-Ville Talvala <etalvala@google.com> Remove fixed USAGE_HW_TEXTURE flag from BufferQueue.

USAGE_HW_TEXTURE applies to SurfaceTexture, not to all uses of
BufferQueue. Refactor accordingly.

Change-Id: Ic7add5e1f2bbec3d3e796ba7f15eaa0633945d8f
/frameworks/native/libs/gui/BufferQueue.cpp
695e331f01b136155b1559b3c878b7c5bb631bc1 17-Apr-2012 Jamie Gennis <jgennis@google.com> BufferQueue: check before tracing buffer index

This change adds a check on ATRACE_ENABLED before calling snprintf to trace the
buffer index.

Change-Id: Id79430f9c69706393efd3d10780a4cc97055e9e0
/frameworks/native/libs/gui/BufferQueue.cpp
172a62a224967beee9e35e02a5b2fb2705dd2cc0 16-Apr-2012 Mathias Agopian <mathias@google.com> make sure to pass the transform-hint on ANW.connect

this optimization was probably lost during ST refactoring.

Change-Id: I845978c4b718cb91941d15b30484837f19714abe
/frameworks/native/libs/gui/BufferQueue.cpp
b364be8e55a2ce0b0480e237cb9aac30bd215585 13-Apr-2012 Mathias Agopian <mathias@google.com> fix a typo causing pre-rotation to never work

Change-Id: I8d698ec52d53ef1a553b887c7329413e1f49cc72
/frameworks/native/libs/gui/BufferQueue.cpp
016c8cbce4dde21f2703b9865f52d16b8d5d5ae2 04-Apr-2012 Daniel Lam <dalam@google.com> Enabled cropping support in SurfaceTexture

SurfaceTexture will modify the crop rect so it matches
the desired output aspect ratio when the scaling
mode is NATIVE_WINDOW_SCALING_MODE_CROP. Added a test
for this new scaling mode.

Change-Id: I60f24dcbc294b65cd10a393d9e27d40f07d27bb6
/frameworks/native/libs/gui/BufferQueue.cpp
f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246 10-Apr-2012 Mathias Agopian <mathias@google.com> use in/out structures for queueBuffer() IPC

Change-Id: Ie125df2444b62a9a2200586a717dca268852afc9
/frameworks/native/libs/gui/BufferQueue.cpp
fbcda930dd8b2823cfeb160fd0131f5897b7522f 10-Apr-2012 Daniel Lam <dalam@google.com> BufferQueue returns proper code on acquire

Also removed unnecessary debug messages from
SurfaceTextureClient.

Change-Id: I291897a44170142f9d42a007b008823fad4683e0
/frameworks/native/libs/gui/BufferQueue.cpp
abe61bfda4938abd932465e27c29ba9e41aea606 27-Mar-2012 Daniel Lam <dalam@google.com> BufferQueue no longer hardcodes buffer counts

BufferQueue is now more flexible as it can be used
by SurfaceMediaSource in addition to SurfaceTexture.

Change-Id: I4222be8918d63372c44fcd412d9ad241c6a3eeb9
/frameworks/native/libs/gui/BufferQueue.cpp
9abe1ebc9575dc5a19bf1dfce6e9b02e03374457 27-Mar-2012 Daniel Lam <dalam@google.com> Fixed disconnect bug in SurfaceTexture

BufferQueue's disconnect could race with updateTexImage
where invalid buffers could be released. Additionally
fixed similar bug with setBufferCount. Tests were added
to stress the disconnect mechanism.

Change-Id: I9afa4c64f3e025984e8a9e8d924852a71d044716
/frameworks/native/libs/gui/BufferQueue.cpp
851ef8f1bfbb164d61b1528a529a464f0a60dbaf 30-Mar-2012 Mathias Agopian <mathias@google.com> reduce IPC with BufferQueue

collapse setCrop, setTransform and setScalingMode to queueBuffer()
this ends up simplifying things quite a bit and reducing the numnber
of IPC needed per frame.

Change-Id: I3a13c07603abe4e76b8251e6380b107fde22e6d9
/frameworks/native/libs/gui/BufferQueue.cpp
fa5b40ebb8923133df12dc70591bfe35b3f1c9b3 15-Mar-2012 Jamie Gennis <jgennis@google.com> libgui: add BQ consumer buffer free notifications

This change adds a new callback for BufferQueue consumers to be notified
when the BufferQueue frees some or all of its buffers. This is needed
to retain SurfaceTexture behavior where all buffers would be freed when
the producer disconnects. This change also modifies the
SurfaceTextureGLToGLTest.EglDestroySurfaceUnrefsBuffers test to catch
when the buffers are not freed.

The implementation is a little complicated because it needs to avoid
circular sp<> references across what will be a binder interface (so wp<>
can't be used directly). It also needs to avoid the possibility of
locking the BufferQueue and consumer (e.g. SurfaceTexture) mutexes in
the wrong order.

This change also includes a few additional fixes and test cleanups.

Change-Id: I27b77d0af15cb4b135f4b63573f634f5f0da2182
/frameworks/native/libs/gui/BufferQueue.cpp
b267579ba8dfe3f47d2a481c5a3c2254e3d565a1 23-Feb-2012 Daniel Lam <dalam@google.com> SurfaceTexture: Fully refactored from BufferQueue

SurfaceTexture and BufferQueue are separate objects.

Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
/frameworks/native/libs/gui/BufferQueue.cpp
74ff8c23f44f1546d0c7004302f4c7ba726ff4c0 13-Mar-2012 Dave Burke <daveburke@google.com> attempt to fix a deadlock in SurfaceTextureClient::disconnect

- condition wasn't signaled if an error happened between acquire and release
- also replace signal with broadcasts

Bug: 6109450
Change-Id: I8ac03c7eca35c9cc04a00ef7fad36bb9cb3fcef6
/frameworks/native/libs/gui/BufferQueue.cpp
c2c1f2f24cd70bdcf1958157bab38467bf0fdc71 07-Mar-2012 Daniel Lam <dalam@google.com> BufferQueue: fixed issues with buffer slots not available

Bug: 6120953
Change-Id: I61d97d650c8dee0a6d7c19f2f50aa92a5f159095
/frameworks/native/libs/gui/BufferQueue.cpp
757507e3a0a25fe83e60c354b6ac0e975662109a 06-Mar-2012 Mathias Agopian <mathias@google.com> Merge "Add ATRACEs for Buffer indices"
3fcee50ffaeb745819356e395408b4d7e3239c13 02-Mar-2012 Daniel Lam <dalam@google.com> BufferQueue: fixed acquire operation

Bug: 6082872
Change-Id: I897dc61eb84fed953e51f97871cd3ae6321505d4
/frameworks/native/libs/gui/BufferQueue.cpp
546ed2d7d98ce4f1415647913a231a6b4fc6ca66 02-Mar-2012 Mathias Agopian <mathias@google.com> Add ATRACEs for Buffer indices

Change-Id: I44d7a9a9bf03f418cab2a4854583aac9e533daee
/frameworks/native/libs/gui/BufferQueue.cpp
1c8e95cf86f2182986385bc1ee85f13f425f3a3a 24-Feb-2012 Jamie Gennis <jgennis@google.com> Add tracing to various graphics components.

This change adds ATRACE call tracing to BufferQueue,
SurfaceTextureClient, SurfaceTexture, SurfaceFlinger, Layer, and EGL.

Change-Id: I9d75ed26f5a3f0d1af635da38289520134cfbbb7
/frameworks/native/libs/gui/BufferQueue.cpp
eae59d2ea77ef57aab203fb185a880ce37ac38d6 23-Jan-2012 Daniel Lam <dalam@google.com> Removed dependecies between BufferQueue and SurfaceTexture

Refactored SurfaceTexture and BufferQueue such that share
no protected members. Created an consumer facing interface
for BufferQueue in preparation of connecting SurfaceTexture
and BufferQueue through a binder.

Change-Id: I938e63e085128148c58d0e26c7213b30145c109f
/frameworks/native/libs/gui/BufferQueue.cpp
fbb16559168b88e30ffbe6d466f4c044366f503c 27-Feb-2012 Jamie Gennis <jgennis@google.com> Merge "Revert "Removed dependecies between BufferQueue and SurfaceTexture""
90ac799241f077a7b7e6c1875fd933864c8dd2a7 26-Feb-2012 Mathias Agopian <mathias@google.com> fix libgui header location

Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
/frameworks/native/libs/gui/BufferQueue.cpp
9b10c47e112afc3600380895046a4a56e34cf6a8 27-Feb-2012 Daniel Lam <dalam@google.com> Revert "Removed dependecies between BufferQueue and SurfaceTexture"

This reverts commit a631399f71dbc7659d2f241968f85d337726ae61
/frameworks/native/libs/gui/BufferQueue.cpp
333023884112259f145bb23c41a05211198d9792 23-Jan-2012 Daniel Lam <dalam@google.com> Removed dependecies between BufferQueue and SurfaceTexture

Refactored SurfaceTexture and BufferQueue such that share
no protected members. Created an consumer facing interface
for BufferQueue in preparation of connecting SurfaceTexture
and BufferQueue through a binder.

Change-Id: Iff55e740e36a7f70c9f7a17ee7a5af38e3d21f0f
/frameworks/native/libs/gui/BufferQueue.cpp
b856052c00dfef70d0957482c72c2979ffc4733a 31-Jan-2012 Daniel Lam <dalam@google.com> Refactored query function from SurfaceTexture into BufferQueue

Change-Id: Id1cb6cc38d01edb4fcfcad867c5a7693bdcc3ab1
/frameworks/native/libs/gui/BufferQueue.cpp
6b091c53000c843211c218ce40287a7edca9bc63 23-Jan-2012 Daniel Lam <dalam@google.com> Refactored ISurfaceTexture calls from SurfaceTexture into BufferQueue.

Change-Id: I514f6b802f6b49c9ae27bed37bf0b9d23da03c9a
/frameworks/native/libs/gui/BufferQueue.cpp