Commit Graph

401 Commits

Author SHA1 Message Date
Aravind Akella 6c2664ae34 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
2014-08-19 11:18:25 -07:00
Rachad 7cb0d39016 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
2014-08-04 21:57:22 +00:00
Michael Wright 1f6078aef7 Have VirtualDisplays send SF resize messages when resizing
Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
2014-07-30 11:23:44 -07:00
Riley Andrews 03414a1cfe 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
2014-07-28 22:07:41 +00:00
Aravind Akella c268068c55 Merge "SensorService performance improvements." into lmp-dev 2014-07-24 15:37:54 +00:00
Aravind Akella 56ae42613c 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
2014-07-24 17:23:01 -07:00
Eric Penner 2295687487 Merge "GLProducer: Reference count images rather than buffers." into lmp-dev 2014-07-24 15:36:21 +00:00
Antoine Labour 78014f32da 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 ea96044470)
2014-07-22 19:45:55 +00:00
Eric Penner 5c3d243fcc 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
2014-07-21 18:16:12 -07:00
Ruben Brunk 1681d95989 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
2014-07-14 22:14:32 +00:00
Dan Stoza dc56bf721a Merge "BufferQueue: Add allocateBuffers method" 2014-06-27 15:56:14 +00:00
Dan Stoza ab57491de3 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
2014-06-25 15:00:48 -07:00
Dan Stoza e49ba8e2ed 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
2014-06-24 13:09:19 -07:00
Dan Stoza 29a3e90879 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
2014-06-20 13:13:57 -07:00
Aravind Akella adb65d9add Merge "Surface reportingMode for Sensors." 2014-06-12 03:30:50 +00:00
Aravind Akella 0e025c5af3 Surface reportingMode for Sensors.
Change-Id: Iac8dd3408c90eb7d285a2e8043131fab3a7e58fa
2014-06-12 14:49:41 -07:00
Prashant Malani 2c9b11f029 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>
2014-06-05 16:35:52 -07:00
Dan Stoza 3d5c8a98c1 Merge "SurfaceFlinger: Add sourceCrop to screenshot" 2014-05-28 18:31:40 +00:00
Aravind Akella d9441e4c27 Surface maxDelay and isWakeUpSensor flag in Sensor.java.
Change-Id: Idd1e9045190beeca87b086b272e8cbf0bed05bae
2014-05-23 18:58:01 -07:00
Dan Stoza c18790018b 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
2014-05-23 09:19:03 -07:00
Dan Stoza 7f7da32569 Enable changing display configuration
This allows querying and switching display device configurations
through the ISurfaceComposer/SurfaceComposerClient interface.

Bug: 14320401
Change-Id: I8c22165698950e5da32204c1c4da92122f91a715
2014-05-05 16:45:26 -07:00
Aravind Akella 943de2f71b Merge "Enable wakeup sensors." 2014-04-24 00:41:08 +00:00
Aravind Akella 9a844cf78f 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
2014-04-23 14:38:56 -07:00
Dan Stoza e0d5862ad8 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
2014-04-22 14:12:55 -07:00
Dan Stoza fb39827ebc Merge "BufferQueue: Increase max slots from 32 to 64" 2014-04-21 16:11:22 +00:00
Dan Stoza febd4f4f46 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
2014-04-18 11:40:14 -07:00
Dan Stoza 99b18b447d 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
2014-04-15 10:34:10 -07:00
Dan Stoza d9822a3843 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
2014-04-15 10:27:25 -07:00
Aravind Akella 93b84e39e6 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
2014-04-11 19:40:33 +00:00
Aravind Akella ef89f7638c 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
2014-04-11 19:34:53 +00:00
Dan Stoza fd34b65f71 Merge "BufferQueue: Add producer buffer-released callback" 2014-04-11 17:57:12 +00:00
Aravind Akella 700180487f Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
This reverts commit 4369a4ebd5.

Change-Id: Ifa8619cc6873470a07a987763d818d78d4232610
2014-04-11 00:06:06 +00:00
Svetoslav cf8684b206 Merge "Adding render stats APIs to UiAutomation (framework native)." 2014-04-10 19:32:44 +00:00
Svetoslav d85084b2b6 Adding render stats APIs to UiAutomation (framework native).
bug:12927198

Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
2014-04-10 12:32:19 -07:00
Dan Stoza b3d0bdf0db 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
2014-04-07 17:00:26 -07:00
Etienne Le Grand 75b332037f 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"
2014-04-05 09:06:00 +00:00
Etienne Le Grand 30d6fd6b28 Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"
This reverts commit c57a019e11.

Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2
(cherry picked from commit 4369a4ebd5)
2014-04-05 06:13:41 +00:00
Etienne Le Grand 4369a4ebd5 Revert "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors"
This reverts commit c57a019e11.

