• Home
  • History
  • Annotate
  • only in /frameworks/native/include/gui/
History log of /frameworks/native/include/gui/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
eb7980c224a54f860b7af5ecf30cbc633ae41289 28-Jun-2016 Pablo Ceballos <pceballos@google.com> BQ: Add and expose a unique id

Bug 29422927

Change-Id: I80eab94f073ebc378302f00fa86a740c3643657e
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
53ca2e00c6f2a71b93c8e3c8e85aeeb03c5bd06d 22-Jun-2016 Greg Kaiser <gkaiser@google.com> Sensor: Make getId() more varied

Apps from different developers will now receive a different
ID for the same dynamic sensor. Additionally, all apps
will now receive a different/new ID for the same dynamic
sensor after a factory reset.

Bug: 28775590, 29547335
Change-Id: I368655b0e4bdc16736a7fd163ea3f7dad2886b3b
ensor.h
82364e3cea0bf88fa8147766433329b3dd5148b8 15-May-2016 Robert Carr <racarr@google.com> SurfaceFlinger: Add mode to apply position with resize.

For some cases, like scaled windows with shadows,
we need to be able to apply the position concurrent with
window resize. This is because the scaling of the shadows causes
the top left coordinate of the non shadow surface content
to change before and after the resize.

Bug: 28899837
Change-Id: I522eacfbbcd79707dc1e5ab71901a263b3004ba9
urfaceComposerClient.h
urfaceControl.h
1a61da5e28fa16ad556a58193c8bbeb32a5f636d 28-Apr-2016 John Reck <jreck@google.com> Return the transform to apply in getLastQueuedBuffer

Bug: 28428955
Change-Id: Id48f7d3bf3f5deb074cf0a6a52a41caac875db41
ufferQueueProducer.h
LConsumer.h
GraphicBufferProducer.h
urface.h
6a2d3a06caa337857cf60cfc70a9a78909ad3608 21-Dec-2015 Peng Xu <pengxu@google.com> Fix sensor uuid, retrofit recent event logger

Fix an issue that causes uuid field not being initialzed in
sensorservice.

MostRecentEventLogger in sensorservice is migrated to use RingBuffer
instead of a custom circular buffer. This is expected to improve
readability and maintainability of code.

Dumpsys print format is retouched to offer more information in easier
to read format.

Bug: 28305085

Change-Id: I190e43350b60a22a9fccb92a95d6eab06a471560
ensor.h
50101d02a8eae555887282a5f761fdec57bdaf30 08-Apr-2016 Dan Stoza <stoza@google.com> libgui: Add getLastQueuedBuffer to BufferQueue

Adds the ability to get the last buffer queued to a BufferQueue plus
its acquire fence.

Bug: 27708453
Change-Id: Iee39475740b40c854a5f46178b2934fd930e61b8
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
c3574f7b0141c69fdca25ccafb80ff334462f9a3 24-Mar-2016 Robert Carr <racarr@google.com> Add setOverrideScalingMode to SurfaceControl

Provide an interface for the window manager to override
the client specified scaling mode. This makes it possible
for the window manager to force windows to be scaleable
for animations, etc, even when a resize is pending.

Bug: 27891386
Change-Id: Ic4aae9917bd6869ee0dbb425979b4e21c68342a3
urfaceComposerClient.h
urfaceControl.h
dc71bebc3d65918ec5c1c7cea1dae0a0af5468d7 13-Apr-2016 Rob Carr <racarr@google.com> Merge "Add Surface::waitForNextFrame" into nyc-dev
9f31e299b3ec93b7bac969846105e7e926e3efcd 11-Apr-2016 Robert Carr <racarr@google.com> Add Surface::waitForNextFrame

We can use this for cases like SurfaceView
where one thread (e.g. the framework code)
wants to wait for an unknown client thread
to render a frame in to the surface before
we report it as shown to the window manager.

Bug: 22207948
Change-Id: I9d3344aa1c0ab0f0efd9df24e90ce0410d5f2e22
urface.h
df4f17e100e56a1f2964797ad83499e07ba9e062 11-Apr-2016 Peng Xu <pengxu@google.com> Merge "Refactor sensor list in SensorService" into nyc-dev
0cc8f809924706c7d683da30605f432635dd5bb6 06-Apr-2016 Peng Xu <pengxu@google.com> Refactor sensor list in SensorService

Refactor sensor lists management logic in sensorservice:
* Factor all sensor list management code into a separate class.
* Remove error-prone repeated sensor lists.
* Solve synchronization issue when sensor is added or removed during runtime.
* Switch to STL containers.

Bug: b/27911774

Change-Id: I94d5571e1fa3166dbe893ffac2a2a7584be6349c
ensor.h
c4f471e75a8ec64ec34e3f2944a5a756215d0bec 24-Mar-2016 Dan Stoza <stoza@google.com> Plumb HDR capabilities up to SurfaceComposerClient

Plumbs HDR capabilities up from HWC2 through SurfaceFlinger and
ISurfaceComposer to SurfaceComposerClient.

Bug: 25684127
Change-Id: I0f07043ff42bfc7a159f785fee3e84936dc3c280
SurfaceComposer.h
urfaceComposerClient.h
a84b43c914cdd0e665d7555f5800d5c06b895716 29-Mar-2016 Peng Xu <pengxu@google.com> Merge "Define typical sensor sample rate in native code" into nyc-dev
2f3bf13887257abc9943b7e5bf58e9cd8189eb0a 17-Mar-2016 Peng Xu <pengxu@google.com> Define typical sensor sample rate in native code

Porting typical sensor sample rate (e.g. SENSOR_DELAY_UI)
defined in Java API to native code.

Change-Id: I8b59216415bc952b4e953ca6e8058beb1dd3c645
ensorEventQueue.h
59d12e90ae09171fc8b50fd8fd02e3247c04840c 28-Mar-2016 Pablo Ceballos <pceballos@google.com> Merge "Rename single buffer mode to shared buffer mode" into nyc-dev
acbe67888f0bd65d5400400f0115bae6bd6199dc 04-Mar-2016 Pablo Ceballos <pceballos@google.com> Add final crop implementation

Bug 26559810

Change-Id: Idaccd13cd625c92d18665ddecebdbb266ea365f3
urfaceComposerClient.h
urfaceControl.h
3559fbf93801e2c0d9d8fb246fb9b867a361b464 17-Mar-2016 Pablo Ceballos <pceballos@google.com> Rename single buffer mode to shared buffer mode

Change-Id: Id43d0737d9367981644e498942ebc0077d61038c
ufferItem.h
ufferQueueCore.h
ufferQueueProducer.h
ufferSlot.h
GraphicBufferProducer.h
urface.h
295a9fc8aa87daa2cded5c1a279b8cd24e9a9a9f 15-Mar-2016 Pablo Ceballos <pceballos@google.com> BQ: Allow shared buffer to be the first queued buffer

- When single-buffer mode is enabled the shared buffer will now be
either the first buffer dequeued or the first buffer queued.
Whichever comes first.

Bug 24940410

Change-Id: I9f7e2630640e37fe1fb967aed41a3025567247a8
ufferQueueCore.h
GraphicBufferProducer.h
e07e3e5ef56b768d73e78fb273f2cfe6ebffc945 15-Mar-2016 Pablo Ceballos <pceballos@google.com> Revert "Add a callback thread to ConsumerBase"

This reverts commit 22b5702b40eca423171124e69c3d4ad03a3e6900.

Bug 27557176

Change-Id: Icc0e79af82329e6414ed44a99e90631cfcf140fa
onsumerBase.h
cc19ec809e45616449f332d2e72c754d7debf9fb 02-Mar-2016 Eino-Ville Talvala <etalvala@google.com> Merge "GUI: Move Surface.aidl here and implement for native" into nyc-dev
649449dbb777e58ea5f6f1af61f84022d088190c 02-Mar-2016 Chong Zhang <chz@google.com> Merge "Add SurfaceControl::disconnect() to disconnect currently connected API" into nyc-dev
4782b268d54d737294de7b51bdff4ecda2f1c1f0 02-Mar-2016 Pablo Ceballos <pceballos@google.com> Merge "Revert "Revert "Partial revert of "Fix Surface slot caching"""" into nyc-dev
3827379b2e414b4c96793dd3555302638db02562 02-Mar-2016 Pablo Ceballos <pceballos@google.com> Revert "Revert "Partial revert of "Fix Surface slot caching"""

This reverts commit 16c9c304a33af36faa352d32777bc48c50bf7b74.

Change-Id: Icbdcba8a646ac40c0533c1c04f5b15769332976c
ufferQueueCore.h
ProducerListener.h
88612912ac8406f2be0eeff97892274f98509017 06-Jan-2016 Eino-Ville Talvala <etalvala@google.com> GUI: Move Surface.aidl here and implement for native

- Move android/view/Surface.aidl parcelable definition from frameworks/base
- Implement matching native behavior to android.view.Surface parceling,
to enable use of android.view.Surface in generated native AIDL interfaces

Bug: 25091611
Change-Id: I87ffbb9a19c27a99ce0749d0ca1f17aaa6b3fe74
urface.h
8e9d9e2ae645261a9d0df0ed8238057b8356f236 01-Mar-2016 Dan Stoza <stoza@google.com> Merge changes I4589e02a,Id300e8b2 into nyc-dev

* changes:
Switch SurfaceFlinger to HWC 2.0
HWC2On1Adapter: Initialize variables and fix mutex
1b3a9acb77ee12568fa19740d8eeab165a0dcd98 01-Mar-2016 Chong Zhang <chz@google.com> Add SurfaceControl::disconnect() to disconnect currently connected API

bug: 27295820
Change-Id: I6f51338bc15e018ed7899172653599ab6254c8c9
ufferQueueCore.h
urfaceControl.h
d8bb8da1b742c34e0d2c97cfd6d097b21df9bc47 29-Feb-2016 Pablo Ceballos <pceballos@google.com> Merge "Revert "Partial revert of "Fix Surface slot caching""" into nyc-dev
9e56aa0fdb5f7121b9b975c6c16db103ea4d2fe9 02-Nov-2015 Dan Stoza <stoza@google.com> Switch SurfaceFlinger to HWC 2.0

Enables SurfaceFlinger to speak to version 2.0 of the Hardware Composer
HAL instead of version 1.x (also removing support for the framebuffer
HAL). By default, however, this functionality is disabled. In order to
enable it, USE_HWC2 must be set to true in Android.mk.

Change-Id: I4589e02ac2165236b10ff2f7cb772f87e0d3daab
LConsumer.h
a4c2c3ba1ed2d741edfa652bf8f2bab229389e8e 23-Feb-2016 Dan Stoza <stoza@google.com> Merge changes I8cc3ce7d,Ie1a7bfd2,Id472ed4e into nyc-dev

* changes:
libgui: Allow for pending releases in GLConsumer
SF: HWC2 C++ shim
SF: HWC2On1Adapter
3ce460440b0ab0b6d6407c9d8735b19f6e3b8408 18-Nov-2015 Dan Stoza <stoza@google.com> libgui: Allow for pending releases in GLConsumer

Adds the ability for GLConsumer to record a pending release instead of
releasing the buffer immediately. This will be used by SurfaceFlinger
to latch a new buffer without having to immediately release the old
one, since it needs to get a fence from HWC before releasing.

Change-Id: I8cc3ce7d5ff80e2ea4b4d681b028db042352d229
LConsumer.h
d880e517a56d2a73199591bcb9531a4ffa5b53cc 22-Feb-2016 Pablo Ceballos <pceballos@google.com> Merge "Add a callback thread to ConsumerBase" into nyc-dev
22b5702b40eca423171124e69c3d4ad03a3e6900 20-Feb-2016 Pablo Ceballos <pceballos@google.com> Add a callback thread to ConsumerBase

- Add a message queue and callback thread in ConsumerBase.
- This is used to prevent deadlocks when ConsumerBase calls into
BufferQueueConsumer and that generates a callback.

Bug 27229287

Change-Id: I45c41e5a554555511fcfa5c185a7d60b0d969b7e
onsumerBase.h
16c9c304a33af36faa352d32777bc48c50bf7b74 19-Feb-2016 Pablo Ceballos <pceballos@google.com> Revert "Partial revert of "Fix Surface slot caching""

This reverts commit 981066c3a5be3e4775b6537ef32268f7e108c912.
ufferQueueCore.h
ProducerListener.h
981066c3a5be3e4775b6537ef32268f7e108c912 18-Feb-2016 Pablo Ceballos <pceballos@google.com> Partial revert of "Fix Surface slot caching"

- Partially reverts commit 789a0c82cb370d6b82f401cc130af58c85802cbf.
- Leaves the fix in Surface, but reverts all changes to the
Producer/Consumer listeners.

Bug 27246023
Bug 27229287

Change-Id: I9283f9e59e666b5ae44c0db25f99a80d05eea3ee
ufferQueueCore.h
ProducerListener.h
789a0c82cb370d6b82f401cc130af58c85802cbf 05-Feb-2016 Pablo Ceballos <pceballos@google.com> Fix Surface slot caching

- Now that it's possible to resize a BufferQueue while buffers are
dequeued/acquired, it's no longer correct for Surface to clear its
cache when the BufferQueue is resized since it must keep at least
the currently dequeued buffers.
- Add an onSlotsFreed callback to IProducerListener so that producers
that wish to be notified about buffers being freed can do so. Note
that this isn't currently used in Surface.
- Review and fixup all the places where the producer/consumer
listeners for freed buffers should be called.

Change-Id: I4ab0c92bc69b75a3c072ddf5d74d78f941dba4c8
ufferQueueCore.h
ProducerListener.h
ff95aabbcc6e8606acbd7933c90eeb9b8b382a21 14-Jan-2016 Pablo Ceballos <pceballos@google.com> Add interface for controlling single buffer auto refresh

- Adds a boolean to BufferQueue that controls whether or not auto
refresh is enabled in SurfaceFlinger when in single buffer mode.
- Adds plumbing up to ANativeWindow.
- When enabled, it will cache the shared buffer slot in Surface in
order to prevent the Binder transaction with SurfaceFlinger.

Bug 24940410

Change-Id: I83142afdc00e203f198a32288f071d926f8fda95
ufferItem.h
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
72daab652e3481566c01ce45c6afdb9fcec6f140 08-Dec-2015 Pablo Ceballos <pceballos@google.com> BQ: Flexible resizing

- Allow the producer to call setMaxDequeuedBufferCount and the
consumer to call setMaxAcquiredBufferCount when buffers are
currently dequeued/acquired as long as the new value is not less
than the number of dequeued/acquired buffers.

Bug 22768206

Change-Id: I599a4027a6ae9cb0a1c0d5ec60cb5e65b86a345b
GraphicBufferConsumer.h
GraphicBufferProducer.h
9e314337cdc65b1fbf52060e9a6a4ddf2215c352 12-Jan-2016 Pablo Ceballos <pceballos@google.com> BQ: Conditionally compile validateConsistencyLocked

- Only enable it on userdebug and eng builds so that it won't slow
down user builds.

Change-Id: I70933a23d54657fdf5cbc23873da4fbee84b9a26
ufferQueueCore.h
23b4abe024ea88c45e0b94c80e1fb537a573b143 08-Jan-2016 Pablo Ceballos <pceballos@google.com> BQ: Improved buffer/slot tracking

- Explicitly track active buffers and unused slots on top of the
already existing tracking for free slots and free buffers.

Change-Id: Ife2678678e96f0eb0b3fb21571058378134bd868
ufferItem.h
ufferQueueCore.h
ufferQueueProducer.h
ufferSlot.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
2576cb63b3fe1592f54816625036566b9eb0793a 20-Jan-2016 Peng Xu <pengxu@google.com> Dynamic Sensor Discovery implementation

Defined the dynamic sensor meta data type and UUID of sensor.

Implementation in sensorservice and the native SensorManager to
support Dynamic sensor discovery.

Change-Id: I9df2f2ae51d46cd946a9757393f7a60b52cc4fb8
SensorServer.h
ensor.h
ensorManager.h
70982a5f95f68295244e5f6cc037c193713a5259 12-Jan-2016 Dan Stoza <stoza@google.com> Revert "libgui: Remove custom BufferQueue allocators"

This reverts commit acd56150573d3a6d449c0de01f93c6f269d121e3.

Change-Id: I877f63a57fbddb4dcff71b3909b460ecc05981eb
ufferQueue.h
ufferQueueCore.h
acd56150573d3a6d449c0de01f93c6f269d121e3 08-Jan-2016 Dan Stoza <stoza@google.com> libgui: Remove custom BufferQueue allocators

Removes the ability to set a custom GraphicBuffer allocator for a
BufferQueue. Custom-allocated buffers may still be used through the
attachBuffer call.

Change-Id: I127bdfb496fc089a61c7e266c8bd2b906d41f32e
ufferQueue.h
ufferQueueCore.h
5ecfb68ffd63d352df0392dca6e95ef67a66c679 05-Jan-2016 Dan Stoza <stoza@google.com> libgui: Fix attaching buffers without allocation

This changes the way that BufferQueue selects slots in
waitForFreeSlotThenRelock. This method is called from both
dequeueBuffer and attachBuffer, but those two methods actually have
different preferences:

dequeueBuffer wants a slot with a buffer if possible (to avoid
unnecessary allocations), but will settle for a slot without a buffer
if no free buffers are available.

attachBuffer wants a slot without a buffer if possible (to avoid
clobbering an existing buffer), but will settle with clobbering a free
buffer if no empty slots are available.

These preferences are now respected, which has the side-effect of
fixing a bug where it was not possible to attach a buffer if allocation
is disabled (since the previous implementation assumed finding a slot
without a buffer meant that the caller intended to allocate a buffer,
which would accordingly be blocked since allocation is disabled).

Bug: 26387372
Change-Id: Iefd550fd01925d8c51d6f062d5708d1f6d517edd
ufferQueueProducer.h
127fc63e8a15366b4395f1363e8e18eb058d1709 30-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add dequeue/attach timeout

Adds the ability to specify the timeout when dequeueBuffer or
attachBuffer block due to the lack of a free buffer/slot. By default,
these will block indefinitely (which is signified by a timeout of -1).

When a timeout (other than -1) is specified, non-blocking mode is
disabled and the given timeout will be used instead.

Bug: 25196773
Change-Id: I17fdbeebccb7c8d878703d758ac1209608258e61
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
c2e7788721489c5a2ef681fd0bfa591d2ce41175 17-Dec-2015 Robert Carr <racarr@google.com> Expose setScalingMode from Surface.

While we are here fix a validation error causing
NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP to never be applied.
Furthermore, we remove GLConsumer logic causing the scaling mode to
be reinitialized when buffers change.

Bug: 26010823
Change-Id: I1bf1e4fdc2eded67ff401783cf24f920e4684326
urface.h
6eaede6acbc672c552579ba54714227f13afae36 05-Nov-2015 Pablo Ceballos <pceballos@google.com> Merge changes from topic 'single_buffer_mode'

* changes:
SF: Force refresh when in single buffer mode
BQ: Add support for single buffer mode
063121849890da78b1ad7fb96c54c795de5d1fd6 08-Oct-2015 Pablo Ceballos <pceballos@google.com> SF: Force refresh when in single buffer mode

- Add a boolean to BufferItem to track whether single buffer mode is
enabled. When it is, force SurfaceFlinger to acquire a new buffer
and refresh on every vsync.

Bug 24940410

Change-Id: Iea67330c416b6fb14500865f98c67f1c12f23197
ufferItem.h
ccdfd60d79a8b7f1ed6401d0f2e8e29166a10584 08-Oct-2015 Pablo Ceballos <pceballos@google.com> 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
ufferQueueCore.h
ufferQueueProducer.h
ufferSlot.h
GraphicBufferProducer.h
urface.h
3b0d488e87bf602998749e27ad5b555122895a90 24-Oct-2015 Pablo Ceballos <pceballos@google.com> Finish up the Rect constructor cleanup

