Commit Graph

880 Commits

Author SHA1 Message Date
Jesse Hall 9f5a1b6abd Surface: cancel the dequeued buffer when requestBuffer fails
Partial fix for bug: 17477219
Change-Id: Ibf5a9e26e02c4be8854925a77a70f5c9c7dcf6f2
2014-10-02 18:16:19 +00:00
Dan Albert 56b3f887a2 am 6ee97e74: Merge "Fix a null dereference."
* commit '6ee97e74d2c972dec2aa6a2f231b718eae54898f':
  Fix a null dereference.
2014-09-23 17:54:39 +00:00
Dan Albert 265f0d9dff am 6ee97e74: Merge "Fix a null dereference."
* commit '6ee97e74d2c972dec2aa6a2f231b718eae54898f':
  Fix a null dereference.
2014-09-23 17:53:39 +00:00
Dan Albert c78a0c1733 Fix a null dereference.
Change-Id: I7224c3368ff414620062bc08b80a6a94d55d7931
2014-09-23 09:51:51 -07:00
Lajos Molnar 147372fdf9 resolved conflicts for merge of 67d8bd66 to lmp-mr1-dev-plus-aosp
Change-Id: I5e7e6fdf0d2afe6c3e4a0ed6ef96afb4713a72bc
2014-09-19 06:23:46 -07:00
Lajos Molnar 435d9cde27 resolved conflicts for merge of 67d8bd66 to lmp-dev-plus-aosp
Change-Id: I2e9aab90ac53bb32630598f50cc26f6e46acf6d6
2014-09-18 20:09:39 -07:00
Lajos Molnar 67d8bd66aa 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
2014-09-18 17:03:20 -07:00
Dan Albert 1474f8864f Don't check if this == NULL.
Entering a method with this == NULL is undefined behavior. Clang whines
about this.

Change-Id: Ibde628395ca10dfef0d2f59e81280576f104b83c
2014-09-16 17:52:06 -07:00
Dan Albert 4355c0c986 am e1e3d278: Merge "Clean cruft out of makefiles."
* commit 'e1e3d278549eb6389eb0b5fa3f13a4ac079a55a2':
  Clean cruft out of makefiles.
2014-09-12 16:22:03 +00:00
Aravind Akella 3d0daa57f5 am 8493b79e: SensorService fixes
* commit '8493b79e1cff92450076ca7450c4bf4e434a6816':
  SensorService fixes
2014-09-12 05:36:58 +00:00
Dan Albert b79dfe6721 Clean cruft out of makefiles.
Cleans up manual uses of stlport and bionic (and removes uses of private
bionic headers).

Change-Id: I157309d702e59152adfa3450939082248ae4c043
2014-09-11 18:49:47 -07:00
Aravind Akella 8493b79e1c 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
2014-09-10 18:24:18 -07:00
Riley Andrews 75ec33e0e6 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
2014-09-09 21:55:45 +00:00
Riley Andrews 129dc8423d am edb86f9f: Merge "Add rotation to surfaceflingers screen cap." into lmp-dev
* commit 'edb86f9f681e082a64a670814ee4d73ccf39942a':
  Add rotation to surfaceflingers screen cap.
2014-09-09 21:55:26 +00:00
Riley Andrews d15ef27f9b Update ScreenshotClient to take advantage of rotation in surfaceflinger's screencap api
Change-Id: I836649d9d5cd5958ce34e47f26f4a36d2d05d24c
2014-09-09 19:41:32 +00:00
Dan Albert 5273a97833 resolved conflicts for merge of 86aeb9ef to lmp-dev-plus-aosp
Change-Id: I82fe2b385156d9bdb9e7183e308d7b2a4167b6ce
2014-09-08 22:15:20 -07:00
Riley Andrews c3ebe66b49 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
2014-09-09 03:51:16 +00:00
Dan Albert 8b49125f10 Make string literal concatenation play nice with C++11.
In C++11 mode, "foo"MACRO_THAT_EXPANDS_TO_STRING gets lexed as a user
defined literal. Add space around the macro.

Change-Id: I2741f5be9c0b1562e0f413d1309ef9d687e89b41
2014-09-08 18:53:39 -07:00
Eric Penner 2d14a0ed4f 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
2014-08-27 03:10:58 +00:00
Riley Andrews d53e052322 Within CpuConsumer, use gralloc lockAsync/unlockAsync
Change-Id: I6b2cd195e111c3c7bf94c8052af4db92e09649a5
2014-08-19 19:46:10 +00:00
Rachad 7d1cd4aae2 Merge "Tunneled Video Playback support" into lmp-dev 2014-08-09 00:45:27 +00:00
Michael Lentine 45e2fc2226 Revert "Modify EGL to disconnect the window when the surface gets destroyed."
This reverts commit 843cbb241d.
2014-08-08 10:30:44 -07:00
Aravind Akella b37ba399c1 Sensor related changes for NDK.
i) ASensorManager_getDefaultSensor returns a wake-up/non wake-up sensor
      depending on the type.
   ii) Add ASensor_isWakeUpSensor and ASensorManager_getDefaultSensorEx
       methods.
Bug : 16399898
Change-Id: I1a86fb8d9de23039fdf41679d1487e1cd761a9d0
2014-08-05 17:17:51 -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
Aravind Akella 64ffcb0944 Sensor.cpp changes.
1) Rename TILT_DETECTOR
  2) Set mFlags correctly for wake-up sensors.
  2) Log errors for incorrect sensor flags.