Change-Id: I3540565bc3e56a32cf3b176a29216cf68bb763b2
2014-04-05 05:02:22 +00:00
Etienne Le Grand 33458f72e1 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
2014-04-05 03:53:51 +00:00
Etienne Le Grand 00f4dde1aa 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
2014-04-05 01:52:28 +00:00
Etienne Le Grand c57a019e11 Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors
Change-Id: If0f3dbdb5d2e9378e1fed4614baee4e750d0c850
2014-04-04 16:31:09 -07:00
Greg Hackmann 786e26a886 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
2014-04-04 01:53:51 +00:00
Dan Stoza f0eaf25e92 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
2014-03-31 14:10:07 -07:00
Fengwei Yin 0c7c81f5a6 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>
2014-03-20 16:49:06 +08:00
Dan Stoza 75555b2eaf Merge "BufferItemConsumer: Use IGBC instead of BQ" 2014-03-18 17:55:06 +00:00
Dan Stoza 14226716f2 Merge "Remove deprecated BufferQueue constructor" 2014-03-18 16:56:15 +00:00
Wonsik Kim 8bf3b1a496 Merge "Revert "Implement video plane layer"" 2014-03-18 01:00:44 +00:00
Wonsik Kim 29fa9590ad Revert "Implement video plane layer"
This reverts commit f837c93a1b.

Change-Id: I6a1aa9ad0aca023267dc53d19c950b1535123ca7
2014-03-17 11:17:28 +00:00
Jesse Hall 73ed82f809 Merge "Add sideband streams to BufferQueue and related classes" 2014-03-13 20:28:17 +00:00
Dan Stoza 6d5a7bb970 Remove deprecated BufferQueue constructor
Bug: 13415624
Change-Id: I52f58a4d22296d9fc3cdbd4ad53eb10a785db3ce
2014-03-13 11:39:09 -07:00
Dan Stoza fe50d2a0a1 BufferItemConsumer: Use IGBC instead of BQ
Change-Id: Id1756ac62954ba412f2c23c5fa6e5d760c299347
2014-03-13 11:12:04 -07:00
Dan Stoza f522af7eb6 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
2014-03-12 10:17:20 -07:00
Jesse Hall 399184a4cd 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
2014-03-11 12:23:14 -07:00
Dan Stoza 9f3053de78 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
2014-03-10 16:45:38 -07:00
Dan Stoza 3e96f1982f 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
2014-03-04 15:58:03 -08:00
Dan Stoza 289ade165e Split BufferQueue into core + producer + consumer
Change-Id: Idc39f1e511d68ce4f02202d35425a419bc0bcd92
2014-03-04 09:33:14 -08:00
Wonsik Kim f837c93a1b Implement video plane layer
Binding with video source will follow.

Change-Id: Ic14e9757f5b61f4055cbeda47c1bafae0a621abb
2014-02-27 00:08:22 +00:00
Dan Stoza c701401f8c 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
2014-02-14 23:10:42 +00:00
Igor Murashkin 7ea777f097 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
2013-11-21 14:06:13 -08:00
Igor Murashkin 4be18a3566 gui: Remove BufferQueue::MIN_UNDEQUEUED_BUFFERS
Change-Id: I7c0cc36046dbbdb9c0e85acfe5027293d1131275
2013-11-18 12:36:15 -08:00
Igor Murashkin 7d2d160cdc gui: Update header docs for IGraphicBufferConsumer/Producer/BufferQueue
Also fix compiler warnings for libgui

Change-Id: I0ee38d9ad5eaa82d55bf812d291da8c433581cef
2013-11-13 17:34:03 -08:00
Aravind Akella 701166d9f6 Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection.
Change-Id: I4ef2bec80406c517903ab9782dc9eaf3fa8b7f36
2013-10-09 17:26:01 -07:00
Jamie Gennis dbe9245e2e 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
2013-10-02 17:34:35 +00:00
Eino-Ville Talvala d171da973d GLConsumer: Add query for current frame number.
Surface the underlying frame number of the current texture.

Bug: 10830400
Change-Id: Ide3a7da12ea0aac54588beb6bf00dbfe2cd37653
2013-09-19 13:36:07 -07:00
Mathias Agopian c1c05de415 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
2013-09-17 23:45:22 -07:00
Mathias Agopian 365857df8b Make sure do disconnect from a BQ when its client dies.
Bug: 5679534