Bug 18173359

Change-Id: I36e83ba4e9ce9884533952d8321d22f666cc8a06
puConsumer.h
7dde599bf1a0dbef7390d91c2689d506371cdbd7 22-May-2015 Dan Stoza <stoza@google.com> Support SurfaceView synchronization.

Add API for fetching the next frame number to be produced by
a given buffer producer. Add an API to SurfaceComposer to
defer execution of the current transaction until a given frame number.
Together these may be used to synchronize app drawing and surface
control updates.

Change-Id: I8e0f4993332ac0199c768c88581a453fefbaff1d
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
urfaceComposerClient.h
urfaceControl.h
b687a2814ca9db576eb1ea33dea90ac35cd61bc1 06-Oct-2015 Pablo Ceballos <pceballos@google.com> BQ: fix Volantis test failures

The Volantis driver will dequeue a buffer in eglCreateWindowSurface.

- Remove the requirement that no buffers be dequeued when calling
setAsyncMode() on a BufferQueueProducer, since this gets called
from eglSwapInterval.
- Modify the tests to call setMaxDequeuedBufferCount before calling
eglCreateWindowSurface.

Change-Id: Icc64e9933f151771bbd57035549cd5928c0b7216
GraphicBufferProducer.h
567dbbb6dd42be5013fcde0dadb3316d85f2fa0d 27-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: get rid of async in producer interface

- Get rid of the async flag in dequeueBuffer, allocateBuffers,
waitForFreeSlotThenRelock, and QueueBufferInput.
- Instead use the persistent flags mDequeueBufferCannotBlock and
mAsyncMode to determine whether to use the async behavior.

Bug 13174928

Change-Id: Ie6f7b9e46ee3844ee77b102003c84dddf1bcafdd
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
583b1b32191992d6ada58b3c61c71932a71c0c4b 04-Sep-2015 Pablo Ceballos <pceballos@google.com> BQ: Prevent operations on disconnected BQs

- Update unit tests to match

Bug 23763412

Change-Id: I77e59bf6b57b328433c3835450455f80a8fa454b
ufferQueueProducer.h
GraphicBufferProducer.h
ff12cba77b5b88f3978070bb970d7721225271ee 16-Sep-2015 Pablo Ceballos <pceballos@google.com> Merge "BQ: Modify consumer buffer count interfaces"
9d508ed8a4e45371234548da48e626b82d60d370 14-Sep-2015 Pablo Ceballos <pceballos@google.com> Rename mBuf to mSlot in BufferItem

- All instances of mBuf have now been removed from the code base, so
remove the union and get rid of it.

Bug 19769719

Change-Id: I49db71a664702dd355bdb9efe6b955fee2d54531
ufferItem.h
19e3e06e3c65a7c001a6fe0971744ba5ff536515 20-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: Modify consumer buffer count interfaces

- Rename setDefaultMaxBufferCount() to setMaxBufferCount(). Modify it
to be hard maximum on the number of buffers that can't be overwritten
by the producer.
- Enforce the maximum buffer count in setMaxAcquiredBufferCount(),
setMaxDequeuedBufferCount(), and setAsyncMode().
- Remove mOverrideMaxBufferCount as it's no longer needed since
overriding is no longer possible.
- Expose setMaxAcquiredBufferCount() in GLConsumer.
- Remove disableAsyncBuffer(), it was only being used for single buffer
mode. Single buffer mode is now achievable with setMaxBufferCount().

Bug 13174928

Change-Id: Ia33799f42751272a711fbd8559f7602ce9f18e4f
ufferQueueConsumer.h
ufferQueueCore.h
LConsumer.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
urface.h
e5b755a045f4203fdd989047441259893c6fbe2d 14-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: Get rid of setBufferCount

- Remove setBufferCount from BufferQueueProducer and
IGraphicsBufferQueueProducer.
- Get rid of the unit tests for it.
- In Surface, convert setBufferCount calls into calls to
setMaxDequeuedBufferCount.
- Change mOverrideMaxBufferCount to a boolean since it can now be
derived from mMaxAcquiredBufferCount, mMaxDequeuedBufferCount, and
mAsyncMode.

Bug 13174928

Change-Id: Ia0adc737fae9e13f186df832b8428a0829041bf9
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
fa455354557f6283ff3a7d76979e52fd251c155f 13-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: add setMaxDequeuedBufferCount

Adds the new setMaxDequeuedBufferCount() function to
BufferQueueProducer. This will eventually replace setBufferCount.

Also add setAsyncMode.

Bug 13174928

Change-Id: Iea1adcd5d74a75f67d8e9dde06d521695628ad5a
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
60d6922a011fe18c111b8d30fb6ef1f655b6b15e 07-Aug-2015 Pablo Ceballos <pceballos@google.com> libsgui: Change Rect default constructor

The current Rect default constructor initializes to all zeroes. Change
it to initialize to an invalid Rect.

Modify all of the existing invocations of the default constructor to
maintain the existing behavior.

Bug 18173359

Change-Id: Ibbad076f1550a94f56d7b1cf5350071f2022e09a
puConsumer.h
cbf4004fc45d2f5a14ec9e00d39cd6ca49bd07ad 30-Jul-2015 Aravind Akella <aakella@google.com> Bug fix in SensorManager.

If SensorService hasn't started when SensorManager instance is requested, keep retrying for a
longer duration.

Bug: 22529981
Change-Id: I3c506d962b61347085fc80b2c5832289539d6853
(cherry picked from commit e2806cb4456e3815e979f333ed23ec7df591a9ff)
ensorManager.h
8034fc63a06768678a7afe0bfcc7070a65eda1ab 29-Jul-2015 Narayan Kamath <narayan@google.com> Revert "Bug fix in SensorManager."

This reverts commit 869eb2089ec8a6286b944bfcff57e4cbe0c7e207.

Change-Id: I4fb865e3b18bbb011fa4e4b4732336930c3a45ae
ensorManager.h
869eb2089ec8a6286b944bfcff57e4cbe0c7e207 24-Jul-2015 Aravind Akella <aakella@google.com> Bug fix in SensorManager.

If SensorService hasn't started when SensorManager instance is requested, keep retrying for a
longer duration.

Bug: 22529981
Change-Id: I4ba6b760608e34d79273aeb39568f0fa72fbaf9d
ensorManager.h
841a5926fc9b3f9f0e654ba3aab8e43bea7de7f1 29-Jun-2015 Aravind Akella <aakella@google.com> Enable sensor data injection mode through adb.

Change-Id: I415cf8ff0871fa74babaf9b879c68f210298b472
SensorServer.h
ensorManager.h
c6f30bdee1f634eb90d68cb76efe935b6535a1e8 08-Jun-2015 Dan Stoza <stoza@google.com> libgui/SurfaceFlinger: Add getConsumerName

Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is update on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: I22c7881d778e495cf8276de7bbcd769e52429915
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
a2ca9bf0a9789e9e5e37961ebfb356347f59309e 08-Jun-2015 Dan Stoza <stoza@google.com> Revert "libgui: Add getConsumerName"

This reverts commit 107fbe5599016b0e35145a1a00c4f238b63d61e4.

Change-Id: I0c2b0f7c81193b05eb3dd2f5a59f83598434b744
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
107fbe5599016b0e35145a1a00c4f238b63d61e4 06-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add getConsumerName

Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is updated on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: Ife94bd89023fe7c00bad916932b9a19233fd2290
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
812ed0644f8f8f71ca403f4e5793f0dbc1fcf9b2 03-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add generation numbers to BufferQueue

This change allows producers to set a generation number on a
BufferQueue. This number will be embedded in any new GraphicBuffers
created in that BufferQueue, and attempts to attach buffers which have
a different generation number will fail.

It also plumbs the setGenerationNumber method through Surface, with the
additional effect that any buffers attached to the Surface after
setting a new generation number will automatically be updated with the
new number (as opposed to failing, as would happen on through IGBP).

Bug: 20923096
Change-Id: I32bf726b035f99c3e5834beaf76afb9f01adcbc2
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
urface.h
041b945e07168712fd4d2fec06f76aeaeaa5fc9e 22-May-2015 Chong Zhang <chz@google.com> Merge "fix BufferItem flatten/unflatten alignment" into mnc-dev
47f674dfeca31b29810ecb90f1277918b67c4cf8 22-May-2015 Chong Zhang <chz@google.com> fix BufferItem flatten/unflatten alignment

bug: 21370100
Change-Id: Ia3991dc591c176bdbd1d78d1804aa22777525b62
ufferItem.h
699a32bcdfaf0390a269a275b979d46ca815654a 18-May-2015 Michael Lentine <mlentine@google.com> Merge "Refactor ConsumerBase and it's derived classes." into mnc-dev
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
ufferItemConsumer.h
onsumerBase.h
puConsumer.h
e478305181bb8dc8706361bc702256fe73f958de 15-May-2015 John Reck <jreck@google.com> Add ConsumerBase::isAbandoned

Bug: 20105644
Change-Id: I21526b5397ea51a15500c44a99daa9d75fc4ea67
onsumerBase.h
a4650a50a0b35e9e4342d6600b6eb24fd94bb8e5 12-May-2015 Dan Stoza <stoza@google.com> Fix PTS handling for buffer replacement

This changes the way that SurfaceFlinger's shadow buffer management
works such that instead of tracking the size of the shadow queue in the
BufferQueue, SF tracks the last frame number it has seen, and passes
that into the acquireBuffer call. BufferQueueConsumer then ensures that
it never returns a buffer newer than that frame number, even if that
means that it must return PRESENT_LATER for an otherwise valid buffer.

Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
ufferQueueConsumer.h
ufferQueueCore.h
onsumerBase.h
LConsumer.h
GraphicBufferConsumer.h
dc13c5b85b099050c73297a19f1ef89308f7620b 12-May-2015 Dan Stoza <stoza@google.com> libgui: Hook up onFrameReplaced

This completes the plumbing from ConsumerListener::onFrameReplaced into
SurfaceFlinger (and other consumers that may care).

Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300
ufferQueue.h
onsumerBase.h
5fa32d4b08843d0aeca567a173227e8e37322e8e 07-May-2015 Svet Ganov <svetoslavganov@google.com> Fix broken NDK sensor manager API.

Change-Id: I21bb8b0dcfd3f1c812753a9fd77dea792e7155f2
ensorManager.h
c28fe8f5c54c5e98be7664dcffdbd5b324b850d6 02-May-2015 Svetoslav <svetoslavganov@google.com> Merge "Add body sensors app op - framework native" into mnc-dev
b412f6e203b38f8047f760261a5e3dc6d0722f08 30-Apr-2015 Svetoslav <svetoslavganov@google.com> Add body sensors app op - framework native

Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
SensorServer.h
ensor.h
ensorEventQueue.h
ensorManager.h
ecc504043fddb7a75042ce402c67aedfac04d5e2 28-Apr-2015 Dan Stoza <stoza@google.com> SurfaceFlinger: Fix PTS on stale buffers

SurfaceFlinger's (Layer's) shadow copy of the BufferQueue queue was
getting out of sync for a few reasons. This change fixes these by
doing the following:

- Adds a check to re-synchronize the shadow copy every time we
successfully acquire a buffer by first dropping stale buffers before
removing the current buffer.
- Avoids trying to perform updates for buffers which have been rejected
(for incorrect dimensions) by SurfaceFlinger.
- Adds IGraphicBufferConsumer::setShadowQueueSize, which allows the
consumer to notify the BufferQueue that it is maintaining a shadow
copy of the queue and prevents it from dropping so many buffers
during acquireBuffer that it ends up returning a buffer for which the
consumer has not yet received an onFrameAvailable call.

Bug: 20096136
Change-Id: I78d0738428005fc19b3be85cc8f1db498043612f
(cherry picked from commit 2e36f2283f48ab764b496490c73a132acf21df3a)
ufferQueueConsumer.h
ufferQueueCore.h
GraphicBufferConsumer.h
4afd8b67f9be307e6c6ed89deab2e85516bb3a0e 26-Feb-2015 Dan Stoza <stoza@google.com> BufferQueue: Add NATIVE_WINDOW_BUFFER_AGE query

Adds a NATIVE_WINDOW_BUFFER_AGE query, which returns the age of the
contents of the most recently dequeued buffer as the number of frames
that have elapsed since it was last queued.

Change-Id: Ib6fd62945cb62d1e60133a65beee510363218a23
(cherry picked from commit 49f810c72df8d1d64128e376757079825c8decd4)
ufferQueueCore.h
d9c4971da2f2c4f980a748006bd40469c3332a13 27-Apr-2015 Dan Stoza <stoza@google.com> libgui: Change detachNextBuffer to return sp<GB>

Changes Surface::detachNextBuffer to return an sp<GraphicBuffer>
instead of an ANativeWindowBuffer* to ensure that reference counting
works correctly.

Bug: 20092217
Change-Id: I3979ea6121aaf14845f0554477b778770413581e
(cherry picked from commit 8b2daa3ca29492b181fb67840640d771c4a2b3ac)
urface.h
579529130d5ef2f4164615ccfbbedfb140e5a43f 25-Apr-2015 Aravind Akella <aakella@google.com> Build fix change method signature of enableDataInjection.

Change-Id: I3927aec64f5a1555d2e5d07591fd04e7b3be5f09
ensorManager.h
cc60dc2128a98f952beb187da22b28dcba0124ad 25-Apr-2015 Aravind Akella <aakella@google.com> Merge "Enable data injection mode in SensorService."
6febf6c150b47a8e9ec7d77d988c176fe89ccbf2 24-Apr-2015 Dan Stoza <stoza@google.com> am 5d10894c: am ef47c080: am 958f5011: Merge "libgui: Allow an IGBProducer to disable allocation"

* commit '5d10894c9d547449cf231f02b736da9dfdebec11':
libgui: Allow an IGBProducer to disable allocation
7536ef4f07a3e8bfe227dbabe2298965af9d9e0e 24-Apr-2015 Dan Stoza <stoza@google.com> am 437fb850: am f96a7581: am fb6d43ff: Merge "libgui: Change BufferQueue to use free lists"

* commit '437fb850b0667be3e8655cb1ac6a8d491f59d045':
libgui: Change BufferQueue to use free lists
a9e6cc387072e25706a6d847a97b02a6f25a918b 17-Apr-2015 Aravind Akella <aakella@google.com> Enable data injection mode in SensorService.

Change-Id: I0cd32a017235c31c54816e4a357ce3b988350ed6
SensorServer.h
ensorEventQueue.h
ensorManager.h
9de7293b0a1b01ebe6fb1ab4a498f144adc8029f 17-Apr-2015 Dan Stoza <stoza@google.com> libgui: Allow an IGBProducer to disable allocation

Adds a new method IGBP::allowAllocation, which controls whether
dequeueBuffer is permitted to allocate a new buffer. If allocation is
disallowed, dequeueBuffer will block or return an error as it
normally would (as controlled by *ControlledByApp).

If there are free buffers, but they are not of the correct dimensions,
format, or usage, they may be freed if a more suitable buffer is not
found first.

Bug: 19801715
Change-Id: I0d604958b78b2fd775c2547690301423f9a52165
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
0de7ea752900b5da29ad19c2799040235477f3c5 23-Apr-2015 Dan Stoza <stoza@google.com> libgui: Change BufferQueue to use free lists

BufferQueue used to choose free buffers by scanning through its array
of slots and picking one based on timestamp. This changes that
mechanism to use a pair of free lists: one with buffers attached and
one without. This makes it easier to choose either type of free slot
depending on the needs of the current operation.

Fixes an issue with the first version of this change, found in bugs
20482952, 20443314, and 20464549.

Bug: 13175420
Change-Id: I9b6e83cfe8f9b4329a976025cb8e291d51fb6d4a
ufferQueueCore.h
83e9f6e75e0c32efba8a337bcf9eb44cbab2346c 23-Apr-2015 Dan Stoza <stoza@google.com> am 41422980: am d2c12e4c: am 7637e35d: Merge "Revert "libgui: Change BufferQueue to use free lists""

* commit '41422980fabb087390791d951c28fef072d93be1':
Revert "libgui: Change BufferQueue to use free lists"
7637e35d17e06d532b0d2d11c0eef60594726209 22-Apr-2015 Dan Stoza <stoza@google.com> Merge "Revert "libgui: Change BufferQueue to use free lists""
1fc9cc25a487d4d9dea3cc185331e3481ead36ff 22-Apr-2015 Dan Stoza <stoza@google.com> Revert "libgui: Change BufferQueue to use free lists"

This reverts commit 8dddc990103b71137be2a6365a26b1ac36598e68.

Change-Id: I0b0fed9f1394c6f6ae812f6c562ead4473a8226e
ufferQueueCore.h
2bff43a91240ba3e2f98778233f3c9fb8221bbf7 22-Apr-2015 Dan Stoza <stoza@google.com> am 3805a00d: am 91f16b1b: am e647ddde: Merge "libgui: Fix CPU rendering on Surface"

* commit '3805a00d6efef02535aaed96f412e0c55a9875f8':
libgui: Fix CPU rendering on Surface
c62acbd12711ee6cff1ef94c146316dfe5169045 22-Apr-2015 Dan Stoza <stoza@google.com> libgui: Fix CPU rendering on Surface

When the surface damage code went in, it incorrectly assumed that if
an application was doing CPU rendering, it would be using lock and
unlockAndPost instead of dequeue and queue, so it repurposed the dirty
region too aggressively. This change keeps it from clobbering the
dirty region if a CPU producer is attached.

Bug: 20431815
Change-Id: Id4dfd71378311ea822f0289f6de2d20a7bd84014
urface.h
97ef903db12c72b24afba66c9971bbf35ec68de5 20-Apr-2015 Dan Stoza <stoza@google.com> am aadb236d: am 483c76dc: am ff5c1a6b: Merge "libgui: Change BufferQueue to use free lists"

* commit 'aadb236d2e944791c1e7600eae9439fcb8a6caa9':
libgui: Change BufferQueue to use free lists
8dddc990103b71137be2a6365a26b1ac36598e68 17-Apr-2015 Dan Stoza <stoza@google.com> libgui: Change BufferQueue to use free lists

BufferQueue used to choose free buffers by scanning through its array
of slots and picking one based on timestamp. This changes that
mechanism to use a pair of free lists: one with buffers attached and
one without. This makes it easier to choose either type of free slot
depending on the needs of the current operation.

Bug: 13175420
Change-Id: Ic8398e7511bd11a60a1c82e3ad2ee271c9822be1
ufferQueueCore.h
2992fcd0b2da1b98b0dfd9c80459e8648e72447e 15-Apr-2015 Dan Stoza <stoza@google.com> am 057a561a: am 57a9f5a0: am fd5f41be: Merge "libgui: Pass surface damage through BufferQueue"

* commit '057a561afbf30ede99b5ec627deec7ee11701f6d':
libgui: Pass surface damage through BufferQueue
5065a55291b67f584d7b0be3fa3cfc4e29a3cd1c 18-Mar-2015 Dan Stoza <stoza@google.com> libgui: Pass surface damage through BufferQueue

This change adds support for passing surface damage all of the way
down from the EGL interface through the consumer side of the
BufferQueue. Depends on system/core change
Ie645e6a52b37b5c1b3be19481e8348570d1aa62c