Change-Id: Ia449217d3b8a53353ad6b5c33c544ce37eb1de4f
2014-07-31 09:40:03 -07:00
Michael Lentine 47e45405d1 Allow for resizing of Virtual Displays.
Modify SurfaceFlinger to use VirtualDisplaySurface in all cases when a virtual
display is used. Add functionality in VirtualDisplaySurface to resize the
buffers aquired in the QueueBufferOutput. Add transaction support in
SurfaceFlinger for resize. Add the modification of the size in DisplayDevice.

Change-Id: Iae7e3556dc06fd18d470adbbd76f7255f6e6dd6b
Tested: None
2014-07-30 14:36:25 -07:00
Michael Wright 1f6078aef7 Have VirtualDisplays send SF resize messages when resizing
Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
2014-07-30 11:23:44 -07:00
Michael Lentine cd36eb445b Merge "Modify EGL to disconnect the window when the surface gets destroyed." into lmp-dev 2014-07-25 21:16:23 +00:00
Michael Lentine 843cbb241d Modify EGL to disconnect the window when the surface gets destroyed.
Bug: 14445579

Change-Id: I1d263ff6cffcb6e448761fca7ca4b06466ad65aa
2014-07-29 18:59:56 -07:00
Aravind Akella fd8498c41e Remove WAKE_UP_* sensor constants.
Change-Id: I3de9d114ce82de4ed841932747d72e1f6f73c24f
2014-07-28 18:01:11 -07:00
Antoine Labour 11f14871db BufferQueueProducer: fix which slot gets pre-allocated
Commit 78014f32da introduced a bug that
made us pre-allocate buffers into the last available free slots instead
of the first available ones. This in turn caused more re-allocations,
and possibly triggered driver bugs.

Change-Id: Ic4a70e676b4f2bbb054bc873be62ced26e3099a0
2014-07-25 18:47:25 -07: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
Jeff Brown 31d825d7ed Add glance gesture for doze mode.
Change-Id: I038a706c3999200313ff5360c5ff1150ec081f08
2014-07-17 18:19:53 -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 7227b96a73 Merge "surfaceflinger: Replace blank/unblank with setPowerMode" 2014-06-12 03:30:50 +00:00
Mark Salyzyn 55fc54970b am 72676e7d: am 0e1313cd: Merge "libgui: 64-bit compile issues"
* commit '72676e7d0db89d477495245aa15f1a128b5c35bc':
  libgui: 64-bit compile issues
2014-06-11 17:44:52 +00:00
Mark Salyzyn 8f515ce1c5 libgui: 64 bit compile issues (part deux)
- nsecs_t printed with PRId64
- int64_t/uint64_t print issues
- some size_t printing issues.
- missing argument to BQ_LOGV

Change-Id: I493f2b578e801dc38c44f8c536faa45266720402
2014-06-09 15:42:26 -07:00
Mark Salyzyn 72676e7d0d am 0e1313cd: Merge "libgui: 64-bit compile issues"
* commit '0e1313cdb1d5d21e4d6123f77b4238f1c8c2d564':
  libgui: 64-bit compile issues
2014-06-09 21:46:25 +00:00
Mark Salyzyn 911004506d libgui: 64-bit compile issues
Change-Id: I29961c1567b8431518a7d032ea43385e23b7bb37
2014-06-09 14:27:45 -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
Narayan Kamath 403ec9f15a Fix flattening/unflattening of android::Sensor.
Write string lengths as uint32_t so that their width is
the same on 32 and 64 bit processes.

Note that this fixes another bug as a side effect; getFlattenedSize
was assuming that sizeof(uint32_t) == sizeof(size_t).

Change-Id: I7b6e3993e1f1ac45c14832ce59c59e0772855a2f
2014-05-30 14:40:13 +01: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
Aravind Akella d763fc7822 am 47d871b2: am d35e3af0: Set default values for FifoMaxEventCount and ReservedEventCount.
* commit '47d871b2795f714499a34ffe85b67f8577883f7b':
  Set default values for FifoMaxEventCount and ReservedEventCount.
2014-05-13 00:54:50 +00:00
Aravind Akella 47d871b279 am d35e3af0: Set default values for FifoMaxEventCount and ReservedEventCount.
* commit 'd35e3af04d4b7e850a3b87b2211d1a3993f9b76f':
  Set default values for FifoMaxEventCount and ReservedEventCount.
2014-05-13 00:50:40 +00:00
Aravind Akella d35e3af04d Set default values for FifoMaxEventCount and ReservedEventCount.
Change-Id: I4f610c2912ffe1697d1ffb99c556d1c88578466e
2014-05-12 17:15:59 -07:00
Etienne Le Grand f63cbbf0e4 Merge "Add wake gesture in Sensor.cpp" 2014-05-12 19:38:13 +00:00
Greg Hackmann f974bffb36 am 38c9e132: am c1ffd351: am bd20e551: Merge "Use asynchronous lock/unlock API"
* commit '38c9e1327a5b24267c3dab5293bc9d7ada6e9fc9':
  Use asynchronous lock/unlock API
2014-05-12 18:18:47 +00:00
Greg Hackmann 38c9e1327a am c1ffd351: am bd20e551: Merge "Use asynchronous lock/unlock API"
* commit 'c1ffd351bc44483369271c11dd4c6391bba8c64c':
  Use asynchronous lock/unlock API