Change-Id: If447e8673df83fe0b1d6210641e0a48522501a53
2013-09-16 16:15:21 -07:00
Mathias Agopian 90ed3e8d78 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
2013-09-10 21:10:53 -07:00
Aravind Akella 724d91d778 Sensor batching. Changes to the native code.
Bug: 10109508
Change-Id: I7333f3aac76125a8226a4c99c901fb904588df04
2013-09-03 17:04:36 -07:00
Andy McFadden 3c25621ad7 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
2013-08-16 15:15:16 -07:00
Igor Murashkin a5b7513711 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
2013-08-14 20:17:17 -07:00
Mathias Agopian 3f84483382 SurfaceFlinger now uses GLES 2.x when available
Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
2013-08-13 16:07:45 -07:00
Mathias Agopian 45155969dc make sure GLConsumer::releaseTexImage() works after detachFromContext()
Change-Id: I27e0bc57e927d47b2b98113ee37b5396bcc72019
2013-08-12 23:45:28 -07:00
Mathias Agopian 9870c9b66c 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
2013-08-08 17:46:48 -07:00
Jesse Hall 6c913be9ca Add ISurfaceComposer::destroyDisplay
Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
2013-08-08 13:12:29 -07:00
Mathias Agopian 3ca76f416b remove support for glReadPixels screenshot path
this was only needed on some chipset we're not
supporting in KLP.

Change-Id: I2e8fc07f135030bd61d2e241a8e426f1a4316425
2013-08-06 16:07:33 -07:00
Mathias Agopian db89edc94b 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
2013-08-06 20:05:36 +00:00
Mathias Agopian a4e19521ac 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
2013-08-01 17:20:08 -07:00
Mathias Agopian e142428a9c 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
2013-07-30 21:19:13 -07:00
Mathias Agopian ad678e18b6 single buffer mode for BufferQueue
Bug: 9891035
Change-Id: Id1ab5f911a6dc4c1d8235e65775b3d3635231ad4
2013-07-26 18:45:02 -07:00
Mathias Agopian 7cdd786fa8 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
2013-07-19 17:38:01 -07:00
Mathias Agopian a3fbda3cef 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
2013-07-18 22:28:18 -07:00
Mathias Agopian 595264f1af 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
2013-07-18 22:28:18 -07:00
Mathias Agopian 8f938a5338 always pass the BufferQueue explicitely to consumers
Change-Id: I883b0a7b19d8e722f9ab714ba6f49e658b02ca86
2013-07-12 22:06:26 -07:00
Andy McFadden 1585c4d9fb 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
2013-07-10 15:38:40 -07:00
Zhijun He b4b63704c0 CpuConsumer: Add set buffer size and format functions.
Add setDefaultBufferSize() and setDefaultBufferFormat(). ImageReader JNI need
them.

Bug: 9254294
Change-Id: I7d2464d43b0ca73fbb834ed22cecbfbb30eef60c
2013-06-10 13:34:01 -07:00
Zhijun He ae772278fe CpuConsumer: Remove CpuConsumer JNI ID.
Not used anywhere, and it is pretty confusing to have it here.

Bug: 9254294
Change-Id: I12b761532918b546a0f56c74ccf81b2c119ccd66
2013-06-03 10:42:05 -07:00
Lajos Molnar 9e3cb55b8f 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
2013-05-23 22:21:13 +00:00
Lajos Molnar c5d7b7d323 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
2013-05-23 22:17:54 +00:00
Eino-Ville Talvala d487ca1ab3 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
2013-05-09 10:19:01 -07:00
Eino-Ville Talvala c43946b931 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
2013-05-06 17:24:05 -07:00
Mathias Agopian bdcf1fe2ba Merge changes I0d9f18d1,Ib96c9161
* changes:
  Add a --color option to dumpsys SurfaceFlinger
  clean-up/simplify all dump() APIs
2013-04-24 10:25:34 +00:00
Mathias Agopian 74d211ae26 clean-up/simplify all dump() APIs
remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
2013-04-22 21:51:28 +02:00
Mathias Agopian e692ab9a6b fix uninitialized variables in GLConsumer
mDefaultWidth, mDefaultHeight and mCurrentScallingMode are now
initialized to the same default value that BufferQueue uses.