Bug: 11239309
Change-Id: I4457ea826e9ade4ec187f973851d855b7b93a31b
ufferItem.h
GraphicBufferProducer.h
urface.h
668285721ba81fc4fb6f5e223b382f5e604c64c2 08-Apr-2015 Dan Stoza <stoza@google.com> am 172ff24c: am 5977851b: am 00afb817: Merge "libgui: Plumb detachBuffer through ConsumerBase"

* commit '172ff24ccbc232cdf244a2bcbbb51df754929521':
libgui: Plumb detachBuffer through ConsumerBase
634f5ee6a713b3cf4086a2af8e9b56e76cba245f 03-Apr-2015 Dan Stoza <stoza@google.com> libgui: Plumb detachBuffer through ConsumerBase

Exposes IGraphicBufferConsumer::detachBuffer as a ConsumerBase
method. attachBuffer is not currently exposed, because all current
clients will be recycling buffers through the allocator.

Bug: 19628705
Change-Id: I3e519767fa43d5d880c1d5695e31b60f6ad588af
onsumerBase.h
921d1d7a61f527b7bbf42e9ba46bd92342cc7c99 02-Apr-2015 Dan Stoza <stoza@google.com> Revert "libgui: Plumb attach/detach through CpuConsumer"

This reverts commit 20c5672883796c0dedf38f51dc2fc6f140b09ae6.
puConsumer.h
231832eb27107fb561467f5f4a9be2c577c61ea8 11-Mar-2015 Dan Stoza <stoza@google.com> DO NOT MERGE libgui: Plumb attach/detach through Surface

Exposes the attachBuffer and detachNextBuffer calls from
IGraphicBufferProducer to the public Surface interface. Also moves
the version of connect that takes a producer callback from protected
to public.

Bug: 19628705
Change-Id: I9ebc3013c4d9c84c4e8ef150c00e03f8af80319e
(cherry picked from commit c14ecb9de243af8864610fd3c74342e3ca2cb4bc)
urface.h
7844220f657dce74a9b05b794f7f5e253eb256e8 26-Mar-2015 Aravind Akella <aakella@google.com> Build error SensorManager.

Remove forward declaration for String8 and inlcude the corresponding header file.

Change-Id: I89a4ea42295dc9bb6db2c304ff725cc1d498cd55
ensorManager.h
4949c50372de4c7fdb57de1dc0c1f5bb3ac463eb 12-Feb-2015 Aravind Akella <aakella@google.com> Support restricted mode in SensorService.

In restricted mode, only CTS tests can register for sensors or call flush() on them. The requests
from other applications will be ignored.

Change-Id: Ieb923df3e0cfe3390fe2d052af776da79589744b
SensorServer.h
ensorManager.h
1c87e474d87d6d1380fb61d476d606b1a2fda1c1 13-Mar-2015 Dan Stoza <stoza@google.com> DO NOT MERGE libgui: Remove IGBC::BufferItem

Removes IGraphicBufferConsumer::BufferItem. Depends on the
following changes:
I187b3a7d05196b6289596afac8fb9a9d4aebff76
I0ddd38df37500cfd6b21d1e768ed14e39c5cd9fc

Cherry-pick of Id1fa56d092188f2cb712768d5d2fc6a9027fb73c

Change-Id: I3edf0db8fba656fd78e18a5a7f1137f0fb6b237d
ufferItem.h
ufferItemConsumer.h
ufferQueue.h
ufferQueueConsumer.h
ufferQueueCore.h
onsumerBase.h
LConsumer.h
GraphicBufferConsumer.h
cf3834db104e0b052056e3a06d46e3f222f0d372 11-Mar-2015 Dan Stoza <stoza@google.com> DO NOT MERGE libgui: Prepare for IGBC::BufferItem removal

Currently, there are two instances of BufferItem: one inside of
IGraphicBufferConsumer, and a standalone one inside of libgui. They
only differ in the name of one of the fields, and we want to remove
the IGBC version. This changes things so that client code may be
incrementally switched over to the libgui version.

This is a squashed commit containing the following changes:
I64f495105f56cbf5803cea4aa6b072ea29b70cf5
I1394e693314429ada93427889f10b7b01c948053
I9c3bc8037fa9438d4d9080b8afb694219ef2f71f
I699ed0a6837076867ca756b28d1ffb2238f7a0d9
Iac8425e1241774304a131da2fb9dec6e82922f13

Change-Id: Ic4d51f5df6dbc70b376d13fceba2335b9bae4f3d
ufferItem.h
ufferItemConsumer.h
ufferQueueConsumer.h
onsumerBase.h
LConsumer.h
GraphicBufferConsumer.h
82c6bcc9705eabcaf5b9e45bc81867b0e2d61a02 20-Feb-2015 Eino-Ville Talvala <etalvala@google.com> DO NOT MERGE 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

Cherry pick of I070bd2e7c56506055c419004c29e2e3feac725df

Change-Id: I461952389c18051176c6b75e664f20ad369f5760
ufferItem.h
ufferItemConsumer.h
ufferQueueConsumer.h
ufferQueueCore.h
puConsumer.h
LConsumer.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
urface.h
1a309eba79067bd3d1f73406fdcbc44a385a0c4d 19-Mar-2015 Dan Stoza <stoza@google.com> libgui: Fix bad merge in Surface.h

Fixes a bad merge from AOSP.

Change-Id: Idb69b34787e8f4e76fb64130573168e5fde6a87c
urface.h
be4ccdcdd5988948a7876af0d1f621840a36eaa1 19-Mar-2015 Dan Stoza <stoza@google.com> am 663eaf42: am ad36432d: Merge "Surface: Permit an IProducerListener on connect"

* commit '663eaf422d325768808b416d66ecd4648bb14799':
Surface: Permit an IProducerListener on connect
48245f0c6de556daa79564a1637da4e71e25f455 19-Mar-2015 Dan Stoza <stoza@google.com> Merge "libgui: Plumb attach/detach through Surface"
966b98bd86abc6473167bc98ddf8ddb1f8dd2ed5 03-Mar-2015 Dan Stoza <stoza@google.com> Surface: Permit an IProducerListener on connect

This change allows clients of Surface to provide an IProducerListener
callback object to Surface::connect, which will be passed down to the
underlying IGraphicBufferProducer.

Cherry pick of I5ea5229bf3a329bf02c6bd20e7247039c75d136b

Change-Id: I6f8f52c72654e4cee649721383819bafe378f964
urface.h
3be1c6b60a188dc10025e2ce156c11fac050625d 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.

Cherry pick of I034abec27bf4020d84af60d7acc1939c59986dd6 plus a
couple of minor changes to CpuConsumer.cpp to make it work with a
prior change:
Uncomment CC_LOGV on line 46
Change C-style cast to static_cast on line 71

Change-Id: Iaec610477ea0122317b0578fb74caf2383d4cf08
ufferItemConsumer.h
ufferQueueConsumer.h
ufferQueueCore.h
ufferQueueProducer.h
puConsumer.h
LConsumer.h
raphicBufferAlloc.h
GraphicBufferAlloc.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
SurfaceComposer.h
ensor.h
urface.h
urfaceComposerClient.h
urfaceControl.h
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
puConsumer.h
724768f9163ea2483614877895fa74140fbb386e 17-Mar-2015 Dan Stoza <stoza@google.com> Revert "libgui: Plumb attach/detach through CpuConsumer"

This reverts commit 43078e2827211139f0614719c920f3c5bff6c3fa.

Change-Id: Ifef774d9922bb90450384e810e4767b56cc29de3
puConsumer.h
c14ecb9de243af8864610fd3c74342e3ca2cb4bc 11-Mar-2015 Dan Stoza <stoza@google.com> libgui: Plumb attach/detach through Surface

Exposes the attachBuffer and detachNextBuffer calls from
IGraphicBufferProducer to the public Surface interface. Also moves
the version of connect that takes a producer callback from protected
to public.

Bug: 19628705
Change-Id: I9ebc3013c4d9c84c4e8ef150c00e03f8af80319e
urface.h
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
puConsumer.h
54716317b5752010134edc64421a3f492bd608ab 13-Mar-2015 Dan Stoza <stoza@google.com> libgui: Remove IGBC::BufferItem

Removes IGraphicBufferConsumer::BufferItem. Depends on the
following changes:
I187b3a7d05196b6289596afac8fb9a9d4aebff76
I0ddd38df37500cfd6b21d1e768ed14e39c5cd9fc

Change-Id: Id1fa56d092188f2cb712768d5d2fc6a9027fb73c
ufferItem.h
ufferItemConsumer.h
ufferQueue.h
ufferQueueConsumer.h
ufferQueueCore.h
onsumerBase.h
LConsumer.h
GraphicBufferConsumer.h
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
ufferItemConsumer.h
onsumerBase.h
LConsumer.h
de7100ab2304434f73cbd1022823835184511d04 12-Mar-2015 Dan Stoza <stoza@google.com> libgui: Add a BufferItem overload to IGBC::acquire

Adds an overload of IGraphicBufferConsumer::acquireBuffer which takes
an android::BufferItem instead of an IGBC::BufferItem.

Change-Id: I9c3bc8037fa9438d4d9080b8afb694219ef2f71f
ufferQueueConsumer.h
GraphicBufferConsumer.h
8757c016c8b8fd039347ab8f773dee28603a7a1c 11-Mar-2015 Dan Stoza <stoza@google.com> libgui: Add BufferItem(IGBC::BufferItem)

Add a constructor for building a BufferItem from an
IGraphicBufferConsumer::BufferItem.

Change-Id: I1394e693314429ada93427889f10b7b01c948053
ufferItem.h
358fc008f37e81c2a20425b9707fe137d2b1dbc4 11-Mar-2015 Dan Stoza <stoza@google.com> libgui: Add a union to BufferItem for refactoring

Currently, there are two instances of BufferItem: one inside of
IGraphicBufferConsumer, and a standalone one inside of libgui. They
only differ in the name of one of the fields, so this change modifies
the one inside of libgui to have a union of both names so that the
one inside of IGBC can eventually be refactored away.

Change-Id: I64f495105f56cbf5803cea4aa6b072ea29b70cf5
ufferItem.h
94d5ac480286d5e4d856bb968263e6991a62002d 06-Mar-2015 Eino-Ville Talvala <etalvala@google.com> Merge "Add dataSpace to buffer queues; remove old format enums."
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
ufferItem.h
ufferItemConsumer.h
ufferQueueConsumer.h
ufferQueueCore.h
puConsumer.h
LConsumer.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
urface.h
f8e3c6b6d8051331f3d7d535635dfbb2c40ed1b9 03-Mar-2015 Dan Stoza <stoza@google.com> Surface: Permit an IProducerListener on connect

This change allows clients of Surface to provide an IProducerListener
callback object to Surface::connect, which will be passed down to the
underlying IGraphicBufferProducer.

Change-Id: I5ea5229bf3a329bf02c6bd20e7247039c75d136b
urface.h
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
puConsumer.h
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
ufferItemConsumer.h
ufferQueueConsumer.h
ufferQueueCore.h
ufferQueueProducer.h
puConsumer.h
LConsumer.h
raphicBufferAlloc.h
GraphicBufferAlloc.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
SurfaceComposer.h
ensor.h
urface.h
urfaceComposerClient.h
urfaceControl.h
753011461964c5a610c12d4dfc9ab85ab20b6977 05-Dec-2014 Dan Albert <danalbert@google.com> am 5588d900: Merge "Enable clang for libui/libgui/surfaceflinger"

* commit '5588d9000cd1ef217185c9001d6b5ecd84db9741':
Enable clang for libui/libgui/surfaceflinger
01049c8321aab30cd431e2febeddd79242ae5a4f 11-Nov-2014 Dan Stoza <stoza@google.com> Enable clang for libui/libgui/surfaceflinger

Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
(cherry picked from commit f10c46ef855b6410b20ebd8b1351d4d78d8eca8e)
ensor.h
f10c46ef855b6410b20ebd8b1351d4d78d8eca8e 11-Nov-2014 Dan Stoza <stoza@google.com> Enable clang for libui/libgui/surfaceflinger

Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
ensor.h
bfd633e131585d8e924b6a77c66284ec7e5dcc72 08-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/native: Fix unused parameter warning

Pulled in in hardware/, where -Werror is used.

Change-Id: I13fc31d31fe2f623d39c84862b0c95a28813723d
(cherry picked from commit a32900deec6284973100a29f7b399d061f82b3a8)
ConsumerListener.h
a32900deec6284973100a29f7b399d061f82b3a8 08-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/native: Fix unused parameter warning

Pulled in in hardware/, where -Werror is used.

Change-Id: I13fc31d31fe2f623d39c84862b0c95a28813723d
ConsumerListener.h
8e624d4cad45532c09879356f3adaa3b65fdcfc9 07-Nov-2014 Dan Stoza <stoza@google.com> am 98d20f82: Merge "Add a BufferItem parameter to onFrameAvailable" into lmp-mr1-dev

* commit '98d20f82ca8979b30c81df9639f54ab11e1951f9':
Add a BufferItem parameter to onFrameAvailable
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
ufferItem.h
ufferQueue.h
ufferQueueProducer.h
onsumerBase.h
ConsumerListener.h
treamSplitter.h
1495ceb88594bf3c5963ef65ee12953dc0354546 08-Aug-2014 Jesse Hall <jessehall@google.com> surfaceflinger: fix -Wmismatched-tags warnings

warning: struct 'HWComposer' was previously declared as a class
[-Wmismatched-tags]

warning: class 'DisplayInfo' was previously declared as a struct
[-Wmismatched-tags]

Change-Id: I13db9f8aab3a957ce8ff8d64598dae1807d6fe7e
(cherry picked from commit 646f54105018e99ef4a30ee41f01f7d1ab66c38e)
SurfaceComposer.h
20fca75fbd9141ebae6c9a28f5c09a837eb9caad 08-Oct-2014 Jesse Hall <jessehall@google.com> am b7702c5c: Merge "BufferQueueProducer: Throttle EGL frame production." into lmp-mr1-dev

* commit 'b7702c5ce7f010fa5f19646fd79f28ff04e7014b':
BufferQueueProducer: Throttle EGL frame production.
b7702c5ce7f010fa5f19646fd79f28ff04e7014b 08-Oct-2014 Jesse Hall <jessehall@google.com> Merge "BufferQueueProducer: Throttle EGL frame production." into lmp-mr1-dev
ae29ee0a9eea291316248a90799ff28f35defeb6 04-Oct-2014 Aravind Akella <aakella@google.com> am 93176114: am a7eb4b74: Merge "Fix sockfd leakage in SensorService." into lmp-dev

* commit '93176114cf34c9874c2db70fd7665e9f95dda9d0':
Fix sockfd leakage in SensorService.
99a0afbaee9eddabc2b544e3a5c432901c1d498c 30-Sep-2014 Eric Penner <epenner@google.com> BufferQueueProducer: Throttle EGL frame production.

Throttling was previously controlled by a combination of the
driver and the number of buffers in the queue. This patch makes
a more consistent trade-off, which allows two GPU frames pending
but not three. More buffering could improve throughput in the
case of varying frame times, but this also increases latency.

Bug: 17502897
Change-Id: I4ee68019ca94c635294c5959931a555a6c4ef2df
ufferQueueProducer.h
021543fc657a7f21d1b143c68258282b35262906 03-Oct-2014 Aravind Akella <aakella@google.com> am a7eb4b74: Merge "Fix sockfd leakage in SensorService." into lmp-dev

* commit 'a7eb4b74f74423dafd88adf94a7984ae927c3a23':
Fix sockfd leakage in SensorService.
8a96955c8e14db40b16164236830fc9506a00872 29-Sep-2014 Aravind Akella <aakella@google.com> Fix sockfd leakage in SensorService.

i) Call removeFd() only if the fd in the BitTube has been
previously added to the Looper. Use a flag to determine whether the fd
has been previously added or not.
ii) Increment mPendingFlushEventsToSend after holding a connectionLock.
iii) Store the number of acks that are pending in SensorEventQueue
and send them all at once.

Bug: 17472228
Change-Id: I1ec834fea1112a9cfbd9cddd2198438793698502
ensorEventQueue.h
147372fdf9fae688114121228247497d43514ab7 19-Sep-2014 Lajos Molnar <lajos@google.com> resolved conflicts for merge of 67d8bd66 to lmp-mr1-dev-plus-aosp

Change-Id: I5e7e6fdf0d2afe6c3e4a0ed6ef96afb4713a72bc
435d9cde2777950c1d93b0982839d6796c5688b2 19-Sep-2014 Lajos Molnar <lajos@google.com> resolved conflicts for merge of 67d8bd66 to lmp-dev-plus-aosp

Change-Id: I2e9aab90ac53bb32630598f50cc26f6e46acf6d6
67d8bd66aaf04805cb8f2616ba964141b865e3b9 11-Sep-2014 Lajos Molnar <lajos@google.com> surfaceflinger: add getDisplayStats() method

This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.

Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
SurfaceComposer.h
3d0daa57f5f180418fdecbf06f6a5a41e566f6d9 12-Sep-2014 Aravind Akella <aakella@google.com> am 8493b79e: SensorService fixes

* commit '8493b79e1cff92450076ca7450c4bf4e434a6816':
SensorService fixes
8493b79e1cff92450076ca7450c4bf4e434a6816 09-Sep-2014 Aravind Akella <aakella@google.com> SensorService fixes

i) Significant Motion multiple clients fix. Make a copy of
mActiveConnections vector before cleaning up SensorEventConnections
when one-shot sensors trigger.
ii) Maintain a mapping between flush_complete_events and
SensorEventConnections to accurately map flush() API calls and
corresponding flush_complete_events
iii) Remove all references to 1_1 and 1_2 HALs.
iv) Dynamically allocate sensor_event buffers in SensorService main
threadLoop.

Bug: 17412359
Change-Id: If3c3986197660cafef2d2e0b4dc7582e229cf1c4
ensorEventQueue.h
5746f1497814e105352214f1bba242317856605a 10-Sep-2014 Dan Albert <danalbert@google.com> am fb017a4c: Merge "Fix clang warnings about struct vs. class."

* commit 'fb017a4c3b23741f737093c3fcb78087bbe5e73c':
Fix clang warnings about struct vs. class.
aeb8ab8c34343bd64a4b2247615ea3da97fa02f6 10-Sep-2014 Dan Albert <danalbert@google.com> Fix clang warnings about struct vs. class.

Change-Id: I9f26cd01ac3153efa6d77a4133686842e2d63203
SurfaceComposer.h
75ec33e0e609e3ef074f4230c2227e52bf82ad06 09-Sep-2014 Riley Andrews <riandrews@google.com> am d15ef27f: Update ScreenshotClient to take advantage of rotation in surfaceflinger\'s screencap api

* commit 'd15ef27f9b13727fa7358e3c09572f66bb1e0668':
Update ScreenshotClient to take advantage of rotation in surfaceflinger's screencap api
129dc8423da319d42af6ef71046c39ba59c0d878 09-Sep-2014 Riley Andrews <riandrews@google.com> am edb86f9f: Merge "Add rotation to surfaceflingers screen cap." into lmp-dev

* commit 'edb86f9f681e082a64a670814ee4d73ccf39942a':
Add rotation to surfaceflingers screen cap.
d15ef27f9b13727fa7358e3c09572f66bb1e0668 05-Sep-2014 Riley Andrews <riandrews@google.com> Update ScreenshotClient to take advantage of rotation in surfaceflinger's screencap api

Change-Id: I836649d9d5cd5958ce34e47f26f4a36d2d05d24c
urfaceComposerClient.h
7d831871032675e252490b52ddbb29a63e5497bf 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.

Had missed these when resolving merge conflicts last night.

Change-Id: I1a381a06c3909b76a3b44ce79c37aa6f244d3736
ufferQueueCore.h
c3ebe66b49cfba035e1fd0e160a13db38eb81b0e 05-Sep-2014 Riley Andrews <riandrews@google.com> Add rotation to surfaceflingers screen cap.