2014-05-12 18:12:34 +00:00
Francis Hart 8f3960179c Use asynchronous lock/unlock API
The gralloc API now provides a way for using lock/unlock with the Android
explicit synchronisation concept. This changes updates the GraphicBuffer class
to also expose this functionality, and updates the Surface class to make use of
in line with the dequeueBuffer/queueBuffer mechanism.

This new behaviour is dependent on GRALLOC_MODULE_API_VERSION_0_3. If the local
gralloc module does not support this then the existing synchronous lock/unlock
mechanism will be used.

Change-Id: I8c3fd9592e0c5400ac9be84450f55a77cc0bbdc5
2014-05-12 09:13:03 -07:00
Greg Hackmann 2f3dca149a am 9493d492: am 9eb142e3: am a9d49f99: Merge "Revert "Use asynchronous lock/unlock API""
* commit '9493d4924a59f14b698389386337a9c07a7ea3c4':
  Revert "Use asynchronous lock/unlock API"
2014-05-09 22:00:04 +00:00
Greg Hackmann 02528cf6aa am 4b46776f: am 8a6cd189: am f60564a1: Merge "Use asynchronous lock/unlock API"
* commit '4b46776ff88c5a365700b88e8b2b04e1b2c77e6e':
  Use asynchronous lock/unlock API
2014-05-09 21:54:48 +00:00
Greg Hackmann 9493d4924a am 9eb142e3: am a9d49f99: Merge "Revert "Use asynchronous lock/unlock API""
* commit '9eb142e34a5bc11508c0bd6f60ad3933c60aa530':
  Revert "Use asynchronous lock/unlock API"
2014-05-09 21:51:51 +00:00
Greg Hackmann 53ec72523a Revert "Use asynchronous lock/unlock API"
This reverts commit 378ef07760.

Change-Id: I1de5ab973b5383633e75924fe90ac3ca8216c36a
2014-05-09 21:36:48 +00:00
Greg Hackmann 4b46776ff8 am 8a6cd189: am f60564a1: Merge "Use asynchronous lock/unlock API"
* commit '8a6cd189034ec4709a66e581b41deba56c028291':
  Use asynchronous lock/unlock API
2014-05-09 21:13:16 +00:00
Etienne Le Grand e284a90f50 Add wake gesture in Sensor.cpp
Change-Id: Ifb1744acffc2d57da43112fb9966261e8246d6de
2014-05-07 19:49:05 -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
Francis Hart 378ef07760 Use asynchronous lock/unlock API
The gralloc API now provides a way for using lock/unlock with the Android
explicit synchronisation concept. This changes updates the GraphicBuffer class
to also expose this functionality, and updates the Surface class to make use of
in line with the dequeueBuffer/queueBuffer mechanism.

This new behaviour is dependent on GRALLOC_MODULE_API_VERSION_0_3. If the local
gralloc module does not support this then the existing synchronous lock/unlock
mechanism will be used.

Change-Id: I77daa1beb197b63b1c2f281b8414ac4ae4b5b03c
2014-05-02 13:28:14 -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 4cbf3c5344 Merge "BufferQueue: Guard against unbounded queue growth" 2014-04-21 21:40:33 +00:00
Dan Stoza fb39827ebc Merge "BufferQueue: Increase max slots from 32 to 64" 2014-04-21 16:11:22 +00:00
Dan Stoza ae3c368233 BufferQueue: Guard against unbounded queue growth
Adds logic to dequeueBuffer that blocks if there are currently too
many buffers in the queue. This prevents unbounded growth around
times where the slots are cleared but the queue is not (e.g.,
during rapid connect/disconnect or setBufferCount activity). This
replaces the fix from ag/377958 in a more general way.

Bug: 11293214
Change-Id: Ieb7adfcd076ff7ffe3d4d369397b2c29cf5099c3
2014-04-18 15:50:43 -07:00
Dan Stoza 017a538516 Merge "libgui: Remove unnecessary casts in SurfaceControl" 2014-04-18 20:33:52 +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
Dan Stoza 7f605bd4c0 Merge "BufferQueue: Hook up IProducerListener" 2014-04-14 16:26:43 +00: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
Aravind Akella cf818ebbf0 Merge "Add stringType and requiredPermission to sensors, effectively adding permission checking for sensors" into klp-modular-dev 2014-04-11 19:32:28 +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
Dan Stoza 3b3ba78c3c libgui: Remove unnecessary casts in SurfaceControl
There are a number of places where we create a local
sp<SurfaceComposerClient>& to something that is already an
sp<SurfaceComposerClient>, which is redundant. This fixes that
by removing the local references.

Bug: 13814149
Change-Id: Ic558cbda651c344e5cac97022c97563928eed29c
2014-04-10 13:50:03 -07: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
Wonsik Kim 4cd47b2e0e Merge "Fix sideband stream issues" 2014-04-10 00:35:24 +00:00
Dan Stoza fb9bf8725d Merge "BufferQueue: Remove Bn version of create*" 2014-04-08 20:25:54 +00: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
Dan Stoza 5603a2fbbd Remove deprecated BufferQueue constructor
Bug: 13415624
Change-Id: I153b5470b21832cebe3c617d28a4ab9c9bf3b362
2014-04-07 13:41:37 -07:00
Andy McFadden fc9aeb8590 am 4215f434: am 6dbcebd0: Merge "Always release a buffer" into klp-modular-dev
* commit '4215f434187d518bf8c9807c9a18a7e0b617f7d2':
  Always release a buffer