Change-Id: I0d4da2022b06419d12745716d8ddbd48c8869953
2013-04-22 11:24:02 +02:00
Igor Murashkin 187edf93c6 Merge "BufferItemConsumer: add functions to set default buffer format/size" into jb-mr2-dev 2013-04-17 19:39:53 +00:00
Igor Murashkin 87d1e3427b BufferItemConsumer: add functions to set default buffer format/size
Bug: 8629088
Change-Id: I06f2e26a70d6dbcfcd70b08b4461e8e401f6e83f
2013-04-16 11:24:40 -07:00
Andy McFadden 53dc9044bf Merge "Updated comments" into jb-mr2-dev 2013-04-11 17:15:52 +00:00
Jamie Gennis ad669b04f4 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
2013-04-08 14:42:22 -07:00
Andy McFadden 753e3415cd Updated comments
Updated many comments.  Added one minor error check.

Change-Id: Ib935dd99d417bada91d2e198008a50dd94269316
2013-04-05 10:44:23 -07:00
Mathias Agopian ca08833d5e 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
2013-03-29 15:33:47 -07:00
Mathias Agopian 8000d0694b make sure to unlock the screenshot's buffer on destruction
this fixes a memory leak on various devices

Bug: 8475134
Change-Id: I25924674c803a0cb22371a95c60664c36acb0340
2013-03-26 18:15:35 -07:00
Jesse Hall 13f01cbdbd Pass sp<Fence>s around instead of file descriptors
Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
2013-03-22 09:56:58 -07:00
Eino-Ville Talvala aaebffd52f Merge "CpuConsumer: Properly track acquired buffers" into jb-mr2-dev 2013-03-21 16:39:14 +00:00
Ramanan Rajeswaran ac006439bb Merge "Revert "Revert "Change SurfaceControl setPosition to take floats""" into jb-mr2-dev 2013-03-21 15:52:49 +00:00
Ramanan Rajeswaran d6480c020b Revert "Revert "Change SurfaceControl setPosition to take floats""
This reverts commit bbb57f3331

Change-Id: Ib8f039f530d6b8175b5205c6c0008b135d4001a2
2013-03-21 15:49:59 +00:00
Mathias Agopian abe815dd69 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
2013-03-19 22:22:21 -07:00
Jesse Hall fae23b8757 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
2013-03-19 17:45:29 +00:00
Jesse Hall 4c00cc1114 Fix argument types in IGraphicBufferProducer methods
Bug: 8384764
Change-Id: I7a3f1e1a0584a70af04f9eafef900505389d2202
2013-03-18 14:16:02 -07:00
Jesse Hall 7adb0f8a9f 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
2013-03-18 14:16:02 -07:00
Mathias Agopian 041a075262 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
2013-03-15 18:39:16 -07:00
Mathias Agopian 35ffa6a868 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
2013-03-12 18:45:09 -07:00
Mathias Agopian 4d9b822e2c 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
2013-03-12 17:11:48 -07:00
Mathias Agopian 089a15298e Remove support for ScreenshotLayer
Change-Id: I5b571a4cf3faa77d2c4aca916fa4bd00a1065bb9
2013-03-05 19:52:29 -08:00
Eino-Ville Talvala 042ecee2ab 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
2013-03-05 15:25:06 -08:00
Mathias Agopian 306f18c5fb Merge "rework screenshot API and implementation" into jb-mr2-dev 2013-03-05 02:30:13 +00:00
Mathias Agopian 2a9fc493df 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
2013-03-01 22:53:39 -08:00
Dave Burke bbb57f3331 Revert "Change SurfaceControl setPosition to take floats"
Temporary, to fix weekend build, until we get Nvidia code drop.

This reverts commit 9a867a8798

DO NOT MERGE

Change-Id: I7b5dbc4db46ef3d97dc8598057d5487d6971178b
2013-03-01 16:06:48 -08:00
Eino-Ville Talvala eb0d12963d CpuConsumer: Add optional asynchronous mode
Bug: 8290146
Bug: 8291751

Change-Id: I9c8ac4bff38b0411e987a204e540d018dba6d0b4
2013-02-28 15:51:24 -08:00
Eino-Ville Talvala 64d8b1903e CpuConsumer: Don't unlock buffers on producer disconnect
Bug: 8291751

Change-Id: I062a3d34b41183d07fb6b9109cdb6bf0c0c75672
2013-02-28 14:20:28 -08:00
Michael Wright 9a867a8798 Change SurfaceControl setPosition to take floats
Bug: 8153162
Change-Id: If3c4b7a3e124ace25999eb9a569dc9a806a1fbc2
2013-02-21 22:42:07 -08:00
Mathias Agopian cf0b8c85fb get rid of Surface::getISurfaceTexture()
this was there just for legacy reasons.