+ This is needed so that activity manager does not
have to do cpu side rotations when capturing recents
thumbnails.

Change-Id: If998008e675ad01305db8399fd643cf4608b7025
SurfaceComposer.h
9e3adfcebf28c5c76085108dffe98c74df56857d 04-Sep-2014 Aravind Akella <aakella@google.com> SensorService flush fixes.

i) Fix a possible race condition when adding a pending flush connection
to mActiveSensors data structure.
ii) Invalidate flush_complete_events as soon as they are consumed by a
connection so that they are not used by other connections which are
registered for the same sensor.

Change-Id: I1491bea8c2081c4aab1feacc60add13b7aa26bb7
ensorEventQueue.h
2d14a0ed4f5861bfa67e9db138ffdc70d2d5e6e4 26-Aug-2014 Eric Penner <epenner@google.com> GLConsumer: Fix eglTerminate/eglInit edge case.

If a display is terminated and then initialized, we can't detect
this using the display itself (it has the same value), but all
EglImages still become invalid for the display. This patch detects
this during image binding and forces creation of a new EglImage.

Bug: 10430249
Change-Id: I75101c50962f21263dca3ec6e241a2e5a3c23dad
LConsumer.h
6c2664ae34fd582bc174d3c83e2b18e895ca2496 13-Aug-2014 Aravind Akella <aakella@google.com> SensorService fixes.

1) Flush should only be received by the app calling flush(). Maintain
a queue of all flush() calls and send flush_complete events in that
order.
2) Log warnings for older HALs. Remove batch() calls with DRY_RUN flag.
3) Reallocate event cache when more sensors register and the desired
maxCacheSize increases. Clear NEEDS_ACK flag in the buffer whenever
there is a write() failure.
4) More dump information. Add wake-up flag, maxDelay and timestamps for
sensor events.

Bug: 16874778
Change-Id: I195646191059fd31f75f2f07886c0f98bf9b509a
ensorEventQueue.h
7cb0d39016ff8061fe9fc2967870c145a6ffa2ac 30-Jul-2014 Rachad <rachad@google.com> Tunneled Video Playback support

Added native_window_set_sideband_stream() method to Surface.[h|cpp]
Added ConfigureVideoTunnelModeParams OMX configuration structure to
HardwareAPI.h

Bug: 16132368
Change-Id: I28fa1b9dbe858d93e353e0991098cad45c626bd9
urface.h
1f6078aef71b1d3f080cd565adbec350c71088dd 27-Jun-2014 Michael Wright <michaelwr@google.com> Have VirtualDisplays send SF resize messages when resizing

Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
urfaceComposerClient.h
03414a1cfe6c1222fd7723949bd622f9cba145aa 01-Jul-2014 Riley Andrews <riandrews@google.com> Turn on support for async cursor update in surfaceflinger.

If available, surfaceflinger will use the hwc setCursorPositionAsync()
api to change the position of supported cursor layers outside of
the usual prepare/set loop.

Change-Id: Ib3fc5c0c390b3489ddbba202379840a1d2748917
SurfaceComposerClient.h
c268068c55afaaa441fda903b1b84a5b5c8a0a01 25-Jul-2014 Aravind Akella <aakella@google.com> Merge "SensorService performance improvements." into lmp-dev
56ae42613c91f6a6fb0dc3f626daa24666fd18c2 11-Jul-2014 Aravind Akella <aakella@google.com> SensorService performance improvements.

i) Send ack for wake_up sensors on the socket connection instead of using Binder RPC.
ii) Cache events per connection in case there are write failures. Compute cache size
from FIFO counts of sensors.
iii) Send FlushCompleteEvent only for apps that explicitly called flush().

Change-Id: I018969736b7794b1b930529586f2294a03ee8667
itTube.h
SensorEventConnection.h
2295687487a0f2cc3e77915d5b0fe794d3af4d20 24-Jul-2014 Eric Penner <epenner@google.com> Merge "GLProducer: Reference count images rather than buffers." into lmp-dev
78014f32da6d0ebf52fb34ebb7663863000520a0 16-Jul-2014 Antoine Labour <piman@google.com> BufferQueue: release mutex while allocating. DO NOT MERGE

BufferQueueProducer::allocateBuffers used to keep the BufferQueueCore
mutex while doing the buffer allocation, which would cause the consumer
(which also needs the mutex) to block if the allocation takes a long
time.
Instead, release the mutex while doing the allocation, and grab it again
before filling the slots. Keep a bool state and a condvar to prevent
other producers from trying to allocate the slots while the mutex is
released.

Bug: 11792166

Change-Id: I4ab1319995ef892be2beba892f1fdbf50ce0416d
(cherry picked from commit ea96044470a29133321c681080870b9d31f81a19)
ufferQueueCore.h
5c3d243fcca6d0678bcbb0461bbbe0b63f35212c 12-Jul-2014 Eric Penner <epenner@google.com> GLProducer: Reference count images rather than buffers.

In most cases, EGLImages can be created one-to-one with graphic
buffers in slots, but that was difficult due to some special
cases:
- ReleaseTexImage binds a custom 'unslotted' debug image.
- When all slots are freed, we still need to hang on to one.

These cases were handled by keeping an additional reference to
the 'current' buffer (mCurrentTextureBuf), but we would create
new images since we can't reference count them in the same way.
This patch uses the same semantics, except that it reference
counts the image (an EglImage wrapper class) rather than just
buffer. The wrapper class also detects the cases when we need
a new EGLImage, and only creates them in those rare cases.

Change-Id: I2915761dbe49d2a9bda1f59e60f857543634636b
LConsumer.h
1681d95989271f3a9ac0dbb93d10e4a29f2b4444 28-Jun-2014 Ruben Brunk <rubenbrunk@google.com> Add sticky transform to surfaceflinger.

Bug: 15116722

- Adds a sticky transform field that can be set from a
SurfaceFlinger client Surface. This transform is
added to any transform applied to the Surface.

Change-Id: Idaa4311dfd027b2d2b8ea5e2c6cba2da5779d753
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
dc56bf721a9f29621fd57e1d861142fa9b2d3663 30-Jun-2014 Dan Stoza <stoza@google.com> Merge "BufferQueue: Add allocateBuffers method"
ab57491de3a89a2d454d3060d36adef71741a7ae 25-Jun-2014 Dan Stoza <stoza@google.com> GLConsumer: Allow creation in detached mode

Adds a constructor that doesn't require a GLES texture name and sets
up the GLConsumer in detached mode.

Bug: 15616428
Change-Id: Idc9ea2e59baa24bbd959da9fffe0fb71c0aa9818
LConsumer.h
e49ba8e2ed8e17156eb00c8fc8e2285df62bc018 24-Jun-2014 Dan Stoza <stoza@google.com> GLConsumer: Stop using default constructor params

Removes the dependency on default constructor parameters for
GLConsumer so that a different constructor prototype can safely be
added.

Change-Id: I0da924bbd4c141edbf305598c1be8bc575654680
LConsumer.h
29a3e90879fd96404c971e7187cd0e05927bbce0 20-Jun-2014 Dan Stoza <stoza@google.com> BufferQueue: Add allocateBuffers method

This adds an allocateBuffers method to BufferQueue, which instructs
it to allocate up to the maximum number of buffers allowed by the
current configuration. The goal is that this method can be called
ahead of render time, which will prevent dequeueBuffers from blocking
in allocation and inducing jank.

This interface is also plumbed up to the native Surface (and, in
another change, up to the Java Surface and ThreadedRenderer).

Bug: 11792166
Change-Id: I4aa96b4351ea1c95ed5db228ca3ef98303229c74
ufferQueueProducer.h
GraphicBufferProducer.h
urface.h
adb65d9add2b7350b563d4583c5efbe3f0f0aca1 13-Jun-2014 Aravind Akella <aakella@google.com> Merge "Surface reportingMode for Sensors."
0e025c5af365e45e02cb75c1d46b46c7f4cd44cb 04-Jun-2014 Aravind Akella <aakella@google.com> Surface reportingMode for Sensors.

Change-Id: Iac8dd3408c90eb7d285a2e8043131fab3a7e58fa
ensor.h
2c9b11f0291210c9b9513a1a0cce6afebd361b3b 25-May-2014 Prashant Malani <pmalani@google.com> surfaceflinger: Replace blank/unblank with setPowerMode

We replace the blank/unblank calls in surfaceFlinger with a more generic
setPowerMode() routine.

Some displays support different power modes (for example, with reduced
color palettes). Depending on the use case we should be able to toggle
these modes, so as to achieve incremental power savings.

Initially, three power modes will be supported:
- HWC_POWER_MODE_OFF
- HWC_POWER_MODE_DOZE
- HWC_POWER_MODE_NORMAL

HWC_POWER_MODE_OFF will correspond to blanking the display, while
HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE
will put the display into a low power setting, if it is supported in
hardware.

If such a low power mode is not supported, it should be treated as a
call to set the mode to HWC_POWER_MODE_NORMAL.

As a consequence of adding the mPowerMode field, the mScreenAcquired is
no longer required, and thus references to it are removed and replaced
equivalent references to mPowerMode.

We also add the glue code to connect the services invocation of setting
a power mode and the HAL implementation in HWComposer.

Bug: 13472578
Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204
Signed-off-by: Prashant Malani <pmalani@google.com>
SurfaceComposer.h
urfaceComposerClient.h
3d5c8a98c1822e5f32f0b7e82a40f14f41769878 28-May-2014 Dan Stoza <stoza@google.com> Merge "SurfaceFlinger: Add sourceCrop to screenshot"
d9441e4c27bb7d0b1dfe2a8b5c1ee1714442648d 14-May-2014 Aravind Akella <aakella@google.com> Surface maxDelay and isWakeUpSensor flag in Sensor.java.

Change-Id: Idd1e9045190beeca87b086b272e8cbf0bed05bae
ensor.h
c18790018be5d7ea7061ccbc81f3044e74adc823 23-May-2014 Dan Stoza <stoza@google.com> SurfaceFlinger: Add sourceCrop to screenshot

Adds a sourceCrop Rect parameter to screenshot commands, which allows
clients to capture only a portion of the screen instead of the whole
screen.

Bug: 15137922
Change-Id: I629447573cd34ffb96334cde7ba02490b9ea06d8
SurfaceComposer.h
urfaceComposerClient.h
7f7da32569f8e0b3d383a40b95f8ac1d55afd801 03-May-2014 Dan Stoza <stoza@google.com> Enable changing display configuration

This allows querying and switching display device configurations
through the ISurfaceComposer/SurfaceComposerClient interface.

Bug: 14320401
Change-Id: I8c22165698950e5da32204c1c4da92122f91a715
SurfaceComposer.h
urfaceComposerClient.h
943de2f71beff9566cc58ce5820495fd9776e1e3 24-Apr-2014 Aravind Akella <aakella@google.com> Merge "Enable wakeup sensors."
9a844cf78f09953145200b4074d47589257a408c 12-Feb-2014 Aravind Akella <aakella@google.com> Enable wakeup sensors.

SensorService should hold a wakelock till the app reads events from a wakeup sensor. Currently drivers hold a wakelock with a
timeout while delivering events from a wake up sensor like Significant Motion. This hack can be removed now.

Bug: 9774884
Change-Id: If3b5acb99c9cf0cd29012fcfa9d6b04c74133d01
SensorEventConnection.h
ensor.h
ensorEventQueue.h
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
ufferQueue.h
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
ufferQueue.h
ufferQueueConsumer.h
ufferQueueDefs.h
GraphicBufferConsumer.h
99b18b447dec188bcec37b415603b9dd400fc7e1 28-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Add StreamSplitter

Adds a StreamSplitter class, that takes one IGraphicBufferConsumer
interface and multiple IGraphicBufferProducer interfaces and
implements a one-to-many broadcast of GraphicBuffers (while managing
fences correctly).

Change-Id: I38ecdf3e311ac521bc781c30dde0cc382a4376a3
GraphicBufferConsumer.h
treamSplitter.h
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
ufferQueue.h
ufferQueueProducer.h
GraphicBufferProducer.h
93b84e39e6cbb9f2ba37125465c4040e03b56048 11-Apr-2014 Aravind Akella <aakella@google.com> am ef89f763: am cf818ebb: Merge "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors" into klp-modular-dev

* commit 'ef89f7638c43ce5f73e32d487bf65c3375995e3b':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
ef89f7638c43ce5f73e32d487bf65c3375995e3b 11-Apr-2014 Aravind Akella <aakella@google.com> am cf818ebb: Merge "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors" into klp-modular-dev

* commit 'cf818ebbf07c6a20ef48d71bf82f8d4bdf3a398c':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
fd34b65f717b84fa06d8c37f41b070f41d0ad3a3 11-Apr-2014 Dan Stoza <stoza@google.com> Merge "BufferQueue: Add producer buffer-released callback"
700180487ffec09d9df1657b018a7caadac24b75 08-Apr-2014 Aravind Akella <aakella@google.com> Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

This reverts commit 4369a4ebd5ae7567e7075bc82830b83178099ed5.

Change-Id: Ifa8619cc6873470a07a987763d818d78d4232610
ensor.h
cf8684b2063c0458da634be0fae7ccabf3f50176 10-Apr-2014 Svetoslav <svetoslavganov@google.com> Merge "Adding render stats APIs to UiAutomation (framework native)."
d85084b2b65828442eafaff9b811e9b6c9ca9fad 20-Mar-2014 Svetoslav <svetoslavganov@google.com> Adding render stats APIs to UiAutomation (framework native).

bug:12927198

Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
SurfaceComposer.h
SurfaceComposerClient.h
urfaceComposerClient.h
urfaceControl.h
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
ufferQueue.h
75b332037f6197acb239bfbbf2ac09adb31e9971 05-Apr-2014 Etienne Le Grand <etn@google.com> am 4369a4eb: Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"

* commit '4369a4ebd5ae7567e7075bc82830b83178099ed5':
Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"
30d6fd6b28aeacfe06ddc7adaac34e8a0032df40 05-Apr-2014 Etienne Le Grand <etn@google.com> Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"

This reverts commit c57a019e117117c5a76c772970b26cd0f5db8c6a.

Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2
(cherry picked from commit 4369a4ebd5ae7567e7075bc82830b83178099ed5)
ensor.h
4369a4ebd5ae7567e7075bc82830b83178099ed5 05-Apr-2014 Etienne Le Grand <etn@google.com> Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"

This reverts commit c57a019e117117c5a76c772970b26cd0f5db8c6a.

Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2
ensor.h
33458f72e17be8e71f50e1f8843f7821d90934f5 05-Apr-2014 Etienne Le Grand <etn@google.com> am 00f4dde1: am c57a019e: Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

* commit '00f4dde1aa88576811bca79bc8242e1fc1edb333':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
00f4dde1aa88576811bca79bc8242e1fc1edb333 05-Apr-2014 Etienne Le Grand <etn@google.com> am c57a019e: Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

* commit 'c57a019e117117c5a76c772970b26cd0f5db8c6a':
Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
c57a019e117117c5a76c772970b26cd0f5db8c6a 25-Mar-2014 Etienne Le Grand <etn@google.com> Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors

Change-Id: If0f3dbdb5d2e9378e1fed4614baee4e750d0c850
ensor.h
786e26a886a3ade95f07178ba9c1538b79d7a31a 04-Apr-2014 Greg Hackmann <ghackmann@google.com> am 3b1cb037: am 27f8840f: Merge "make struct Event layout consistent on 32/64-bit"

* commit '3b1cb037eea56dba0d134c6858f8ddc0f9743ff8':
make struct Event layout consistent on 32/64-bit
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
ufferQueue.h
ufferQueueCore.h
ufferQueueProducer.h
GraphicBufferProducer.h
ProducerListener.h
0c7c81f5a62937f79b7e734668aa997fd8df1927 20-Mar-2014 Fengwei Yin <fengwei.yin@intel.com> make struct Event layout consistent on 32/64-bit

To make struct Event have consistent memory layout between x86
and x86_64, force nsecs_t timestamp align to 64bit because it's
not true for x86.

Change-Id: I49eaddd89e10d595cf6a5130f9762b5388c96625
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
isplayEventReceiver.h
75555b2eaf0a2b8eff30df422e041cbe80ec74ef 18-Mar-2014 Dan Stoza <stoza@google.com> Merge "BufferItemConsumer: Use IGBC instead of BQ"
14226716f2a675eee6730a405db28c674a771395 18-Mar-2014 Dan Stoza <stoza@google.com> Merge "Remove deprecated BufferQueue constructor"
8bf3b1a4964188d4ad0b96cd12174f2ba5c1eddd 18-Mar-2014 Wonsik Kim <wonsik@google.com> Merge "Revert "Implement video plane layer""
29fa9590ad32d918cb32cc88898ec53d28e1ad5a 17-Mar-2014 Wonsik Kim <wonsik@google.com> Revert "Implement video plane layer"

This reverts commit f837c93a1b392dbc4f7099d0c4fb723e32ca438e.

Change-Id: I6a1aa9ad0aca023267dc53d19c950b1535123ca7
SurfaceComposerClient.h
73ed82f809a40560fd3a6d53d18e5c846362d764 13-Mar-2014 Jesse Hall <jessehall@google.com> Merge "Add sideband streams to BufferQueue and related classes"
6d5a7bb970dd5cfd5a51fe2de7f10b9fc75732b2 13-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: I52f58a4d22296d9fc3cdbd4ad53eb10a785db3ce
urfaceComposerClient.h
fe50d2a0a13116238d5321e16c06e6ed533618dc 12-Mar-2014 Dan Stoza <stoza@google.com> BufferItemConsumer: Use IGBC instead of BQ

Change-Id: Id1756ac62954ba412f2c23c5fa6e5d760c299347
ufferItemConsumer.h
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
ufferQueue.h
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
ufferQueue.h
ufferQueueConsumer.h
ufferQueueCore.h
ufferQueueProducer.h
onsumerBase.h
ConsumerListener.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
urface.h
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
ufferQueue.h
ufferQueueConsumer.h
ufferQueueProducer.h
ufferSlot.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
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
ufferQueue.h
ufferQueueConsumer.h
ufferQueueCore.h
ufferQueueDefs.h
ufferQueueProducer.h
289ade165e60b5f71734d30e535f16eb1f4313ad 28-Feb-2014 Dan Stoza <stoza@google.com> Split BufferQueue into core + producer + consumer

Change-Id: Idc39f1e511d68ce4f02202d35425a419bc0bcd92
ufferItem.h
ufferQueueConsumer.h
ufferQueueCore.h
ufferQueueProducer.h
ufferSlot.h
f837c93a1b392dbc4f7099d0c4fb723e32ca438e 24-Feb-2014 Wonsik Kim <wonsik@google.com> Implement video plane layer

Binding with video source will follow.

Change-Id: Ic14e9757f5b61f4055cbeda47c1bafae0a621abb
SurfaceComposerClient.h
c701401f8cec2e5309f8b57e2b97baced5093274 15-Feb-2014 Dan Stoza <stoza@google.com> Allow disabling layer rotation during screenshots

Add the ability to ignore layers' transformation matrices during
screenshot capture, which will allow the window manager to capture
unrotated images for recents during the device rotation animation.

Bug: 11805195
Change-Id: I854d87bc84ca06ef9a054a454af1c080ee66fbb8
SurfaceComposer.h
urfaceComposerClient.h
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
ufferQueue.h
GraphicBufferProducer.h
4be18a3566c5d902b7fe94db4cf14b174ed7beb5 18-Nov-2013 Igor Murashkin <iam@google.com> gui: Remove BufferQueue::MIN_UNDEQUEUED_BUFFERS