2014-04-07 16:58:48 +00:00
Andy McFadden 4215f43418 am 6dbcebd0: Merge "Always release a buffer" into klp-modular-dev
* commit '6dbcebd0430e026fd5d99ba4b4f005bfaa9b8e2b':
  Always release a buffer
2014-04-07 16:52:13 +00:00
Wonsik Kim afe3081e0e Fix sideband stream issues
- Notify a listener when sideband stream is set
- Mark a layer as visible when sideband stream is set, even though
no buffer is queued.

Change-Id: I9652bf530f2b5ce331533ec1bb3b10a815ca191c
2014-04-07 15:59:22 +09: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
Andy McFadden 87a6784780 Always release a buffer
In GLConsumer's updateAndReleaseLocked(), we must release either
the previously-acquired buffer or the newly-acquired buffer.

Bug 13755224

Change-Id: I96adc255400ed008ba6e6ac1725ab3514c7cc8ba
2014-04-04 15:37:08 -07:00
Mark Salyzyn cece164b23 native gui: 64-bit compile issues
Change-Id: I45f605ff3759fb7ae9f0a6425d557d195f93281e
2014-04-04 10:15:54 -07:00
Wonsik Kim 9cfa49c954 Merge "Declare ownership of native_handle_t object" 2014-04-02 06:13:57 +00:00
Dan Stoza d1c1036555 BufferQueue: Hook up IProducerListener
Actually call the producer listener's callback during
IGraphicBufferConsumer::releaseBuffer

Change-Id: Idfa6bb08d62629cd3a198318e6c6fd6a731e73ef
2014-03-31 14:10:07 -07: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
Dan Stoza 2443c7903c BufferQueue: Set attached buffers as requested
When a buffer is attached to the producer side, it needs to be marked
as having been requested so that it can be queued successfully.

Change-Id: I90a88b332c415a57921bd094ae635afdf65bff99
2014-03-24 15:03:46 -07:00
Wonsik Kim 0ec54e156b Declare ownership of native_handle_t object
Change-Id: I4e21ff8ea76cfafce943dc059c8f72b42397980e
2014-03-24 15:44:05 +09:00
Dan Stoza 1a0b861790 BufferQueue: Test remote producer and consumer
Adds a test that puts the BufferQueue into its own process and
connects to it over remote binder interfaces. This exposed the fact
that while IGBC was technically binderized, it didn't actually work
when flattened, so this change also fixes that.

Change-Id: I728cdb662a4273ddd3440ed6040a12560313fe68
2014-03-21 11:16:54 -07:00
Wonsik Kim 8ce5c1cc8d Merge "Fill in sideband stream caveat" 2014-03-19 00:41:23 +00: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 0ee14ca23d Fill in sideband stream caveat
Change-Id: I20db8aea8f13acf31b42db08d90b338da8a5209c
2014-03-17 17:46:53 +09:00
Jesse Hall 49bfda1fbd Fix broken build for more tests
Change-Id: I7bdd12a833233724805d01d993541ee05caa9bf6
2014-03-13 15:09:17 -07: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
Andy McFadden c0c6a0cd4c Merge "FramebufferNativeWindow.h is obsolete" 2014-03-06 15:31:39 +00:00
Andy McFadden 2e336496c3 FramebufferNativeWindow.h is obsolete
This adds a deprecation #warning to the header.

Change-Id: Ia32f16e491cb01d435ec8846dda3d9a7d1a9cfc5
2014-03-05 15:42:53 -08:00
Dan Stoza c1ef3efecb Merge "Change BufferQueue into producer/consumer wrapper" 2014-03-05 18:55:13 +00: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
Igor Murashkin 8be494eb09 am 1738d4fc: am 462fb3a8: Merge "gui: Fix return code assert in CpuConsumer_test."
* commit '1738d4fca78b7678d09d5c8898e1f80fa63b4a6d':
  gui: Fix return code assert in CpuConsumer_test.
2014-03-04 22:35:04 +00:00
Igor Murashkin 1738d4fca7 am 462fb3a8: Merge "gui: Fix return code assert in CpuConsumer_test."
* commit '462fb3a8d597fffef3d5534544428d5cee9d8c16':
  gui: Fix return code assert in CpuConsumer_test.
2014-03-04 21:10:33 +00:00
Igor Murashkin 462fb3a8d5 Merge "gui: Fix return code assert in CpuConsumer_test." 2014-03-04 21:05:41 +00:00
Dan Stoza 4a07dc8d21 Merge "Split BufferQueue into core + producer + consumer" 2014-03-04 20:03:59 +00:00
Dan Stoza 289ade165e Split BufferQueue into core + producer + consumer
Change-Id: Idc39f1e511d68ce4f02202d35425a419bc0bcd92
2014-03-04 09:33:14 -08:00
Igor Murashkin 0f1889efe7 gui: Surface::dequeueBuffer no locker holds mutex while blocking in binder
- This also fixes a hang in the camera service when trying to shut down
  if the producer is infinitely blocked while trying to get a new buffer.

Bug: 13250382
Change-Id: I32ca82162bb8645b97dbe084e13e05ca05529a42
2014-03-03 11:42:27 -08:00
Dan Stoza fb83d84694 Merge "Fix calls to captureScreen" 2014-02-20 02:43:37 +00:00
Dan Stoza 8d7599633f Fix calls to captureScreen
Change-Id: Ic0ff47afa29f143131906082dff79d4e907b7143
2014-02-19 18:35:30 -08:00
Andy McFadden 44c35ec4a9 Allow "opaque" flag to be updated. DO NOT MERGE
Moves the "opaque layer" from Layer to Layer::State.  This allows
it to be updated as part of a transaction.