Change-Id: I0a48d6e04d7efa65033f9f10c91bba557f16ae8b
2013-02-19 18:24:40 -08:00
Mathias Agopian c4905eb49d fix build: SurfaceTextureClient to Surface rename
Change-Id: I0041e6f49bc637bc52161c83f0bd44101246f480
2013-02-15 16:34:04 -08:00
Mathias Agopian f25c5086cf fix build: SurfaceTextureClient to Surface rename
Change-Id: I54d68241f1080eef640aefe71f33912ad79345ef
2013-02-15 14:59:09 -08:00
Mathias Agopian e3c697fb92 Refactoring: Rename SurfaceTextureClient to Surface
Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
2013-02-14 19:19:05 -08:00
Mathias Agopian 6d9b9dfd55 remove access ANDROID_VIEW_SURFACE_JNI_ID
Change-Id: I0ef474ed9be2cd26fa520ef871ffcf21a25e4994
2013-02-13 15:27:08 -08:00
Mathias Agopian ac9fa427d4 get rid of Surface identity and token
we use the IBinder instead.

Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
2013-02-13 15:27:08 -08:00
Andy McFadden 882e3a39ed Add some comments.
Also, minor tweak to SurfaceTextureLayer.

Change-Id: If616d5ee4e8226dd0e16c5dbb0e0f80db553110e
2013-01-11 10:16:10 -08:00
Andy McFadden 466a192d20 Minor tweaks.
Change-Id: I9f82f574112141b6aa074c42303056cd52d5c478
2013-01-08 11:25:51 -08:00
Andy McFadden 2adaf04fab 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
2012-12-18 13:10:48 -08:00
Andy McFadden 0273adbf0b 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
2012-12-17 12:40:50 -08:00
Jamie Gennis 3c1ada9822 Merge "SurfaceTextureClient: remove a deprecated ctor" 2012-12-12 12:16:21 -08:00
Jamie Gennis 4def860030 SurfaceTextureClient: remove a deprecated ctor
Change-Id: Ibf2746fdca26851677cd90199c60eab80f6d0c73
2012-12-12 12:13:54 -08:00
Jamie Gennis c6f04666c2 Merge "SurfaceFlinger: Move GraphicBufferAlloc to libgui" 2012-12-12 10:56:42 -08:00
Jamie Gennis 392edd88cb SurfaceFlinger: Move GraphicBufferAlloc to libgui
This change moves the GraphicBufferAlloc class from SurfaceFlinger to libgui.

Change-Id: Idf31d2004efa2651b60590733f73c4a7b831e8a9
2012-12-11 17:54:29 -08:00
Andy McFadden 97eba8904c 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
2012-12-11 16:26:51 -08:00
Andy McFadden bf974abe92 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
2012-12-11 09:42:51 -08:00
Igor Murashkin a4a3149a36 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
2012-11-05 13:39:02 -08:00
Jamie Gennis dd3cb84cfb 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
2012-10-22 13:41:21 -07:00
Jamie Gennis 2d5e230292 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
2012-10-15 19:09:04 -07:00
Jeff Brown 2a09bb3219 Add blankDisplay/unblankDisplay to SurfaceComposerClient.
Bug: 7309812
Change-Id: Ia401d642094a46c62f0d26c65da1d11341e203a1
2012-10-08 19:13:57 -07:00
Jesse Hall 9504eb915c 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
2012-10-05 14:40:50 -07:00
Andy McFadden c01a79d77b 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
2012-09-28 13:04:16 -07:00
Iliyan Malchev 38b657265c Revert "Compatibility work around for bad graphics driver dependency."
This reverts commit a50b51c03a

Change-Id: Ibdcd776a7f241dbb2475403ea04f939249774c41
2012-09-27 15:52:12 -07:00
Andy McFadden 4803b74e2a 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
2012-09-25 11:31:46 -07:00
Mathias Agopian e96e9e1093 fix a crasher in SurfaceTexture's setFilteringEnabled
bug: 7211067
Change-Id: Id8658a8df429d76c20ab9112858b38e52343dc9c
2012-09-24 19:26:11 -07:00
Mathias Agopian ff28e201ec Display events now always carry the display id they happened on
Change-Id: I12de1d883c23927722bc3a71b782f0079de4e831
2012-09-21 14:20:35 -07:00
Mathias Agopian 148994e5f3 We now report hotplug events to the framework
Change-Id: I2d6b7787d39e5929485a551e4982498c5053c211
2012-09-20 17:13:58 -07:00
Jamie Gennis 3941cb240d 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
2012-09-18 10:59:40 -07:00
Andy McFadden 8dfa92fef9 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
2012-09-18 09:20:23 -07:00
Andy McFadden 6905205c8d 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
2012-09-16 11:39:09 -07:00
Jamie Gennis 61e04b92bd 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
2012-09-10 13:27:23 -07:00