Change-Id: I7c0cc36046dbbdb9c0e85acfe5027293d1131275
ufferItemConsumer.h
ufferQueue.h
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
ufferQueue.h
GraphicBufferConsumer.h
GraphicBufferProducer.h
701166d9f60a6e1149ff568aec0e03f3f3925292 08-Oct-2013 Aravind Akella <aakella@google.com> Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection.

Change-Id: I4ef2bec80406c517903ab9782dc9eaf3fa8b7f36
SensorEventConnection.h
ensorEventQueue.h
dbe9245e2e362b12e184cd33b9a27b0901f81244 24-Sep-2013 Jamie Gennis <jgennis@google.com> GLConsumer: start using EGL_ANDROID_image_crop

This change makes GLConsumer use the EGL_ANDROID_image_crop extension when
available on a device. The crop rectangle is passed to the EGL driver when
creating EGLImages, allowing the crop to be performed by the driver rather than
using the texture transform matrix.

Bug: 10897141
Change-Id: I63e9a5d5c85067376abc420e3639154468346311
LConsumer.h
d171da973de3c6b30263011334fdcd916739144f 19-Sep-2013 Eino-Ville Talvala <etalvala@google.com> GLConsumer: Add query for current frame number.

Surface the underlying frame number of the current texture.

Bug: 10830400
Change-Id: Ide3a7da12ea0aac54588beb6bf00dbfe2cd37653
LConsumer.h
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
GraphicBufferConsumer.h
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
ufferQueue.h
GraphicBufferProducer.h
90ed3e8d7883d9c80fb8bf11b1c593bd8b2b39d0 10-Sep-2013 Mathias Agopian <mathias@google.com> fix a few problems with BitTube

BitTube used to send objects one at a time and didn't
handle errors properly.

We now send all the objects in one call, which means they
have to be read as a single batch as well. This changes the
BitTube API.

Update SensorService to the new API.

Also added an API to set the size of the send buffer.

Bug: 10641596
Change-Id: I77c70d35e351fdba0416fae4b7ca3b1d56272251
itTube.h
ensorEventQueue.h
724d91d778e71c8186399f4955de14b54812b3ed 27-Jun-2013 Aravind Akella <aakella@google.com> Sensor batching. Changes to the native code.

Bug: 10109508
Change-Id: I7333f3aac76125a8226a4c99c901fb904588df04
SensorEventConnection.h
ensor.h
ensorEventQueue.h
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
GraphicBufferConsumer.h
GraphicBufferProducer.h
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
puConsumer.h
3f84483382be2d528918cc1a6fbc6a7d68e0b181 08-Aug-2013 Mathias Agopian <mathias@google.com> SurfaceFlinger now uses GLES 2.x when available

Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
LConsumer.h
urface.h
45155969dc747d09d267cd1f22baf0eaf886a801 09-Aug-2013 Mathias Agopian <mathias@google.com> make sure GLConsumer::releaseTexImage() works after detachFromContext()

Change-Id: I27e0bc57e927d47b2b98113ee37b5396bcc72019
LConsumer.h
9870c9b66cc73ee31aabba23aa06deaf673ee5ef 09-Aug-2013 Mathias Agopian <mathias@google.com> make GLConsumer's debug texture static

this is so that we don't burn a gralloc handle and a bit
of memory per GLConsumer.

Change-Id: I30c3e7ec45d7f1b5426aca8e06c7716870877706
LConsumer.h
6c913be9ca95fd6b556d056e165a4ba6dc69795b 08-Aug-2013 Jesse Hall <jessehall@google.com> Add ISurfaceComposer::destroyDisplay

Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
SurfaceComposer.h
urfaceComposerClient.h
3ca76f416bc8665a97636ca8a2d0128b9da9d92c 07-Aug-2013 Mathias Agopian <mathias@google.com> remove support for glReadPixels screenshot path

this was only needed on some chipset we're not
supporting in KLP.

Change-Id: I2e8fc07f135030bd61d2e241a8e426f1a4316425
SurfaceComposer.h
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
ufferItemConsumer.h
ufferQueue.h
onsumerBase.h
puConsumer.h
LConsumer.h
GraphicBufferConsumer.h
urfaceComposerClient.h
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
ufferQueue.h
onsumerBase.h
ConsumerListener.h
GraphicBufferConsumer.h
e142428a9c8b9d2380032cd4d7b55ee440fe8770 30-Jul-2013 Mathias Agopian <mathias@google.com> Make Flattenable not virtual

Fallout from the Flattenable change, update all its uses.

Additionnaly, fix/tighten size checks when (un)flatten()ing
things.

Removed the assumption by some flattenables (e.g.: Fence)
that the size passed to them would be exact (it can
and will be larger in some cases)

The code in Parcel is a bit complicated so that we don't
have to expose the full implementation (and also to
keep the code smallish).

Change-Id: I0bf1c8aca2a3128491b4f45510bc46667e566dde
GraphicBufferProducer.h
ensor.h
ad678e18b66f495efa78dc3b9ab99b579945c9e2 24-Jul-2013 Mathias Agopian <mathias@google.com> single buffer mode for BufferQueue

Bug: 9891035
Change-Id: Id1ab5f911a6dc4c1d8235e65775b3d3635231ad4
ufferQueue.h
LConsumer.h
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
ufferQueue.h
GraphicBufferProducer.h
urface.h
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
ufferQueue.h
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
ufferItemConsumer.h
ufferQueue.h
onsumerBase.h
puConsumer.h
ummyConsumer.h
LConsumer.h
GraphicBufferProducer.h
urface.h
8f938a53385a3c6d1c6aa24b3f38437bb2cc47ae 13-Jul-2013 Mathias Agopian <mathias@google.com> always pass the BufferQueue explicitely to consumers

Change-Id: I883b0a7b19d8e722f9ab714ba6f49e658b02ca86
ufferItemConsumer.h
puConsumer.h
LConsumer.h
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
ufferItemConsumer.h
ufferQueue.h
onsumerBase.h
LConsumer.h
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
puConsumer.h
ae772278fe52335b730442f3d86307787dea807e 03-Jun-2013 Zhijun He <zhijunhe@google.com> CpuConsumer: Remove CpuConsumer JNI ID.

Not used anywhere, and it is pretty confusing to have it here.

Bug: 9254294
Change-Id: I12b761532918b546a0f56c74ccf81b2c119ccd66
puConsumer.h
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
ufferQueue.h
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
ufferQueue.h
onsumerBase.h
LConsumer.h
d487ca1ab331e60956c7819265723676b25b7fba 09-May-2013 Eino-Ville Talvala <etalvala@google.com> am 87ab83d9: am f743e3db: Merge "Add support for HAL_PIXEL_FORMAT_YCbCr_420_888" into jb-mr2-dev

* commit '87ab83d96b9d826e94a7169a6205bcf9c2ee633a':
Add support for HAL_PIXEL_FORMAT_YCbCr_420_888
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
puConsumer.h
bdcf1fe2ba4f6fe2eb63a5ec8246b1582b638e04 24-Apr-2013 Mathias Agopian <mathias@google.com> Merge changes I0d9f18d1,Ib96c9161

* changes:
Add a --color option to dumpsys SurfaceFlinger
clean-up/simplify all dump() APIs
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
ufferQueue.h
onsumerBase.h
LConsumer.h
e692ab9a6be63193c5b52a6562d85d06c40463b8 22-Apr-2013 Mathias Agopian <mathias@google.com> fix uninitialized variables in GLConsumer

mDefaultWidth, mDefaultHeight and mCurrentScallingMode are now
initialized to the same default value that BufferQueue uses.

Change-Id: I0d4da2022b06419d12745716d8ddbd48c8869953
LConsumer.h
187edf93c6245bb8fb3187c49f2174492ed6e049 17-Apr-2013 Igor Murashkin <iam@google.com> Merge "BufferItemConsumer: add functions to set default buffer format/size" into jb-mr2-dev
87d1e3427b536b5cb1123ddc357539cb4075687a 16-Apr-2013 Igor Murashkin <iam@google.com> BufferItemConsumer: add functions to set default buffer format/size

Bug: 8629088
Change-Id: I06f2e26a70d6dbcfcd70b08b4461e8e401f6e83f
ufferItemConsumer.h
53dc9044bfe17039592faf4660c5bf715e8120ad 11-Apr-2013 Andy McFadden <fadden@android.com> Merge "Updated comments" into jb-mr2-dev
ad669b04f4633957eea55b8ad2d8253adcefe39b 06-Apr-2013 Jamie Gennis <jgennis@google.com> libgui: fix an EGLImage leak

This moves the call to ConsumerBase::abandon from the ConsumerBase dtor to
ConsumerBase::onLastStrongRef. The abandon call relies on virtual methods to
perform the clean-up, so calling it from the ConsumerBase dtor after the
derived classes dtors ran was skipping some of the clean-up. The
onLastStrongRef method should get called just before the most derived class's
dtor gets called.

Bug: 8349135
Change-Id: I836946826927cc1ed69c049049f525f92b17a269
onsumerBase.h
753e3415cdaa99f9453d1ea71b163bf1b148e127 05-Apr-2013 Andy McFadden <fadden@android.com> Updated comments

Updated many comments. Added one minor error check.

Change-Id: Ib935dd99d417bada91d2e198008a50dd94269316
ufferQueue.h
ca08833d5ea99130797e10ad68a651b50e99da74 29-Mar-2013 Mathias Agopian <mathias@google.com> don't use compile-time configuration of libgui as much as possible

We now detect at runtime which sync features to use, which
allows us to remove a lot of the compile-time configuration
options. There is still one option though, to disable
KHR_fence_sync on some devices (which are more efficient
without it).

- added a backdoor to get the vendor's EGL strings

the new logic is:
- use always ANDROID_native_fence_sync if available
- fallback to KHR_fence_sync if available and not disabled
by the compile-time option
- use KHR_wait_sync if available and either of the above is
enabled

Change-Id: I9c4b49d9ff1151faf902cc93bd53ea5f205aaabf
LConsumer.h
8000d0694bc34bc17d869da546d8ff8790ae7be4 27-Mar-2013 Mathias Agopian <mathias@google.com> make sure to unlock the screenshot's buffer on destruction

this fixes a memory leak on various devices

Bug: 8475134
Change-Id: I25924674c803a0cb22371a95c60664c36acb0340
urfaceComposerClient.h
13f01cbdbd34779a234bc674df79e23672fd5c0b 20-Mar-2013 Jesse Hall <jessehall@google.com> Pass sp<Fence>s around instead of file descriptors

Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
LConsumer.h
aaebffd52f1bfa3d239bba0d60b699c01c6d791c 21-Mar-2013 Eino-Ville Talvala <etalvala@google.com> Merge "CpuConsumer: Properly track acquired buffers" into jb-mr2-dev
ac006439bb635cd99d8dcbefe95fa680e21519b5 21-Mar-2013 Ramanan Rajeswaran <ramanan@google.com> Merge "Revert "Revert "Change SurfaceControl setPosition to take floats""" into jb-mr2-dev
d6480c020b050c777ec1db2dd9c16fccfc47b47b 21-Mar-2013 Ramanan Rajeswaran <ramanan@google.com> Revert "Revert "Change SurfaceControl setPosition to take floats""

This reverts commit bbb57f3331c7182399ed82e9c4f93a965677dde3

Change-Id: Ib8f039f530d6b8175b5205c6c0008b135d4001a2
urfaceControl.h
abe815dd6978b718c04f6e22e1a893d2b51d11a1 20-Mar-2013 Mathias Agopian <mathias@google.com> rework how we take screenshots for a CPU consumer

We're not using IMemoryHeap as a transport anymore,
instead we're providing a CpuConsumer and use the
IGraphicBufferProducer version of the screenshot API.

However, some GPU drivers don't support properly
a GPU to CPU path, to work around this, we use a
temporary BufferQueue on the server side for the
GL rendering, and we use glReadPixels into the
CpuConsumer (we're now using a CPU to CPU path
which is always supported).

Currently this "wrapping" is always performed,
but it can be bypassed on devices that support
the GPU to CPU path.

This also addresses a DoS attack vector on
SurfaceFlinger, where an application could
consume all of SF's filedescriptors by creating
a lot of screenshots in a row.

Bug: 8390553

Change-Id: I9e81514c2a7711b9bb393f74305be7d2abe08f1c
SurfaceComposer.h
urfaceComposerClient.h
fae23b8757a6e1b70997db28a2eaf34f9ddc9b84 19-Mar-2013 Jesse Hall <jessehall@google.com> Merge changes I61ae54f3,I57cb668e,I7a3f1e1a,Id28a2f9b into jb-mr2-dev

* changes:
Add BufferQueueInterposer and use it for virtual displays
Add DisplaySurface abstraction
Fix argument types in IGraphicBufferProducer methods
Minor cleanups/fixes before virtual display refactoring
4c00cc11141da7d159eb2323b186ed344115c0f1 16-Mar-2013 Jesse Hall <jessehall@google.com> Fix argument types in IGraphicBufferProducer methods

Bug: 8384764
Change-Id: I7a3f1e1a0584a70af04f9eafef900505389d2202
ufferQueue.h
GraphicBufferProducer.h
7adb0f8a9fdb961692ffd2f0c65cacb155143f64 07-Mar-2013 Jesse Hall <jessehall@google.com> Minor cleanups/fixes before virtual display refactoring

None of these should change behavior, except for removing some
incorrect log messages when using a virtual display.

- HWComposer::getAndResetReleaseFenceFd() checks the HWC version, so
no need to do that in the DisplayDevice::onSwapBuffersCompleted().
However, it should check that mFramebufferSurface is not NULL like
it is for virtual displays.
- Comment that FramebufferSurface::dump() overrides the non-virtual
ConsumerBase::dump(), and fix it so the right thing happens
regardless of the static type of the pointer/reference the callee
has. FramebufferSurface::dump() could be removed right now, but I'd
need to bring it back in a later change.
- Use the right enum for validating display type ids.
- Don't try to send hotplug events for virtual displays.
- Mark virtual displays as connected so HWComposer::prepare() doesn't
think something is wrong when it gets a non-NULL layer list.
- Remove unused FramebufferSurface methods.

Bug: 8384764
Change-Id: Id28a2f9be86b45f4bb7915fdf7752157035f4294
onsumerBase.h
041a075262ef5fc886e46fd4eec3dd79ee2e60c0 16-Mar-2013 Mathias Agopian <mathias@google.com> don't allow screenshots without the READ_FRAMEBUFFER permission

the recent screenshot rework allowed the older screenshot
interface to work without that permission

Change-Id: I6c4743f4591c81106e3b823d55a055f7b4907de1
SurfaceComposer.h
35ffa6a868f1aa650c90956a4129bb70f780fc99 13-Mar-2013 Mathias Agopian <mathias@google.com> Surface can now be created only from an IGraphicBufferProducer

it can't write itself to a parcel, nor can it be created from a
parcel.

Change-Id: I69165d5c54d6024b3e546e80d8b57e3dedda7893
urface.h
4d9b822e2c18142e55fe2611aa6cd7dc7d4a62c6 13-Mar-2013 Mathias Agopian <mathias@google.com> get rid of ISurface

ISurface was only used to get the IGraphicBufferProducer from
a Layer. It's now replaced by a BBinder subclass / IBinder and
is only used as a handle to the surface, to both refer to it
and manage its life-time.

Also cleaned-up a bit the ISurfaceComposer interface and
"create layer" code path.

Change-Id: I68d0e02d57b862cffb31d5168c3bc10cea0906eb
Surface.h
SurfaceComposerClient.h
urfaceControl.h
089a15298e045598bf15fd2a46284c34dd56384c 05-Mar-2013 Mathias Agopian <mathias@google.com> Remove support for ScreenshotLayer

Change-Id: I5b571a4cf3faa77d2c4aca916fa4bd00a1065bb9
SurfaceComposerClient.h
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
puConsumer.h
306f18c5fb15ac05db09ece7241af02b9713a23d 05-Mar-2013 Mathias Agopian <mathias@google.com> Merge "rework screenshot API and implementation" into jb-mr2-dev
2a9fc493dfdba67108e4335bb1fe931bc1e2a025 01-Mar-2013 Mathias Agopian <mathias@google.com> rework screenshot API and implementation

- SurfaceFlinger now supports to take a screenshot
directly into an IGraphicBufferProducer

- reimplement the IMemoryHeap screenshot on top
of the above

- reimplement LayerScreenshot such that its
BufferQueue is directly used as the destination
of the screenshot. LayerScreenshot is now a thin
wrapper around Layer

Bug: 6940974

Change-Id: I69a2096b44b91acbb99eba16f83a9c78d94e0d10
SurfaceComposer.h
urfaceComposerClient.h
bbb57f3331c7182399ed82e9c4f93a965677dde3 01-Mar-2013 Dave Burke <daveburke@google.com> Revert "Change SurfaceControl setPosition to take floats"

Temporary, to fix weekend build, until we get Nvidia code drop.

This reverts commit 9a867a8798fa6ea21f6341db31e38ea64fde6c83

DO NOT MERGE

Change-Id: I7b5dbc4db46ef3d97dc8598057d5487d6971178b
urfaceControl.h
eb0d12963d271052c24abb025d698504df9e7573 28-Feb-2013 Eino-Ville Talvala <etalvala@google.com> CpuConsumer: Add optional asynchronous mode

Bug: 8290146
Bug: 8291751

Change-Id: I9c8ac4bff38b0411e987a204e540d018dba6d0b4
puConsumer.h
64d8b1903e4b5f2838818eedcf4fef748b38709c 28-Feb-2013 Eino-Ville Talvala <etalvala@google.com> CpuConsumer: Don't unlock buffers on producer disconnect

Bug: 8291751

Change-Id: I062a3d34b41183d07fb6b9109cdb6bf0c0c75672
puConsumer.h
9a867a8798fa6ea21f6341db31e38ea64fde6c83 22-Feb-2013 Michael Wright <michaelwr@google.com> Change SurfaceControl setPosition to take floats

Bug: 8153162
Change-Id: If3c4b7a3e124ace25999eb9a569dc9a806a1fbc2
urfaceControl.h
cf0b8c85fb0106751256dba7821f86b5ad03126c 20-Feb-2013 Mathias Agopian <mathias@google.com> get rid of Surface::getISurfaceTexture()

this was there just for legacy reasons.

Change-Id: I0a48d6e04d7efa65033f9f10c91bba557f16ae8b
urface.h
c4905eb49d20667381f3cda7c6f6894234404bd3 16-Feb-2013 Mathias Agopian <mathias@google.com> fix build: SurfaceTextureClient to Surface rename

Change-Id: I0041e6f49bc637bc52161c83f0bd44101246f480
urface.h
f25c5086cf46eb029d887f34f25a09220e44958c 15-Feb-2013 Mathias Agopian <mathias@google.com> fix build: SurfaceTextureClient to Surface rename

Change-Id: I54d68241f1080eef640aefe71f33912ad79345ef
urface.h
e3c697fb929c856b59fa56a8e05a2a7eba187c3d 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
GraphicBufferProducer.h
urface.h
urfaceComposerClient.h
urfaceControl.h
urfaceTextureClient.h
6d9b9dfd555ee2bc1dd8381dde95d45f9500b3ca 14-Feb-2013 Mathias Agopian <mathias@google.com> remove access ANDROID_VIEW_SURFACE_JNI_ID

Change-Id: I0ef474ed9be2cd26fa520ef871ffcf21a25e4994
urface.h
urfaceComposerClient.h
ac9fa427d4a86745e60a5f7fd8e3ea340c4db907 12-Feb-2013 Mathias Agopian <mathias@google.com> get rid of Surface identity and token