Bug 12387406

Change-Id: I0a114ce6adf77cd12fb08f96e0691b76c475768d
2014-02-18 15:55:42 -08: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
Andy McFadden d592f32df9 Merge "Allow "opaque" flag to be updated" 2014-01-30 21:42:02 +00:00
Andy McFadden 4125a4ffaf Allow "opaque" flag to be updated
Moves the "opaque layer" from Layer to Layer::State.  This allows
it to be updated as part of a transaction.

Bug 12387406

Change-Id: I0a114ce6adf77cd12fb08f96e0691b76c475768d
2014-01-29 17:36:49 -08:00
Dan Stoza b8072d84ba libgui: Fix segfault in SRGB tests
Make the test exit cleanly if the output buffer is never mapped.

Bug: 12761226
Change-Id: If789f02198851a17b11ee06f612f9ba7e06da754
2014-01-29 15:02:14 -08:00
Dan Stoza 6a5d35dd5c libgui: Add a test for SRGB surfaces
Add SRGBTest.RenderToSRGBSurface, which validates that passing the
SRGB colorspace attributes to eglCreateWindowSurface actually
results in an SRGB surface by comparing the output values to those
of a standard RGB surface.

Change-Id: I3d5fef8070ed8fa2357ddd1c5fcc849ae3fbd12a
2014-01-07 16:43:39 -08:00
Dan Stoza 3ed4e0b365 libgui: Add a test suite for SRGB testing
This is the start of an SRGB test suite. Currently it has a test for
SRGB texture reads in GLES3.

Change-Id: I553ee2691dc92b98cae7a003084d4e2823d40d95
2013-12-12 10:58:56 -08:00
Dan Stoza cb1fcdedaa libgui: Split SurfaceTexture tests into more files
Extract the many different test fixtures and suites in SurfaceTexture_test.cpp
into separate files. No real functional changes, just tweaking headers to keep
things building (and adding a few copyright headers I forgot last time).

Change-Id: Id801bd5d617f0cc61d22508fb9b71b41694bdecf
2013-12-09 09:52:02 -08:00
Alistair Strachan 8f76b6bedf gui: Fix return code assert in CpuConsumer_test.
The CpuConsumer error code was changed recently from INVALID_OPERATION to
NOT_ENOUGH_DATA, however the CpuConsumer_test was not updated. This change
fixes the return code checked by CpuConsumer_test so the test no longer
fails.

Change-Id: Ie548ddcb313fa34c130ac63355090cb44ac15ebf
2013-12-04 14:57:22 -08:00
Dan Stoza f3730fb8f7 libgui: Fix a couple of minor bugs, extract GLTest
Fix a couple of minor bugs in existing tests, and extract the GLTest class into
its own files.

Change-Id: I7d9570a0d3dbc9c5d7f9b13f2017607af42744b3
2013-11-26 15:48:53 -08: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
Andy McFadden 0012dbc3c6 am 251b11c2: am 85075869: Wait for buffers to drain
* commit '251b11c2045b2ae97f2ab270a65e11b4ca49b1b6':
  Wait for buffers to drain
2013-10-18 17:00:26 -07:00
Andy McFadden 251b11c204 am 85075869: Wait for buffers to drain
* commit '8507586903fa803abf535853a169913f2cf2e555':
  Wait for buffers to drain
2013-10-18 16:57:01 -07:00
Andy McFadden 8507586903 Wait for buffers to drain
When a BufferQueue producer disconnects and reconnects, we retain
the previously-queued buffers but empty the slots.  This allows
the number of queued buffers to grow without limit.  The low-memory
killer does not approve.

Bug 11069934

Change-Id: Ia2eaa954c7a3904b54209a3701dba01689e204d8
2013-10-18 23:10:16 +00:00
Aravind Akella 4a1e00fb3a am 1f1e5768: am 5d6aa951: Merge "Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection." into klp-dev
* commit '1f1e576840d5b36a091368abb6fe6610384b6449':
  Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection.
2013-10-10 19:26:34 -07:00
Aravind Akella 1f1e576840 am 5d6aa951: Merge "Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection." into klp-dev
* commit '5d6aa95129a13aae37a60b3e4246a0592dab396d':
  Change API from flush(handle) to flush(). Call flush on all active sensors in the given SensorEventConnection.
2013-10-10 19:21:05 -07: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 bd381c6164 am 6be1d210: am f0cf5f10: BufferQueue: fix a test crash
* commit '6be1d210eef392f5745d58a0033572b1af4b2f2a':
  BufferQueue: fix a test crash
2013-10-02 11:19:52 -07:00
Jamie Gennis 6be1d210ee am f0cf5f10: BufferQueue: fix a test crash
* commit 'f0cf5f103cf9c54d59de4ed6f1d8ddd2302dec1b':
  BufferQueue: fix a test crash
2013-10-02 11:16:59 -07:00
Jamie Gennis f0cf5f103c BufferQueue: fix a test crash
Bug: 10935880
Change-Id: If76e9fb055103bad0db7e6c16487532671573149
2013-10-02 18:02:28 +00:00
Jamie Gennis 4e8fd6f30d am 886b1521: am a9c47f32: Merge "GLConsumer: start using EGL_ANDROID_image_crop" into klp-dev
* commit '886b152111cc13dcfe1b47724f5e496f12ccc420':
  GLConsumer: start using EGL_ANDROID_image_crop