we use the IBinder instead.

Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
Surface.h
SurfaceComposerClient.h
urface.h
urfaceComposerClient.h
882e3a39ed770b335a203e233b57127fde1c839e 09-Jan-2013 Andy McFadden <fadden@android.com> Add some comments.

Also, minor tweak to SurfaceTextureLayer.

Change-Id: If616d5ee4e8226dd0e16c5dbb0e0f80db553110e
SurfaceComposer.h
urface.h
urfaceTextureClient.h
466a192d2088f9238d34597d1aa28da41367c1ca 08-Jan-2013 Andy McFadden <fadden@android.com> Minor tweaks.

Change-Id: I9f82f574112141b6aa074c42303056cd52d5c478
GraphicBufferProducer.h
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
ufferItemConsumer.h
ufferQueue.h
onsumerBase.h
puConsumer.h
ummyConsumer.h
LConsumer.h
GraphicBufferProducer.h
Surface.h
SurfaceComposer.h
SurfaceTexture.h
urface.h
urfaceComposerClient.h
urfaceTexture.h
urfaceTextureClient.h
0273adbf0bc202eda2ca579ae0773464ea9c701f 13-Dec-2012 Andy McFadden <fadden@android.com> Added some comments

Added a quick intro section at the top of the class. Also noted
the proposed new name for the class.

Change-Id: I3f79663527544aa4e910db0e5a1374b54d16ba2f
SurfaceTexture.h
urface.h
urfaceTexture.h
urfaceTextureClient.h
3c1ada982202d97ecd0a9a542b5373e2d78658fb 12-Dec-2012 Jamie Gennis <jgennis@google.com> Merge "SurfaceTextureClient: remove a deprecated ctor"
4def8600305bc2b7f947c9fc0811095b7c17c8e2 12-Dec-2012 Jamie Gennis <jgennis@google.com> SurfaceTextureClient: remove a deprecated ctor

Change-Id: Ibf2746fdca26851677cd90199c60eab80f6d0c73
urfaceTextureClient.h
c6f04666c205a72add3c856455bf212f0c84d6fc 12-Dec-2012 Jamie Gennis <jgennis@google.com> Merge "SurfaceFlinger: Move GraphicBufferAlloc to libgui"
392edd88cb63d71a21a86a02cf9c56ac97637128 30-Nov-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Move GraphicBufferAlloc to libgui

This change moves the GraphicBufferAlloc class from SurfaceFlinger to libgui.

Change-Id: Idf31d2004efa2651b60590733f73c4a7b831e8a9
raphicBufferAlloc.h
97eba8904c2f221c42a9473407223a4c3a213f75 12-Dec-2012 Andy McFadden <fadden@android.com> Avoid unnecessary texture bind

In SurfaceFlingerConsumer, check to see if native fence sync is
enabled. If so, defer the texture binding step to Layer::onDraw.

Change-Id: I7d4034a31c0143207eea2509dfa13ef3820f9b8c
urfaceTexture.h
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
ufferQueue.h
urfaceTexture.h
a4a3149a36bc69a06e4824aeae909ab910661070 29-Oct-2012 Igor Murashkin <iam@google.com> Change ConsumerBase's FrameAvailableListener to be a weak pointer

This prevents strong reference cycles when the listener implementation also
holds a strong pointer to the ConsumerBase

Bug: 7425644
Change-Id: I1514b13a32b18d421c902dddebec0765a989c55c
onsumerBase.h
urfaceTexture.h
dd3cb84cfbe8068790c6233b5829fae9c4a0ee93 20-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add support for secure displays

This change adds support for displays that are not allowed to display surfaces
with the eSecure flag set. All non-virtual displays are considered secure,
while virtual displays have their secure-ness specified at creation time.

Bug: 7368436
Change-Id: I81ad535d2d1e5a7ff78269017e85b111f0098500
SurfaceComposer.h
urfaceComposerClient.h
2d5e230292c27d59f4c096bc742a0a19abf811c1 16-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add animation transactions

This change adds a transaction flag for WindowManager to indicate that a
transaction is being used to animate windows around the screen. SurfaceFlinger
will not allow more than one of these transactions to be outstanding at a time
to prevent the animation "frames" from being dropped.

Bug: 7353840
Change-Id: I6488a6e0e1ed13d27356d2203c9dc766dc6b1759
SurfaceComposer.h
urfaceComposerClient.h
2a09bb321930e1f782599ec902bca1db58b9af77 09-Oct-2012 Jeff Brown <jeffbrown@google.com> Add blankDisplay/unblankDisplay to SurfaceComposerClient.

Bug: 7309812
Change-Id: Ia401d642094a46c62f0d26c65da1d11341e203a1
urfaceComposerClient.h
9504eb915c9628e130f45019bdefda0168089886 05-Oct-2012 Jesse Hall <jessehall@google.com> Fix race condition in ConsumerBase::addReleaseFence()

This needs the ConsumerBase mutex locked, but wasn't locking it. Two
of the four places that called it already held the lock so were fine.
Now addReleaseFence() takes the lock itself, and I added
addReleaseFenceLocked() for the two already-locked callers, since in
one of them dropping the lock would be inconvenient.

Bug: 7289269
Change-Id: I7a5628adb516f8eec782aa6c14128202f96d7b0a
onsumerBase.h
c01a79d77b829e7de86ef137694e8ad708470ca1 28-Sep-2012 Andy McFadden <fadden@android.com> Pass display arg to blank/unblank

This allows us to blank and unblank displays other than the built-in
display (e.g. HDMI).

Bug: 7240511
Change-Id: I89ea13f9e497be74c3e1231d0c62fb558e93e0f8
SurfaceComposer.h
38b657265ccc5ae45bd7860a68b0d9373b47a2f3 28-Sep-2012 Iliyan Malchev <malchev@google.com> Revert "Compatibility work around for bad graphics driver dependency."

This reverts commit a50b51c03aca449920fc8581a738032a7bce7150

Change-Id: Ibdcd776a7f241dbb2475403ea04f939249774c41
urfaceComposerClient.h
4803b74e2a12a508f7bbfde6f6a962fe3299c61c 25-Sep-2012 Andy McFadden <fadden@android.com> Show build config in dumpsys SurfaceFlinger

This adds a line to the "dumpsys SurfaceFlinger" output that shows
build-time configuration values.

Example:
Build configuration: [sf HAS_CONTEXT_PRIORITY] [libui] \
[libgui USE_FENCE_SYNC]

Bug 7206633

Change-Id: Ibe1856b459d34a4be6ee83a4ebfd2807e6cc68a0
uiConfig.h
e96e9e1093b5700e9f403a6e2479da7dc36d3b71 25-Sep-2012 Mathias Agopian <mathias@google.com> fix a crasher in SurfaceTexture's setFilteringEnabled

bug: 7211067
Change-Id: Id8658a8df429d76c20ab9112858b38e52343dc9c
urfaceTexture.h
ff28e201ec0c6d620eaaa29814ab52958487dc31 21-Sep-2012 Mathias Agopian <mathias@google.com> Display events now always carry the display id they happened on

Change-Id: I12de1d883c23927722bc3a71b782f0079de4e831
isplayEventReceiver.h
148994e5f33ce240ff24ceb5bc0500b7f2001959 20-Sep-2012 Mathias Agopian <mathias@google.com> We now report hotplug events to the framework

Change-Id: I2d6b7787d39e5929485a551e4982498c5053c211
isplayEventReceiver.h
3941cb240d438bfdebe24920bb2ada86456a0bf9 18-Sep-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: default to doing GL sync

This change makes updateTexImage default to performing the necessary
synchronization and adds an argument for SurfaceFlinger to disable that
synchronization so that it can be performed lazily.

Change-Id: I7c20923cc786634126fbf7021c9d2541aa77be5d
Bug: 6991805
urfaceTexture.h
8dfa92fef9759a881e96ee58d59875d35023aab9 18-Sep-2012 Andy McFadden <fadden@android.com> Plumb display name into SurfaceFlinger

The Surface createDisplay() call takes a display name for debugging.
This change carries it through SurfaceFlinger and displays it in
the "dumpsys SurfaceFlinger" output.

Bug 7058158

Change-Id: I79f3474a8656ff1beb7b478e0dbf2c5de666118a
SurfaceComposer.h
urfaceComposerClient.h
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
ufferQueue.h
61e04b92bdeafc6fca89052d14dab1bd0c384a71 10-Sep-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: use eglWaitSync

This change adds a compile-option to use eglWaitSyncANDROID to ensure that
texturing operations that access the current buffer of a SurfaceTexture do not
occur until the buffer is completely written. It also moves this
synchronization into a new SurfaceTexture method called doGLFenceWait and
changes SurfaceFlinger's Layer class to use that method rather than performing
its own wait on the fence.

Change-Id: I70afa88086ca7ff49a80e3cd03d423767db7cb88
urfaceTexture.h
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
onsumerBase.h
urfaceTexture.h
00e8c7a88a5b9c4104a71013a713acd3e4d3b77b 05-Sep-2012 Mathias Agopian <mathias@google.com> display projection API now has a single function instead of 3

Change-Id: I9bf46d372b77d547486d4bbe6f1953ec8c65e98f
urfaceComposerClient.h
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
ufferQueue.h
9e75ddda93888755d0b14144b62e896cd9f78f3a 01-Sep-2012 Jamie Gennis <jgennis@google.com> libgui: add BufferQueue test infrastructure

This change adds some infrastructure for testing the BufferQueue class. It
also includes a test that tests the new check in BufferQueue::acquireBuffer
that prevents the consumer from acquiring more than one buffer beyond the max
acquired buffer count that was set.

Change-Id: I38554ad3f9a53d2ddeba7ef0deee35ec2e2f9775
SurfaceTexture.h
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
ufferQueue.h
1847f7fd799f92300b3786e49f5883eaa03f4507 31-Aug-2012 Jamie Gennis <jgennis@google.com> Merge "BufferQueue: simplify max buffer count handling" into jb-mr1-dev
2b9776982360a234803665cb79e8abcfeb0e3c79 31-Aug-2012 Jamie Gennis <jgennis@google.com> Merge "BufferQueue: clean up buffer counting" into jb-mr1-dev
94f261556cc5f4aa628cd5b71bf923b583f6e3c3 30-Aug-2012 Wink Saville <wink@google.com> Revert "A vendor ril depends on a native screen shot code."

This reverts commit 9b5782baf0a8a2d7afc7129453beb5df7abe7650.

A new ril for toro, hack no longer needed.
urfaceComposerClient.h
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
ufferQueue.h
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
ufferQueue.h
urfaceTexture.h
9b5782baf0a8a2d7afc7129453beb5df7abe7650 29-Aug-2012 Wink Saville <wink@google.com> A vendor ril depends on a native screen shot code.

Add a temporary shim until the vendor fixes the ril.

Bug: 7073467
Change-Id: Ia95a58bd90677c03406c988d1c29ae785f8662f2
urfaceComposerClient.h
3ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2a 28-Aug-2012 Mathias Agopian <mathias@google.com> Eradicate DisplayID.

DisplayDevices are now keyed of the wp<IBinder> the client uses.
DisplayID has now become DisplayType which is just used to identify
physical displays (as opposed to virtual displays such as wifi displays).

Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
SurfaceComposerClient.h
a50b51c03aca449920fc8581a738032a7bce7150 28-Aug-2012 Jeff Brown <jeffbrown@google.com> Compatibility work around for bad graphics driver dependency.

This is a compatibility shim for one product whose drivers
are depending on SurfaceComposerClient::getDisplayInfo(
int, DisplayInfo*) when it really shouldn't.

Revert this patch when the problem has been resolved.

Bug: 7065398
Change-Id: I6542691b81fd1b1e1d79500a62e82d40a3d51db7
urfaceComposerClient.h
380223bf1b340e7503177254a60d5982f95ab793 27-Aug-2012 Jeff Brown <jeffbrown@google.com> Remove unused "layer" argument from show().

Change-Id: I8944a9f4a27c330b11e5e837c69b88c8f84145ba
urface.h
urfaceComposerClient.h
9d4e3d2f42e93e2d12bacabe97d307d30c3c20dd 25-Aug-2012 Jeff Brown <jeffbrown@google.com> Banish DisplayID from the SurfaceFlinger API.

Use only display tokens in the API to refer to new displays.

Don't require the caller to specify the display when creating
a surface (since in general a surface could be shown on
any display).

This is intended to be a minimum change just to update the API.
Note that SurfaceFlinger still uses DisplayID in a few places
internally that might cause some features not to work properly
when there are multiple displays (LayerScreenshot, for example).

Change-Id: I3d91eec2da406eefd97bcd53655d403ad865a7e6
SurfaceComposer.h
SurfaceComposerClient.h
urface.h
urfaceComposerClient.h
490aee0fc5012acf2bf0b1dfe9c09e6fcca606fc 24-Aug-2012 Jamie Gennis <jgennis@google.com> Merge "SurfaceTexture: inherit from ConsumerBase (try 2)" into jb-mr1-dev
9fea3421ffddf6480f57f55a25936a886043d909 08-Aug-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: inherit from ConsumerBase (try 2)

This change makes SurfaceTexture inherit from ConsumerBase. It removes all of
the functionality from SurfaceTexture that is now provided by the base class.
This includes fixes for two bugs that were found after checking this change in
the first time and then reverting it.

Change-Id: Ie2d9f4f27cfef26fdac341de3152e842b01a58d2
onsumerBase.h
urfaceTexture.h
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
ufferItemConsumer.h
puConsumer.h
f57e7540d4cf799f18fe87d3536c55f1e0064931 21-Aug-2012 Eino-Ville Talvala <etalvala@google.com> CpuConsumer: inherit from ConsumerBase

Change-Id: I55178b1d673ffa0fbc6e63ef47642c64d4d03228
puConsumer.h
8683fca395d01734ec7946e9f0595ec5d7b754c6 13-Aug-2012 Mathias Agopian <mathias@google.com> improve [un]marshalling of non-binder objects

this change introduces a new class LightFlattenable<> which is
a protocol to flatten simple objects that don't require
binders or file descriptors; the benefit of this protocol is that
it doesn't require the objects to have a virtual table and give us
a consitant way of doing this.

we also introduce an implementation of this protocol for
POD structures, LightFlattenablePod<>.

Parcel has been update to handle this protocol automatically.

Sensor, Rect, Point and Region now use this new protocol.

Change-Id: Icb3ce7fa1d785249eb666f39c2129f2fc143ea4a
ensor.h
e57f292595bec48f65c8088b00ff6beea01217e9 10-Aug-2012 Mathias Agopian <mathias@google.com> make multi-display more real

- displays are represented by a binder on the client side
- c++ clients can now create and modify displays

Change-Id: I203ea5b4beae0819d742ec5171c27568f4e8354b
SurfaceComposer.h
urfaceComposerClient.h
3165cc21cfea781988407b19bd83292b19f05f55 09-Aug-2012 Mathias Agopian <mathias@google.com> libgui includes refactoring

Change-Id: I1d24ec17f5003ec2abab5f7472daaff4cc4cc2d3
SurfaceComposer.h
SurfaceComposerClient.h
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
ufferQueue.h
onsumerBase.h
92efd84f37ce5a8aae74dc9086f825a67b6894e9 03-Aug-2012 Mathias Agopian <mathias@google.com> screen-off animation won't be handled by SF anymore

Change-Id: Idc41386804ae7d7eb981c36e1bc55c270870c8d0
SurfaceComposer.h
c666cae2d5995097ec49a87e375e2afdd92802b7 26-Jul-2012 Mathias Agopian <mathias@google.com> get rid of the shared-memory control block

Change-Id: If814060aca1d2ff2619d4adcd57296983d207f7f
SurfaceComposer.h
urfaceComposerClient.h
8785578391eacd4192333d7b0ce3afedd7d163e6 25-Jul-2012 Mathias Agopian <mathias@google.com> add a layerStack attribute to Layers.

this attribute can be set through a regular transaction using
SurfaceComposerClient (just like any other attribute, eg: position or size)

Change-Id: I701a47c677ea6442ca713728a93335328cd2b172
SurfaceComposer.h
urfaceComposerClient.h
8b33f032327f8de0dcc0e6d0d43ed80f834b51f6 25-Jul-2012 Mathias Agopian <mathias@google.com> update SF binder protocol to support setting display attributes

no change of functionality -- the old behavior is implemented
on top of this new protocol.
this new protocol will allow, eventually, to pass informations
about displays and layer stacks.

Change-Id: Ic6c2295e61ec8ecbc8ce01ab7664e35d928202fc
SurfaceComposer.h
6d7e32c672189ef2b900fc5467dbf603f84dce54 17-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove unused layer flags.

Change-Id: Ia85365f18770a9a2c0a0e30ae56b6c2226d41be6
SurfaceComposer.h
6501e9944df131b3b7e293007084735dfa217f24 17-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freeze(), unfreeze() and setFreezeTint().

This is all dead code.

Change-Id: I646673aac793a6ec45021c370a2450f0ea4fbcce
SurfaceComposer.h
urface.h
urfaceComposerClient.h
f9176a93a5c9061fe001c91bca50dd0a58d54f10 16-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freezeDisplay(), which is no-op.

Change-Id: I2b70249a1545636fd6d98b58057b22f9529cad21
urfaceComposerClient.h
dc5b485f74edf2d2f31c62054eb6c180421a3ade 30-Jun-2012 Jesse Hall <jessehall@google.com> Pass fence to HWC on first use of buffer

Also do a CPU-wait on the fence before using it for GL composition.

Change-Id: I0f645a42a44803276cae11b904e5a26d65871562
urfaceTexture.h
b42b1ac1587aebda5e2f334d95b620271fafba4e 28-Jun-2012 Jesse Hall <jessehall@google.com> Return fence from acquireBuffer

Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
ufferQueue.h
c777b0b3b9b0ea5d8e378fccde6935765e28e329 28-Jun-2012 Jesse Hall <jessehall@google.com> Pass fences with buffers from SurfaceTextureClient

Change-Id: I09b49433788d01e8b2b3684bb4d0112be29538d3
ufferQueue.h
SurfaceTexture.h
3094df359d1e6e2ae8ca4e935cc093f563804c96 19-Jun-2012 Mathias Agopian <mathias@google.com> First prototype atttempting to support an external display

both API and implementation will change, this is just a prototype
intended to show feasability.

SurfaceFlinger is passed an ISurfaceTexture through a new
callback, it is in turn used to create an EGLSurface which
surfaceflinger will draw into in addition to the main screen.

Change-Id: Id0bbb0b854bb7bae44d57246a90b65d4567f9a21
SurfaceComposer.h
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
ufferQueue.h
SurfaceTexture.h
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
ufferQueue.h
urfaceTexture.h
d8e812ce6fe9ae0388e98b08456e1d18b9498239 14-Jun-2012 Jamie Gennis <jgennis@google.com> Update ANativeWindow clients for sync

This change updates the uses of ANativeWindow to use the new ANW functions that
accept and return Sync HAL fence file descriptors.

Change-Id: I3ca648b6ac33f7360e86754f924aa072f95242f6
urfaceTextureClient.h
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
ufferQueue.h
8e533069e5721e55cb9768e140e16546c3a4a8b6 07-Jun-2012 Colin Cross <ccross@android.com> surfaceflinger: replace early suspend with binder call from PowerManager

SurfaceFlinger will no longer directly synchronize with early suspend.
Instead, PowerManagerService will synchronize with SurfaceFlinger to
ensure that a black frame has been drawn on the display, and then
trigger all early suspend handlers.

Change-Id: I07acdd628440d23fdb69db94319ec5d65d3f4919
SurfaceComposer.h
2466e402a054669ecda0d2b0dcb9cc08c4a9559a 30-May-2012 Mathias Agopian <mathias@google.com> am 584fcb32: am 2c8207e9: add the ability to reject buffers in SurfaceTexture::updateTexImage

* commit '584fcb3218e07d7b4cc0aeaef41faa4e891b45a4':
add the ability to reject buffers in SurfaceTexture::updateTexImage
2c8207e9627fe6c7a90e31fae8d71ae49df56845 24-May-2012 Mathias Agopian <mathias@google.com> add the ability to reject buffers in SurfaceTexture::updateTexImage

SurfaceFlinger is using this new feature to reject buffers that
don't have the right size.

Bug: 6498869
Change-Id: I8a7250a47db6c082a357b703feb3b9d0fc8d3443
urfaceTexture.h
a74eb25cbc42a9dde0df6b2303fda9027f77f393 15-May-2012 Jamie Gennis <jgennis@google.com> am dd739965: Merge changes I32fbc2b6,Ifd0ed05b into jb-dev

* commit 'dd73996552938ac5165a35f09d389abedcf421ef':
SurfaceFlinger: recompute visible regions less
libgui: remove setPostTransformCrop
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
ufferQueue.h
puConsumer.h
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
urfaceTextureClient.h
f15a83f5814219c167f87cb8aaea622fc8493499 11-May-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add a crop to the layer state

This change adds a crop rectangle specified in window coordinates to the layer
state. The all window pixels outside this crop rectangle are treated as though
they were fully transparent. This change also adds the plumbing necessary for
WindowManager to set that crop.

Change-Id: I582bc445dc8c97d4c943d4db8d582a6ef5a66081
SurfaceComposer.h
urface.h
urfaceComposerClient.h
5c1139fea3cc0fd9847a6594d853a458152b2fbc 09-May-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: improve texture matrix computation

This change reduces the shrinking of the crop rectangle in some cases. It adds
a way to inform the SurfaceTexture that its texture will be used without
bilinear interpolation, and uses knowledge of the pixel format to avoid
shrinking unecessarily.

Change-Id: I72365f39f74ecb7fcc51b4cf42f2d0fa97727212
urfaceTexture.h
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
ufferQueue.h
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
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
ufferQueue.h
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
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
SurfaceTexture.h
urfaceTextureClient.h
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
ufferQueue.h
SurfaceTexture.h
a0db308c3d62301ae41b2e2bcf295c4ee4c7b08e 23-Apr-2012 Mathias Agopian <mathias@google.com> remove SurfaceTexture::connect()

use BufferQueue::connect() instead

Change-Id: I04aab7cf11304bf962cde38470747f3b19ddba42
urfaceTexture.h
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
urfaceTexture.h
ac6035a12aec38eeb14d0c13636ec980066d9a8f 13-Apr-2012 Mathias Agopian <mathias@google.com> s/w rendered apps can now use n-buffering (n>2)

Bug: 6311881
Change-Id: I6e52e281e8d432430aad011f6d9dcf35d7b4ac7d
urfaceTextureClient.h
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
urfaceTexture.h
55a701459de964ae3504264a6b8c4dc37f54a9e8 10-Apr-2012 Michael I. Gold <gold@nvidia.com> SurfaceTextureClient: support for application buffer dimensions

Add a new API native_window_set_buffers_user_dimensions to allow native
applications to override the native window size for the default buffer size.
This has lower precedence than the existing
native_window_set_buffers_dimensions and allows the two to co-exist.

Change-Id: Ie73590e1c94ef0dadbce500bd0941dfabbcace3c
urfaceTextureClient.h
f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246 10-Apr-2012 Mathias Agopian <mathias@google.com> use in/out structures for queueBuffer() IPC

Change-Id: Ie125df2444b62a9a2200586a717dca268852afc9
ufferQueue.h
SurfaceTexture.h
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
ufferQueue.h
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
ufferQueue.h
urfaceTextureClient.h
8cce8a9a75d172e0077960223ac5f2d06df33892 06-Apr-2012 Jamie Gennis <jgennis@google.com> Merge "Fixed disconnect bug in SurfaceTexture"
7b5be95cb3903087742f1079fe89cddd8abe3696 03-Apr-2012 Mathias Agopian <mathias@google.com> use a socketpair instead of a pipe in BitTube

Bug: 6252830
Change-Id: Ia7a7b08409517214136261c05569dc5959a597ab
itTube.h
isplayEventReceiver.h
ensorEventQueue.h
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
ufferQueue.h
urfaceTexture.h
0e1080f887bcd80c75910cabe7b2eca224bf739c 02-Apr-2012 Jamie Gennis <jgennis@google.com> Merge "SurfaceTexture: add context attach & detach"
74bed55fff0132be319bcd1703970516ae28b3a9 29-Mar-2012 Jamie Gennis <jgennis@google.com> SurfaceTexture: add context attach & detach

This change adds the detachFromContext and attachToContext methods to
SurfaceTexture. These methods allow the SurfaceTexture to switch from
one consumer GLES context to another. This change also includes a few
cleanups to the error return codes in updateTexImage.

Change-Id: I0df1eb599aa7b6f58f07431f242f8f09269559ed
urfaceTexture.h
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
ufferQueue.h
SurfaceTexture.h
urfaceTextureClient.h
9d61a28d72d85ac0460fb7fba9f85f8a955354c7 27-Mar-2012 Daniel Lam <dalam@google.com> Refactored DummyConsumer

DummyConsumer no longer uses a ProxyConsumerListener

Change-Id: I0a99428b3f9dae82cb47d5da3589de77653f3d7c
ummyConsumer.h
f71c4ae136f7749b9dfdaa2dd64d771868eeeb2d 24-Mar-2012 Daniel Lam <dalam@google.com> Added a DummyConsumer for use with BufferQueue.

The DummyConsumer is a consumer that can connect to BufferQueue
that does nothing. It is required as BufferQueue checks
if a consumer is connected. Also fixes a bug where SurfaceTexture
was reusing old texture slots.

Bug: 6172739
Change-Id: I5e7a118dd4d07807ba4c763200242b5ee7d3412b
ufferQueue.h
ummyConsumer.h
b0e76f456afaada43ddb0968bb37145219f90cd3 23-Mar-2012 Mathias Agopian <mathias@google.com> remove dependency of EGL on ndk header

Change-Id: Ia6e489b5b4f028864bdf54923e81f604710dd8ad
urfaceTextureClient.h
ce561372186c7549a8a5fe996ac5965cda087007 20-Mar-2012 Jamie Gennis <jgennis@google.com> libgui: have ST::updateTexImage check the GL ctx

This change adds a check to SurfaceTexture::updateTexImage to verify
that the current GL context is the same as the one that was used for
previous updateTexImage calls.

Change-Id: If02d2f787bcfdb528046dc9ddf6665f8a90e1bf4
urfaceTexture.h
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
ufferQueue.h
urfaceTexture.h
b267579ba8dfe3f47d2a481c5a3c2254e3d565a1 23-Feb-2012 Daniel Lam <dalam@google.com> SurfaceTexture: Fully refactored from BufferQueue

SurfaceTexture and BufferQueue are separate objects.

Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
ufferQueue.h
urfaceTexture.h
urfaceTextureClient.h
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
ufferQueue.h
urfaceTexture.h
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
ufferQueue.h
GraphicBufferAlloc.h
Surface.h
SurfaceComposer.h
SurfaceComposerClient.h
urface.h
urfaceComposerClient.h
9b10c47e112afc3600380895046a4a56e34cf6a8 27-Feb-2012 Daniel Lam <dalam@google.com> Revert "Removed dependecies between BufferQueue and SurfaceTexture"

This reverts commit a631399f71dbc7659d2f241968f85d337726ae61
ufferQueue.h
urfaceTexture.h
32167056348f55609b896a5f6b15bd1dd42d8d19 27-Feb-2012 Jamie Gennis <jgennis@google.com> Merge "Removed dependecies between BufferQueue and SurfaceTexture"
5f2165f9455d4893b581b73a67c5431f4344b47e 25-Feb-2012 Mathias Agopian <mathias@google.com> remove dependency on android_native{s_priv|buffer}.h

Change-Id: Ie4b95f7061c240f37c504414259f92d72c4ffc89
urfaceTextureClient.h
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
ufferQueue.h
urfaceTexture.h
b856052c00dfef70d0957482c72c2979ffc4733a 31-Jan-2012 Daniel Lam <dalam@google.com> Refactored query function from SurfaceTexture into BufferQueue

Change-Id: Id1cb6cc38d01edb4fcfcad867c5a7693bdcc3ab1
ufferQueue.h
urfaceTexture.h
6b091c53000c843211c218ce40287a7edca9bc63 23-Jan-2012 Daniel Lam <dalam@google.com> Refactored ISurfaceTexture calls from SurfaceTexture into BufferQueue.

Change-Id: I514f6b802f6b49c9ae27bed37bf0b9d23da03c9a
ufferQueue.h
urfaceTexture.h
99ce5cdeb383216dee95af4d90e47406b0948ea1 01-Feb-2012 Mathias Agopian <mathias@google.com> separate transactions from updates

with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
isplayEventReceiver.h
3cf199aef6250552555344944c3e3a6e4ab05f92 01-Feb-2012 Mathias Agopian <mathias@google.com> fix an issue with vsync event delivery

vsync events were sometimes delivered to connected
client who didn't request them. this happened if
another client requested the delivery and that client
was first in the client list.

also fix the vsync test which didn't request any events as
well as DisplayEventReveiver documentation which was misleading
about the necessity to request vsync events.

Change-Id: Ie990fda3f337f8f0042745c4b2cde67936c45686
isplayEventReceiver.h
478ae5eb5a0047e1b2988c896cff6363b455ee50 07-Dec-2011 Mathias Agopian <mathias@google.com> Improve the VSYNC api a bit.

- add the ability to set the vsync delivery rate, when the rate is
set to N>1 (ie: receive every N vsync), SF process' is woken up for
all of vsync, but clients only see the every N events.

- add the concept of one-shot vsync events, with a call-back
to request the next one. currently the call-back is a binder IPC.

Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
isplayEventReceiver.h
DisplayEventConnection.h
a4fbecd1198899a3a4e55795406a06e7c111b13e 30-Nov-2011 Mathias Agopian <mathias@google.com> am 55d3880e: am bb1e7d43: Merge changes I7e973a35,Ib3386fcc into ics-mr1

* commit '55d3880eed3450748eb7b97281e030902ee29c2a':
SurfaceTexture: add EGL_KHR_fence_sync option
SurfaceTexture: add a blit-to-FBO test
86edf4f6470ee0f108bf40d3c1d23bf0a78c9c38 14-Nov-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: add EGL_KHR_fence_sync option

This change adds a compile-time option for SurfaceTexture to use the
EGL_KHR_fence_sync extension to synchronize access to Gralloc buffers.

Bug: 5122031
Change-Id: I7e973a358631fff5308acf377581b811911fe790
urfaceTexture.h
d0566bc26fcf6ca396118701fa11900b627f2c09 18-Nov-2011 Mathias Agopian <mathias@google.com> Add support for sending VSYNC events to the framework

use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: Ia720f64d1b950328b47b22c6a86042e481d35f09
isplayEventReceiver.h
DisplayEventConnection.h
185a0a0420f54f9588ec1c7230313023a7a2259b 22-Nov-2011 Jamie Gennis <jgennis@google.com> am c2597295: am 53cf2020: Merge changes I37fd43b5,I91eb29db,I0491ce35 into ics-mr1

* commit 'c25972950c2ea62fb085524dbe737c2bf0f08f4a':
SurfaceTexture: fix a couple tests
EGL: default to swap interval 1
SurfaceTexture: clean up some tests
59769469e4b9b2d8b12c020eb44b030b3927a50b 20-Nov-2011 Jamie Gennis <jgennis@google.com> EGL: default to swap interval 1

This change explicitly sets swap interval 1 on the window when an
EGLSurface is created to render to it.

Change-Id: I91eb29dbee3ae4a55076b921f084d503fbe94e03
urfaceTexture.h
8bee68fac2dba0a72a58a243601d5d7d12e116e6 19-Nov-2011 Mathias Agopian <mathias@google.com> am d0df44b5: am 4d71053b: Merge "attempt to fix bug 5313580" into ics-mr1

* commit 'd0df44b5c979e00a19187cea35768ba26557e447':
attempt to fix bug 5313580
a36bcd53ac075054bb39ef506687f4daaf9bac6b 18-Nov-2011 Mathias Agopian <mathias@google.com> attempt to fix bug 5313580

the working theory here is that a Surface object has become non-promotable
because it lost its last reference; later Surface::readFromParcel is called
the previous surface is found in the cache, but can't be promoted. this causes
a new Surface object to be created which will promptly try to connect to the
CPU_API -- this in turn will fail because the previous (now dead) surface is
still connected.

To fix this, we make sure to disconnect from the SurfaceTexture when
Surface[TextureClient] is destroyed.

Change-Id: I422234868a05d7b7d283e9d5a85f7ab79e65d8a9
urfaceTextureClient.h
ccf5b9febc9486c67ace40fbfc53b49eadf2c159 17-Nov-2011 Jamie Gennis <jgennis@google.com> am 7765fc65: am fd6b64f6: Merge "SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call" into ics-mr1

* commit '7765fc651a9519dd2f0ac9d3374a50e9865c5c99':
SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call
a929748ddb67cbece3337c7fda7877fdeb973aa4 10-Nov-2011 Sunita Nadampalli <sunitan@ti.com> SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call

Surface Texture dequeue logic is modified to return the oldest of the
free buffers to Client on dequeue call.

Currently dequeue method is returning the first buffer index which is free.
The parsing is done in ascending order of the buffer slot indices.
This leads to returning the buffer which has been just queued to composer,
and hence display, and this defeats the purpose of having minimum dequeue count
as 2 in asynchrnouse mode.

This is fixed by checking all the free slots and returning the oldest buffer.

Change-Id: Ibbac10593c3994c278c601af0480b171635ecdd4
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
urfaceTexture.h
8c11963dda80d4add300520a8863bed39231825d 14-Nov-2011 Mathias Agopian <mathias@google.com> am 738d8cae: am c93a151f: Merge "Define, document, and test the behavior of very large SurfaceTextures" into ics-mr1

* commit '738d8cae2239d194429676f2889cfae3c8f7ba08':
Define, document, and test the behavior of very large SurfaceTextures
194c76c0477189700fda068e19b953b1d9af201a 10-Nov-2011 Mathias Agopian <mathias@google.com> Define, document, and test the behavior of very large SurfaceTextures

updateTexImage() now throws a runtime exception when its native
counterpart fails

Bug: 5506633

Change-Id: I151a6f685d465966e7df4df624412ab2da62e95f
urfaceTexture.h
5cae0d0699a169e468fff3e21165f35db12f2cde 21-Oct-2011 Mathias Agopian <mathias@google.com> Rename SensorChannel to BitTube
itTube.h
SensorEventConnection.h
ensorChannel.h
ensorEventQueue.h
1a2b83a17d3bdb2440b8b5b96136f7916a5528b5 17-Oct-2011 Mathias Agopian <mathias@google.com> SensorManager reconnects to sensor service when the later dies

if system process ever restarted, processes using a SensorManager
would loose the ability to use it, resulting to a crash.
we now listen for sensor service death and reconnected if necessary.

Bug: 5445240
Change-Id: Ia47f8b26cdcecb729fa22bf11d55e10fcaef8cfc
ensorManager.h
fb1b5a2f333800574b0da435d1200cf9b13d723f 28-Sep-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: parameterize the texture target

This change adds a hack to allow Android Browser to use a SurfaceTexture
to stream RGBA images to a GL_TEXTURE_2D texture object.

Change-Id: Idb90064d5d4b920959ef3be7451362ac5012460e
urfaceTexture.h
fa28c35c21d1bf8b38f541758c291bc17a2d7270 17-Sep-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: add name support

This change adds support for setting a string that can be used to
identify a SurfaceTexture object in log messages.

Change-Id: Ib4ee085f36c8830dc964c05ef1654f5a55dfcd60
urfaceTexture.h
29b5762efc359022168e5099c1d17925444d3147 18-Aug-2011 Mathias Agopian <mathias@google.com> don't return the current buffer from dequeueBuffer

we were not reseting mCurrentTexture in some situations
which in turn caused dequeueBuffers() return a
"FREE" buffer that was also current.
Very often it was harmless, but it created a race with
updateTexImage() which could cause the following
queueBuffers() to fail.

Bug: 5156325
Change-Id: If15a31dc869117543d220d6e5562c57116cbabdb
urfaceTexture.h
8e19c2e97e11505ee2ecf336275fd956f2ccfa22 11-Aug-2011 Mathias Agopian <mathias@google.com> fix a crasher in SurfaceTexture::updateTexImage()

we now make sure to drain the buffer queue on disconnect.
this happens only when in synchrnous mode. in async mode
we clear all buffers except the head of the queue.

for extra safety we also catch the null pointer
in updateTexImage (which should never happen) and return
an error.

Bug: 5111008

Change-Id: I5174a6ecbb0de641c6510ef56a611cbb4e9e1f59
urfaceTexture.h
2560d14ce8e38984032d999e3fdf8da9a47baf3c 11-Aug-2011 Mathias Agopian <mathias@google.com> rework dequeueBuffer()'s main loop.

this simplifies the code a bit and also makes sure
we reevaluate mAbandoned and mConnectedApi each time
we come back from waiting on mDequeueCondition

Change-Id: I1f8538b62ad321b51ed79d953b700036daba796d
urfaceTexture.h
ef51b992192adf4fc432686ab346f5fc7a13bc95 11-Aug-2011 Mathias Agopian <mathias@google.com> error out when SurfaceTexture APIs are called while not connected

- also log a warning when freeAllBuffers is called with a non empty buffer queue
- rename freeAllBuffers to freeAllBuffersLocked

Change-Id: Idb71fdcf233b9ccae62d5a2a7c3c4bad2501d877
urfaceTexture.h
5bfc24515bb5c8ea7975f72d538df37753733a2f 09-Aug-2011 Mathias Agopian <mathias@google.com> return correct value from query after connecting a surface

the first time a surface was connected, the values returned
by query NATIVE_WINDOW_DEFAULT_{WIDTH|HEIGHT} and
NATIVE_WINDOW_TRANSFORM_HINT were wrong until a call
to queueBuffer was performed.

Bug: 5137366, 5121607
Change-Id: I7ac6b5b0daa876638f6bed7c20f286a6e6d984f6
SurfaceTexture.h
urfaceTexture.h
96e108271bb5da44a130c8b5976fc63879403735 26-Jul-2011 Mathias Agopian <mathias@google.com> Merge "remove dead code and member variables."
3fbce7c56082e4e0d23f1c1c89983d3841853ed7 26-Jul-2011 Mathias Agopian <mathias@google.com> remove dead code and member variables.

also fix some comments and improve debugging logs.

Change-Id: I83e55309f306332b59e1ec46104c4a7fffbf3c97
urfaceTextureClient.h
fa1e002cec5dc33ebe52685dc81d644f783811a8 25-Jul-2011 Jamie Gennis <jgennis@google.com> Merge "SurfaceTexture: enable RGB external textures"
1f8e09f40d16ae377164d86e91385ad3d8e78e82 20-Jul-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: enable RGB external textures

This change removes support for conditionally using the GL_TEXTURE_2D
target for SurfaceTexture textures with RGB buffers. It also enables
and fixes the RGB-based SurfaceTexture tests.

Change-Id: I9a251a981cf66af6b048b2e4c3fe7231e4774f4d
urfaceTexture.h
7b305fffc39d0fe0926e7fd2d7f6a524fbce62b7 19-Jul-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: add the abandon method.