2013-10-02 10:44:44 -07:00
Jamie Gennis 886b152111 am a9c47f32: Merge "GLConsumer: start using EGL_ANDROID_image_crop" into klp-dev
* commit 'a9c47f327373cbe48e187442c7f9554d24a75c08':
  GLConsumer: start using EGL_ANDROID_image_crop
2013-10-02 10:41:58 -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 3473e814a4 am 1160e89d: am d171da97: GLConsumer: Add query for current frame number.
* commit '1160e89d31810f2ba66f8ab502281579115b39b0':
  GLConsumer: Add query for current frame number.
2013-09-20 11:19:41 -07:00
Christopher Ferris 6de9653ac8 Merge "Remove unnecessary include." 2013-09-19 23:16:10 +00:00
Christopher Ferris d142f4b787 Remove unnecessary include.
All these files are including utils/CallStack.h, but none of the code
uses any CallStack objects.

Change-Id: I38c3a346a3bd0ddbff368d0f7f8b3f3d78fc0432
2013-09-19 15:45:03 -07:00
Eino-Ville Talvala 1160e89d31 am d171da97: GLConsumer: Add query for current frame number.
* commit 'd171da973de3c6b30263011334fdcd916739144f':
  GLConsumer: Add query for current frame number.
2013-09-19 14:59:51 -07: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 0f0e845113 am a7e1660b: am c1c05de4: fix camera API 2.0 orientation
* commit 'a7e1660b257326f99261e7c9b2d58c9d2e68d0b0':
  fix camera API 2.0 orientation
2013-09-18 15:36:00 -07:00
Mathias Agopian a7e1660b25 am c1c05de4: fix camera API 2.0 orientation
* commit 'c1c05de415854eb7a13a16b7e22a22de8515123a':
  fix camera API 2.0 orientation
2013-09-18 15:33:38 -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 2285c008fa am e803e609: am 799f5126: Fix build (tests)
* commit 'e803e6095e007563df939326fdd3ca5109619a42':
  Fix build (tests)
2013-09-17 16:01:38 -07:00
Mathias Agopian e803e6095e am 799f5126: Fix build (tests)
* commit '799f51268006f319f6ae538dca670bfc7f522688':
  Fix build (tests)
2013-09-17 15:58:55 -07:00
Mathias Agopian 799f512680 Fix build (tests)
Change-Id: I5b233ef448e5e7eec3818c6586dfea138b28f7b6
2013-09-17 15:55:18 -07:00
Mathias Agopian 7229e98229 am 3f342c11: am 02b62df7: Merge "Make sure do disconnect from a BQ when its client dies." into klp-dev
* commit '3f342c113360eacc1e9c1ff481cb03f700a50117':
  Make sure do disconnect from a BQ when its client dies.
2013-09-17 14:35:29 -07:00
Mathias Agopian 3f342c1133 am 02b62df7: Merge "Make sure do disconnect from a BQ when its client dies." into klp-dev
* commit '02b62df7119b27c89d91d96938d8f4f5232b296b':
  Make sure do disconnect from a BQ when its client dies.
2013-09-17 14:33:09 -07:00
Mathias Agopian 02b62df711 Merge "Make sure do disconnect from a BQ when its client dies." into klp-dev 2013-09-17 21:31:14 +00:00
Jesse Hall cd9fd427ac am b8080d9a: am 2a36497e: Merge "Stop using default value for Surface producerControlledByApp parameter" into klp-dev
* commit 'b8080d9a3b760617c5dde7b1d2d63aa2bcecf3a7':
  Stop using default value for Surface producerControlledByApp parameter
2013-09-16 20:32:34 -07:00
Jesse Hall b8080d9a3b am 2a36497e: Merge "Stop using default value for Surface producerControlledByApp parameter" into klp-dev
* commit '2a36497e45d4d96e35fed89cfdcb09b71459ac3c':
  Stop using default value for Surface producerControlledByApp parameter
2013-09-16 20:30:11 -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
Jesse Hall 83cafffeac Stop using default value for Surface producerControlledByApp parameter
Bug: 10785749
Change-Id: Ifbf9340e5eabe621a69e990ec3e05ac51f8db66a
2013-09-16 15:39:55 -07:00
Kenny Root 06ef81bd70 resolved conflicts for merge of 1852eb4f to klp-dev-plus-aosp
Change-Id: I7217c0e859b384a042c02fe339e745996c6ef49e
2013-09-12 11:51:34 -07:00
Kenny Root c668871ac3 Use canonical UniquePtr.h file
Change-Id: Icc75bca078ffaf0c09b88ce5e897d666d1054063
2013-09-11 23:25:08 -07:00
Mathias Agopian 7c4f236532 am 90ed3e8d: fix a few problems with BitTube
* commit '90ed3e8d7883d9c80fb8bf11b1c593bd8b2b39d0':
  fix a few problems with BitTube
2013-09-11 15:06:10 -07:00
Kenny Root 0ae966033d Remove copy of UniquePtr.h
The UniquePtr.h file is no longer in libcore/... so there is no need to
have this extra copy of it anymore.

Change-Id: I4ec4f86d2844e524b50441c3a9100a50a6a45b1a
2013-09-11 14:29:20 -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 e29df8b929 am a5552de9: Merge "Sensor batching. Changes to the native code." into klp-dev
* commit 'a5552de96f0cff9fb1947d8d21556bfeccf9cd03':
  Sensor batching. Changes to the native code.
2013-09-03 17:43:44 -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
Jesse Hall 2d28c37269 am 87967c18: Merge "Force async behavior for the virtual display output BufferQueue" into klp-dev
* commit '87967c186995d1500875c495cba8f04f7cff76cc':
  Force async behavior for the virtual display output BufferQueue
2013-08-30 14:19:13 -07:00
Jesse Hall 8db92553e9 Force async behavior for the virtual display output BufferQueue
Bug: 10551087
Change-Id: I40bbb2b87d64420939a0ea309254f281437dab56
2013-08-29 16:09:11 -07:00
Eino-Ville Talvala 169636c62b am b6aea00c: Merge "Surface: Fix controlledByApp parameter" into klp-dev
* commit 'b6aea00c7843705fdc6d265d7e15b3df52e86009':
  Surface: Fix controlledByApp parameter
2013-08-22 12:26:51 -07:00
Eino-Ville Talvala 7895e90e29 Surface: Fix controlledByApp parameter
Bug: 10425641
Change-Id: I1a47e2ce4ecbdb8e67030a5d9ddf6604c5e2497d
2013-08-21 12:05:42 -07:00
Andy McFadden f94705f5fb am 8b308ed7: Fix build
* commit '8b308ed70ed782f68c8075aac2a6b66bbfcdb9af':
  Fix build
2013-08-19 09:51:16 -07:00
Andy McFadden 8b308ed70e Fix build
Neglected the "checkbuild"-built tests.

Change-Id: I202692f1a6d1e306c88e820c959d07d16e7c6a00
2013-08-19 08:56:07 -07:00
Andy McFadden 30290a557e am 90f59bf9: Merge "Re-enable frame dropping for non-auto timestamps" into klp-dev
* commit '90f59bf9eba79b27629505bc2709d84e7c811c8b':
  Re-enable frame dropping for non-auto timestamps
2013-08-19 07:29:11 -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 0ba1a16bbb am e60a0b1e: Merge "gui: CpuConsumer::lockNextBuffer change return code when too many bufs acquired" into klp-dev
* commit 'e60a0b1e6a29d79b4d0ec0374446cb829bcadee4':
  gui: CpuConsumer::lockNextBuffer change return code when too many bufs acquired
2013-08-16 14:07:10 -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 70986f0034 am c6bae007: Fix build. optional tests were broken.
* commit 'c6bae007e6e29b585fc1207f84b378a480006173':
  Fix build. optional tests were broken.
2013-08-14 16:33:04 -07:00
Mathias Agopian c6bae007e6 Fix build. optional tests were broken.
Change-Id: Iba9f5cb57f134559e1f9c55e293578d9f5d8cb96
2013-08-14 16:27:19 -07:00
Mathias Agopian b881700ab1 am 56f825e7: Merge "SurfaceFlinger now uses GLES 2.x when available" into klp-dev
* commit '56f825e7ab9f83706a74dcd4825c7bc839e49ae4':
  SurfaceFlinger now uses GLES 2.x when available
2013-08-14 15:45:21 -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
Jesse Hall 771ed8d71b am fc43e16a: Merge "Graphics:Add error check when create GraphicBuffer"
* commit 'fc43e16a5693bca0edfc82c650fb606971e47138':
  Graphics:Add error check when create GraphicBuffer
2013-08-13 12:06:31 -07:00
Lingyun Zhu 2aff702548 Graphics:Add error check when create GraphicBuffer
Change-Id: Ib0ca59bf1dfe4ae0266c29c91c1dbe3d02c0904e
Author: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 50141
2013-08-13 11:51:48 -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 45263e2475 don't hardcode debug texture dimensions
Change-Id: I356333801d246a8cafb3e977a77dc7325e8b822d
2013-08-07 13:35:20 -07:00
Mathias Agopian 5f51ed9499 fix tests more
Change-Id: I05c3dd6a22440844f8bd071f4c2b620b2bd8c720
2013-08-06 16:47:04 -07:00
Mathias Agopian 3dce3360e7 fix tests
Change-Id: I0f4d613481eda2c44a2d631a81d75de7e52e7a62
2013-08-06 16:42:05 -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 126b9c8e95 Fix build. 3rd attempt
Change-Id: I4317b34fd07890ea7cf9db51be42d72ef21aca89
2013-08-06 15:19:15 -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
Eino-Ville Talvala 687821c05b Merge "BufferQueue: Support query of consumer usage bits" 2013-08-05 21:10:45 +00:00
Andy McFadden d9ba9707b0 Merge "Roll back recent change" 2013-08-02 22:34:13 +00:00
Andy McFadden 4b49e08385 Roll back recent change
Disable dropping of frames based on timestamp.  Resume auto-
generating timestamps in Surface.

Bug 10151804

Change-Id: I15de26158e1d7ef22a5b150e685a126dc48ae2b4
2013-08-02 15:31:45 -07:00
Mathias Agopian c1c39f8807 Merge "Binderize the consumer side of BufferQueue" 2013-08-02 20:35:26 +00:00
Andy McFadden 86cd09d388 Merge "Drop frames based on presentation timestamp" 2013-08-02 16:53:11 +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
Andy McFadden 14fab7dd79 Drop frames based on presentation timestamp
If there are two or more buffers pending that are ready for
immediate presentation, drop all but the last one.

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