This change adds the 'abandon' method to the SurfaceTexture C++ class.
This method may be used to put the SurfaceTexture in an abandoned state,
causing all ISurfaceTexture methods to fail.

Change-Id: Ibd261f7b73f44e2bec36a8508bf92113cfb7cf95
SurfaceTexture.h
urfaceTexture.h
29c870271e8d3f8c40c356283650ba54fe71a16b 19-Jul-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix a comment

Change-Id: I799532f77f8fbb6b8ee6888fdd8852b6f28e8c33
urfaceTexture.h
976f494d53cb239307fd810ce592b5b5de1cbc41 19-Jul-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: remove getAllocator

This change removes the SurfaceTexture::getAllocator method, as it's no
longer needed. Proper refcounting of the Gralloc buffers is now handled
by the IGraphicBufferAlloc binder marshalling code.

Change-Id: I5cffa6ebfc1bc5828fb7ce0e0a5b2f55cd8479da
SurfaceTexture.h
urfaceTextureClient.h
c10d9d90b2088a3304076e0dc4bf05cdbb5d45ab 21-Jul-2011 Mathias Agopian <mathias@google.com> clean-up. get rid ofunused code and members in Surface[Control].cpp

Change-Id: Ia7790ae28af2c2ac99eae01c2c5044ace4a490a4
SurfaceTexture.h
97c602c5af5f3ffd69009bf496d86347b71a2b4c 20-Jul-2011 Mathias Agopian <mathias@google.com> implement: "Add an ANativeWindow API for SurfaceFlinger to suggest an optimal buffer orientation"

Bug: 4487161
Change-Id: I883f34efe542c2a566d04966f873374f40c50092
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
7734ebfe47f42f980c1b44c1f284a91d8ad1d6c7 14-Jul-2011 Mathias Agopian <mathias@google.com> Add set_scaling_mode() to ANativeWindow.

This allows to specify the scaling mode independently from
the buffer size.

Change-Id: Iaa2baa660445531a97d3fac192e580f4929c5d3b
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
8f9dbf9e13b927de2524116c30544f7dfbbbf56c 14-Jul-2011 Mathias Agopian <mathias@google.com> move lock/unlock implementaion outside of Surface into SurfaceTextureClient

This makes ANativeWindow_lock/ANativeWindow_unlockAndPost work
with ANativeWindows implemented by Surface and SurfaceTextureClient.

Also, Surface now inherits directly from SurfaceTextureClient.

Bug: 5003724
Change-Id: I9f285877c7bae9a262e9a7af91c2bae78804b2ef
urfaceTextureClient.h
677517ae3f380e701a47abe4738b748fb3ca161d 15-Jul-2011 Jamie Gennis <jgennis@google.com> Merge changes Id9aa1003,I8c154189

* changes:
SurfaceTexture: make (dis)connect into an IPC
SurfaceTexture: add support for new connect values
fe0a87b54654a1392650e7f1862df473287d8332 14-Jul-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: make (dis)connect into an IPC

This change makes the ANativeWindow connect and disconnect calls result
in an IPC to the SurfaceTexture object. This will allow us to prevent
multiple simultaneous connections from different processes.

Change-Id: Id9aa1003b1335b96ca6bd4a1f5a67aa433d42efb
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
bee205fd58a27c10a0895de5339e76025d429d2b 01-Jul-2011 Jamie Gennis <jgennis@google.com> EGL: fix the ANativeWindow size/fmt override

This change fixes how the Android EGL layer overrides the size and
format of an ANativeWindow in eglCreateWindowSurface. The new behavior
is to leave the size untouched when overriding the format. The previous
behavior was to reset the ANativeWindow to use the default size set by
the ANativeWindow implementation.

It also adds two new 'perform' methods to the ANativeWindow interface:
set_buffers_dimensions and set_buffers_format, and redefines the
behavior of set_buffers_geometry to be the combination of these two new
methods.

Additionally, this change adds an error check for the return value of
the new native_window_set_buffers_format call, which required adding a
(stub) handler for to FramebufferNativeWindow.

Change-Id: I805c7ccd8d4730dfb132d10d8bc3fb058a0b9df1
urfaceTextureClient.h
19e0a8bfe9a15543b0bd7991cce08e5362e9f5cd 01-Jul-2011 Pannag Sanketi <psanketi@google.com> Merge "Minor fix in SurfaceTexture"
292a31a4c2ae2f6faf134e8e4a726583017dad06 24-Jun-2011 Pannag Sanketi <psanketi@google.com> Minor fix in SurfaceTexture

Change-Id: Ic859715becf3e6d5107bd8beb8c577034d00ec52
urfaceTexture.h
3d8063b02e06020c8062addcc9ec49048d3bdb9a 27-Jun-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: change onFrameAvailable behavior

This change alters the conditions under which the onFrameAvailable
callback gets called by the C++ SurfaceTexture class. The new behavior
is to call the callback whenever a frame gets queued that will be
visible to the buffer consumer. This means that buffers queued in
synchronous mode always trigger the callback, as those buffers will
remain pending until they are consumed. Buffers queued in asynchronous
mode will only trigger the callback if there was not previously an
unconsumed buffer pending.

The new behavior means that a consumer should perform a draw operation
exactly once for every onFrameAvailable call that it recieves. This
change also modifies SurfaceFlinger and the SurfaceTexture JNI to
support of the new behavior.

Change-Id: I8b2c6e00961d3d58b11c6af50b555b6e4c5f5b40
urfaceTexture.h
14a0e58074f2698829b6554f578e6762c377caa3 24-Jun-2011 Grace Kloba <klobag@google.com> Add allowSynchronousMode to SurfaceTexture constructor.

Change-Id: I54f30a3c16bbe6b813f3bcd1d389da5627531304
urfaceTexture.h
1c4414091cfb93206067fb64eba445653739d40f 20-Jun-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix a NULL ptr dereference.

This change adds a NULL check when searching the slot list in
SurfaceTextureClient for the slot corresponding to a buffer being
queued or canceled.

Bug: 4645023
Change-Id: I806cbc1e34da118ea33a83c4f25ce8193ba1c3ad
urfaceTextureClient.h
ae468f43418c3cbae74c7f546283f6bb4e4df690 12-Jun-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix up a comment.

Change-Id: I044e44e17319e08af657a7ec9fa39100876fe862
urfaceTexture.h
736aa9573bb7b78f9c315f396c104491b3639426 13-Jun-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix a getTransformMatrix crash.

This change moves the computation of the transform matrix out of
getTransformMatrix and instead performs the computation when
updateTexImage gets called. This is needed in order for
getTransformMatrix to succeed even if the buffers have been freed (e.g.
by changing the buffer count) because the computation depends upon the
properties of the current GraphicBuffer.

Change-Id: Ied541ab8747b7ad604f862717135f9a16a816be9
Bug: 4490420
urfaceTexture.h
b62013f6aafee08cfad25a2712dc32264e44f783 18-May-2011 Mathias Agopian <mathias@google.com> 9-axis sensor fusion with Kalman filter

Add support for 9-axis gravity and linear-acceleration sensors
virtual orientation sensor using 9-axis fusion

Change-Id: I6717539373fce781c10e97b6fa59f68a831a592f
ensor.h
8cd5ba4b7f01d3a54a8f8bc6d1793aa5fc8e09ef 19-May-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: clean up some comments, tests, etc.

This change fixes up some stale comments, member variable names, log
messages and disables a failing test.

Change-Id: Ic1d3344b18066cf710e4a42838b2417c6b1f2f6c
urfaceTexture.h
cf46eb9817dfbfc020720d1e45b5c085252500fb 12-May-2011 Mathias Agopian <mathias@google.com> fix onFrameAvailable

Change-Id: I391fe9f6684ac9fd4f91416ce18b583f7087d966
urfaceTexture.h
68c7794183a7dbfe3b20d4ce832f8eb79c2c619a 10-May-2011 Mathias Agopian <mathias@google.com> Add SurfaceTexture logging

Change-Id: If1b74be5230813fb76429935d88b9d4a7c41700c
urfaceTexture.h
8072711307aa98ee5ee6f7369860ae38c3e19656 03-May-2011 Mathias Agopian <mathias@google.com> Implement {Surface|SurfaceTextureClient}::setSwapInterval()

Change-Id: I8382e346ddaa2c4c8ff56ac3ffd7f0109572f188
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
b3e518c820c7dbe35587bd45c510e4e5e7cfd9c9 22-Apr-2011 Mathias Agopian <mathias@google.com> Add the concept of synchronous dequeueBuffer in SurfaceTexture

Change-Id: Ic94cbab092953243a0746e04bbe1b2eb0cc930ef
urfaceTexture.h
eafabcdc1639fb96062d9e3c39b0ae27b0238ae1 20-Apr-2011 Mathias Agopian <mathias@google.com> unify SurfaceTexture and Surface

Change-Id: I49da2f5d8408e4cd7e148cfb777bb4ff68cd8f37
SurfaceTexture.h
urfaceTexture.h
c04f153353cdb0d291297d10452239f791d3fd2b 26-Apr-2011 Mathias Agopian <mathias@google.com> Fix a bug where setgeometry couldn't be undone

This change the binder protocol between SurfaceTextureClient
and SurfaceTexture. dequeueBuffer() now takes the requested
parameters for the buffer. SurfaceTexture decides if the
buffer needs to be reallocated and does the allocation
if needed. In that case it returns BUFFER_NEEDS_REALLOCATION
to tell SurfaceTextureClient that it needs to call
requestBuffer (which all parameters have been removed) to
acquire a pointer to the buffer.

dequeueBuffer and requestBuffer could be folded into a single
IPC call, but we chose to optimize the case where buffers are
not created and avoid some complexity in the marshalling code.

Change-Id: I097a7f6f40a3491e10f3f3742eab33999286c304
SurfaceTexture.h
urfaceTexture.h
697526bc9e44ce61c88614f98387ae8bbf0a187e 01-May-2011 Iliyan Malchev <malchev@google.com> frameworks/base: android_native_buffer_t -> ANativeWindowBuffer

Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
urfaceTextureClient.h
41abd67302b52aefadc2b3dea42226f16bf6d9ba 15-Apr-2011 Iliyan Malchev <malchev@google.com> frameworks/base: make the ANativeWindow query() method const

query() does not modify the object's data, so it needs to be a const method

Change-Id: I67c40a3c865461e6f1cc2193fd2d74286ff6ac8f
Signed-off-by: Iliyan Malchev <malchev@google.com>
urfaceTextureClient.h
7e3d7f341ab3789fe25064670374159a35e35ed3 19-Apr-2011 Mathias Agopian <mathias@google.com> Merge "changes to SurfaceTexture needed for unification with SF"
7a042bf324fe3f3d5d4085fda21fe50dc0c362b4 12-Apr-2011 Mathias Agopian <mathias@google.com> changes to SurfaceTexture needed for unification with SF

- implement connect/disconnect
- implement missing query
- handle texture_2d in addition to texture_external_oes

Change-Id: I971a70821f00f22b01f5337de4a7d451177fec4d
urfaceTexture.h
urfaceTextureClient.h
4cb18881b55b82a24873ccd8e298bc2d5a9c17e5 09-Apr-2011 Mathias Agopian <mathias@google.com> Fix a GraphicBuffer leak in SurfaceTexture

This leak was intentional, it was there to deal with the fact that
some gralloc implementations don't track buffer handles with
file-descriptors so buffers needed to stay alive until there were
registered, which is not guaranteed by binder transactions.

In this new implementation, we use a small BBinder holding a
reference to the buffer, which with tuck into the parcel. This forces
the reference to stay alive until the parcel is destroyed, which
is guaranteed (by construction) to happen after the buffer is
registered.

this allows the public facing API to not expose the previous hack.

Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143
urfaceTexture.h
a5c75c01620179ce00812354778a29a80d76e71f 01-Apr-2011 Mathias Agopian <mathias@google.com> SurfaceTexture can now force the client to request a buffer

SurfaceTexture now has the concept of default size a new method,
setDefaultBufferSize() to set it. When the default size is
changed, dequeueBuffer() will return a value telling the
client that it must ask for a new buffer.

The above only applies if the client has not
overriden the buffer size with setGeometry.

Change-Id: I520dc40363054b7e37fdb67d6a2e7bce70326e81
SurfaceTexture.h
urfaceTexture.h
1d01a12e7150be569557b64da9b8663c62c13594 18-Feb-2011 Eino-Ville Talvala <etalvala@google.com> Add support for timestamps into SurfaceTexture.

API addition: The timestamps are represented as nanoseconds from some
arbitrary time point. Like the SurfaceTexture transform matrix, the
timestamp retrieved by getTimestamp is for the last frame sent to the
GL texture using updateTexImage().

Camera HAL change: Expect vendors to set these timestamps using
native_window_set_buffers_timestamp(). For now, they are
autogenerated by SurfaceTextureClient if set_buffers_timestamp() is
never called, but such timing is likely not accurate enough to pass a
CTS test.

bug:3300707

Change-Id: Ife131a0c2a826ac27342e11b8a6c42ff49e1bea7
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
bae774eb20bebd409441b93386b51bccda75f546 14-Mar-2011 Jamie Gennis <jgennis@google.com> SurfaceTextureClient: Add ISurfaceTexture getter.

This change adds a getter method to SurfaceTextureClient to get the
ISurfaceTexture object with which the SurfaceTextureClient is
communicating.

Bug: 4086509
Change-Id: Ifec621e0fe5392a5be56b2348fdc54067cbebcdd
urfaceTextureClient.h
9d4d6c101d90d4a1d1ca9413cf3eb89d1f1898d6 27-Feb-2011 Jamie Gennis <jgennis@google.com> Add the MIN_UNDEQUEUED_BUFFERS query to ANW.

This change adds a new query to ANativeWindow for getting the minimum
number of buffers that must be left un-dequeued during the steady-state
operation of the ANativeWindow.

Change-Id: Ie8c461fc26b02ecde02ddb4f95bf763662cf1551
Related-Bug: 3356050
urfaceTexture.h
urfaceTextureClient.h
1b20cde313b5ef8acdace742328df867956d24cb 03-Feb-2011 Jamie Gennis <jgennis@google.com> Pass the IGraphicBufferAlloc to SurfaceTextureClient.

This change passes a reference to the IGraphicBufferAlloc binder object
to SurfaceTextureClient objects. When STC objects are created they
query their associated ISurfaceTexture object for the
IGraphicBufferAlloc that the SurfaceTexture uses to allocate buffers.
Having the SurfaceTextureClient hold this reference prevents the
GraphicBufferAlloc in SurfaceFlinger from freeing the allocated buffers
before the SurfaceTextureClient is done with them.

Change-Id: Ib8e30e8b37fdd60438cbb4cb7e9174d0ba6d661c
related-bug: 3362519
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
c4d4aeab52435c177ded6abdd578fec8191f0f5d 13-Jan-2011 Jamie Gennis <jgennis@google.com> Implement SurfaceTexture frame-available callback.

This change implements the onFrameAvailable callback for the
SurfaceTexture java class. It includes the C++ SurfaceTexture code as
well as the JNI and Java code to enable the callback.

Change-Id: Ifd8b8e7ad46ee70cba6da1c2e96dab8045d1ea30
urfaceTexture.h
9a78c90cd46b2a3bd637b056873149d3b94384b4 13-Jan-2011 Jamie Gennis <jgennis@google.com> Fix remote GraphicBuffer allocation in SurfaceFlinger.

This change fixes a horrible hack that I did to allow application
processes to create GraphicBuffer objects by making a binder call to
SurfaceFlinger. This change introduces a new binder interface
specifically for doing this, and does it in such a way that
SurfaceFlinger will maintain a reference to the buffers until the app is
done with them.

Change-Id: Icb240397c6c206d7f69124c1497a829f051cb49b
urfaceTexture.h
f238e28500ca756fbd9e323f728ce7c8dda59475 10-Jan-2011 Jamie Gennis <jgennis@google.com> Implement crop & transform for SurfaceTexture.

This change adds support for the setCrop and setTransform methods of the
SurfaceTexture C++ class. The crop and transform for the current
texture will be accessed by applications as a single texture coordinate
transform matrix.

Change-Id: I6482bf96f680e5c175364e848936db3908d6c8f8
urfaceTexture.h
67eedd74ab78c2bfed9fcdc74947b97289254ca4 09-Jan-2011 Jamie Gennis <jgennis@google.com> Fix a bug in SurfaceTexture::setBufferCount.

We need to reset mCurrentTexture and mLastQueued in setBufferCount
because it frees all of the buffers associated with the buffer slots.

Change-Id: Ie2f834ec1c07ce7a4ab9b2b5fc5fe8c294010c60
urfaceTexture.h
8ba32fade11abb73f3fd47ea0953c9528eb5b91f 20-Dec-2010 Jamie Gennis <jgennis@google.com> Add the SurfaceTexture C++ implementation.

This change adds the C++ implementation of SurfaceTexture and related
classes. The goal of this is for a SurfaceTexture to be passed to
camera service or Stagefright in place of a Surface to allow camera
preview or decoded video frames to be streamed to an OpenGL ES texture
that an application can use.

Change-Id: I55c83a7017f1ecb81c9c9e3252cbd118b914296c
SurfaceTexture.h
urfaceTexture.h
urfaceTextureClient.h
59abe7e0909bf4b7bf7b9601e1e40a05f6d4fd8a 14-Sep-2010 Jeff Brown <jeffbrown@google.com> Replace epoll() with poll() and rename PollLoop to Looper.

As part of this change, consolidated and cleaned up the Looper API so
that there are fewer distinctions between the NDK and non-NDK declarations
(no need for two callback types, etc.).

Removed the dependence on specific constants from sys/poll.h such as
POLLIN. Instead looper.h defines events like LOOPER_EVENT_INPUT for
the events that it supports. That should help make any future
under-the-hood implementation changes easier.

Fixed a couple of compiler warnings along the way.

Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
ensorEventQueue.h
a48bcf62b6a26f24a0bdd2b44bb39fadce499e92 30-Jul-2010 Mathias Agopian <mathias@google.com> Added SensorManager.getMinDelay()

Exposed the new "min delay" sensor property through native and
java sensor apis. This allows the caller to know what is the
maximum rate at which a sensor can return events, or, if a sensor
works in "update" mode (events returned only when the value changes).

Also augmented SensorManager.regusterSensorEvent() so that it can
accept a value in microsecond in addition to the 4 constants already
defined.

Change-Id: If425e9979892666df8c989d7de3c362230fa19e0
ensor.h
ensorEventQueue.h
e3c8234765050023b8a588607f819e8cc41a6363 22-Jul-2010 Mathias Agopian <mathias@google.com> propagate sensor event rate properly

Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc
ensorEventQueue.h
a7352c9f4a6e642c29782b19db5bc0bd98feddc8 15-Jul-2010 Mathias Agopian <mathias@google.com> new SensorService

remove old sensor service and implement SensorManager
on top of the new (native) SensorManger API.

Change-Id: Iddb77d498755da3e11646473a44d651f12f40281
SensorServer.h
ensor.h
ensorEventQueue.h
ensorManager.h
589ce85ee4174829cfedce91b6b2509d2a4002eb 14-Jul-2010 Mathias Agopian <mathias@google.com> first step at implementing the native sensor support

in this commit:
- implemented the C stub
- implemented the binder interfaces involved
- implemented most of the C++ client side

missing:
- SensorManager cannot connect to the SensorServer yet
(because there is no SensorServer yet)

Change-Id: I75010cbeef31c98d6fa62fd5d388dcef87c2636b
SensorEventConnection.h
SensorServer.h
ensor.h
ensorChannel.h
ensorEventQueue.h
ensorManager.h