Change-Id: I187f42d33de227cd3411ff0dcd3b9ce1961457eb
2013-08-01 15:58:08 -07:00
Mathias Agopian ba93b3f8e4 log an error when dequeueBuffer gets a NULL Fence
Bug: 9858745
Change-Id: If35d6a7d770bf0a42d55bc55880a9ddb721fcfd0
2013-08-01 15:48:40 -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
Eino-Ville Talvala f7c6087bcc BufferQueue: Support query of consumer usage bits
Bug: 9592202
Change-Id: I61a17758200e61adaca695b426db3df0f6637d4c
2013-07-30 21:38:34 +00:00
Mathias Agopian ad678e18b6 single buffer mode for BufferQueue
Bug: 9891035
Change-Id: Id1ab5f911a6dc4c1d8235e65775b3d3635231ad4
2013-07-26 18:45:02 -07:00
Mathias Agopian bf5b849ec7 fix build
Change-Id: I04df8ec96510b16e84054089f7c02609d8fe2b0c
2013-07-26 17:26:16 -07:00
Mathias Agopian c2414bb098 get rid of HAL pixelformats 5551 and 4444
Change-Id: I39409103144c1ba09078c4ddc323a58987fb09ea
2013-07-26 15:43:33 -07:00
Mathias Agopian 9642dba110 Merge "Fix a race in BufferQueue" 2013-07-25 02:17:52 +00:00
Mathias Agopian 6bac363cbd Fix a race in BufferQueue
BufferQueue::dequeueBuffer() could incorrectly return
WOULD_BLOCK while in "cannot block" mode if it happened
while a consumer acquired the last allowed buffer
before releasing the old one (which is a valid thing
to do).

Change-Id: I318e5408871ba85e068ea9ef4dc9b578f1bb1043
2013-07-23 21:55:32 -07:00
Mathias Agopian 207c1e287c fix log messages and bogus error message
also assert when releasing a buffer and it has
been queued

Change-Id: I6f78d9ceb406ec85ff46c7b6d0c047b14063e3d0
2013-07-22 18:00:53 -07:00
Mathias Agopian 26a6f37cc0 make sure to reset the framenumber when a buffer is marked FREE
Change-Id: Ic45929f35553de209801f74e8006fb1bf0b25b45
2013-07-19 17:38:01 -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
Jean-Baptiste Queru b6a0ca7276 Tweaks for forward compatibility
Change-Id: Id6a96521b3fd5bd2a034fe89cfa4d3a179a66328
2013-07-16 09:38:03 -07:00
Ying Wang 6fda52bc7d always pass the BufferQueue explicitely to consumers
to fix tests build.

Change-Id: I70b9cf5b0d76df709e474181eeb7c42a54ecf43a
2013-07-15 22:20:35 -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
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
Mathias Agopian 2381033ad0 am e6eef6c1: am ea74d3b7: make the warning timout of Fence::waitForever() implicit and longer
* commit 'e6eef6c136b007f3a7e1e19884875b855c0c5f95':
  make the warning timout of Fence::waitForever() implicit and longer
2013-05-17 10:18:45 -07:00
Mathias Agopian ea74d3b78d make the warning timout of Fence::waitForever() implicit and longer
- timeout is now 3 seconds instead of 1
- simplifies the API a bit
- allows us to change/tweak this timeout globaly

Bug: 8988871

Change-Id: I8d3c6ec43a372f602fb3f29856710339f86c0ec9
2013-05-16 18:15:57 -07: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
Jamie Gennis 748b696c05 am 83ad8957: am 5b6ebd71: Merge "libgui_test: fix a couple minor test issues" into jb-mr2-dev
* commit '83ad89579e22228c1a48a2a488b86fc0d41057a6':
  libgui_test: fix a couple minor test issues
2013-04-25 13:50:38 -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
Jamie Gennis ea2d942dda libgui_test: fix a couple minor test issues
This change fixes how the MultiTextureConsumerTest.EGLImageTargetWorks checks
for pixels.  It removes the call to eglSwapBuffers so that the test does not
rely on EGL swap-preserve behavior, and it makes the test use checkPixel()
rather than doing glReadPixels itself.

Bug: 8349336
Change-Id: I0f446a0083eebd07af6fd208762878b4e367725a
2013-04-24 01:08:02 +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
Mathias Agopian f31510a2ac Add a test that checks multi-texturing works with GL_TEXTURE_EXTERNAL_OES
Bug: 8395618
Change-Id: I160d29699593b11058533ca753e275d5deeb3b54
2013-04-16 23:32:38 -07: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
Ying Wang c76e8a20e2 Merge "Add liblog" into jb-mr2-dev 2013-04-10 05:17:07 +00:00
Ying Wang 8a0cb4ee0b Add liblog
Bug: 8580410
Change-Id: I2ca4fa00dde0b574df3619134836bcb9315bd506
2013-04-09 21:55:39 -07:00
Jamie Gennis e6a0f5028b libgui_test: increase the tolerance for a YUV test
This change increases the pixel difference tolerance of the
SurfaceTextureGLTest.TexturingFromCpuFilledYV12BufferNpot test from 2 to 3.

Bug: 8349135
Change-Id: I82e361a689335f49065cacd8a3fc145d67b125f1
2013-04-08 14:42:22 -07:00