Commit Graph

880 Commits

Author SHA1 Message Date
Dan Stoza 6febf6c150 am 5d10894c: am ef47c080: am 958f5011: Merge "libgui: Allow an IGBProducer to disable allocation"
* commit '5d10894c9d547449cf231f02b736da9dfdebec11':
  libgui: Allow an IGBProducer to disable allocation
2015-04-24 16:33:38 +00:00
Dan Stoza 7536ef4f07 am 437fb850: am f96a7581: am fb6d43ff: Merge "libgui: Change BufferQueue to use free lists"
* commit '437fb850b0667be3e8655cb1ac6a8d491f59d045':
  libgui: Change BufferQueue to use free lists
2015-04-24 16:33:37 +00:00
Dan Stoza 958f501189 Merge "libgui: Allow an IGBProducer to disable allocation" 2015-04-24 15:50:10 +00:00
Dan Stoza fb6d43ff44 Merge "libgui: Change BufferQueue to use free lists" 2015-04-24 15:48:38 +00:00
Aravind Akella a9e6cc3870 Enable data injection mode in SensorService.
Change-Id: I0cd32a017235c31c54816e4a357ce3b988350ed6
2015-04-23 17:42:37 -07:00
Dan Stoza 8efa4fb370 am 65f68d5c: am fece8306: am 56f1f16c: Merge "libgui: Fix some bitrot/warnings in tests"
* commit '65f68d5cb4a758a8e6faac95817f70383748a9c0':
  libgui: Fix some bitrot/warnings in tests
2015-04-23 23:44:33 +00:00
Dan Stoza 1925bd9219 am 17df593e: am 9aae16a4: am 82e4d49b: Merge "libui/libgui: Fix errors in parceling"
* commit '17df593eb386940a26377d2db9fcb8a60e8badba':
  libui/libgui: Fix errors in parceling
2015-04-23 23:44:32 +00:00
Dan Stoza 56f1f16c7b Merge "libgui: Fix some bitrot/warnings in tests" 2015-04-23 22:56:37 +00:00
Dan Stoza 82e4d49b0e Merge "libui/libgui: Fix errors in parceling" 2015-04-23 22:51:01 +00:00
Dan Stoza 9de7293b0a libgui: Allow an IGBProducer to disable allocation
Adds a new method IGBP::allowAllocation, which controls whether
dequeueBuffer is permitted to allocate a new buffer. If allocation is
disallowed, dequeueBuffer will block or return an error as it
normally would (as controlled by *ControlledByApp).

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

Bug: 19801715
Change-Id: I0d604958b78b2fd775c2547690301423f9a52165
2015-04-23 15:28:12 -07:00
Dan Stoza 0de7ea7529 libgui: Change BufferQueue to use free lists
BufferQueue used to choose free buffers by scanning through its array
of slots and picking one based on timestamp. This changes that
mechanism to use a pair of free lists: one with buffers attached and
one without. This makes it easier to choose either type of free slot
depending on the needs of the current operation.

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

Bug: 13175420
Change-Id: I9b6e83cfe8f9b4329a976025cb8e291d51fb6d4a
2015-04-23 13:25:11 -07:00
Dan Stoza 83e9f6e75e am 41422980: am d2c12e4c: am 7637e35d: Merge "Revert "libgui: Change BufferQueue to use free lists""
* commit '41422980fabb087390791d951c28fef072d93be1':
  Revert "libgui: Change BufferQueue to use free lists"
2015-04-22 22:18:58 +00:00
Dan Stoza 7637e35d17 Merge "Revert "libgui: Change BufferQueue to use free lists"" 2015-04-22 18:59:02 +00:00
Dan Stoza 1fc9cc25a4 Revert "libgui: Change BufferQueue to use free lists"
This reverts commit 8dddc99010.

Change-Id: I0b0fed9f1394c6f6ae812f6c562ead4473a8226e
2015-04-22 18:57:39 +00:00
Dan Stoza 2bff43a912 am 3805a00d: am 91f16b1b: am e647ddde: Merge "libgui: Fix CPU rendering on Surface"
* commit '3805a00d6efef02535aaed96f412e0c55a9875f8':
  libgui: Fix CPU rendering on Surface
2015-04-22 00:47:35 +00:00
Dan Stoza c62acbd127 libgui: Fix CPU rendering on Surface
When the surface damage code went in, it incorrectly assumed that if
an application was doing CPU rendering, it would be using lock and
unlockAndPost instead of dequeue and queue, so it repurposed the dirty
region too aggressively. This change keeps it from clobbering the
dirty region if a CPU producer is attached.

Bug: 20431815
Change-Id: Id4dfd71378311ea822f0289f6de2d20a7bd84014
2015-04-21 16:56:52 -07:00
Dan Stoza 97ef903db1 am aadb236d: am 483c76dc: am ff5c1a6b: Merge "libgui: Change BufferQueue to use free lists"
* commit 'aadb236d2e944791c1e7600eae9439fcb8a6caa9':
  libgui: Change BufferQueue to use free lists
2015-04-20 20:59:55 +00:00
Dan Stoza f8cebe5457 libgui: Fix some bitrot/warnings in tests
These tests hadn't been run in a while and had accumulated some rot.
This fixes most of the compile warnings and some tests which fail
incorrectly, but 2 failures remain on N6.

Change-Id: I7fee78cd058a32f4d7df40ec9f899ff767f68517
2015-04-20 13:17:23 -07:00
Dan Stoza eea6d682b8 libui/libgui: Fix errors in parceling
BufferItem and GraphicBuffer were not parceling correctly, which had
not been noticed because the libgui tests (specifically, one that
tests placing a BufferQueue in a separate process from the IGBP/C)
had not been run recently. This change fixes the errors found in
those classes.

Change-Id: Ie224361a534a79115a3481d83ff97f21d154d4f5
2015-04-20 13:17:22 -07:00
Dan Stoza 8dddc99010 libgui: Change BufferQueue to use free lists
BufferQueue used to choose free buffers by scanning through its array
of slots and picking one based on timestamp. This changes that
mechanism to use a pair of free lists: one with buffers attached and
one without. This makes it easier to choose either type of free slot
depending on the needs of the current operation.

Bug: 13175420
Change-Id: Ic8398e7511bd11a60a1c82e3ad2ee271c9822be1
2015-04-17 09:28:41 -07:00
Dan Stoza 2992fcd0b2 am 057a561a: am 57a9f5a0: am fd5f41be: Merge "libgui: Pass surface damage through BufferQueue"
* commit '057a561afbf30ede99b5ec627deec7ee11701f6d':
  libgui: Pass surface damage through BufferQueue
2015-04-15 21:42:43 +00:00
Dan Stoza 5065a55291 libgui: Pass surface damage through BufferQueue
This change adds support for passing surface damage all of the way
down from the EGL interface through the consumer side of the
BufferQueue. Depends on system/core change
Ie645e6a52b37b5c1b3be19481e8348570d1aa62c

Bug: 11239309
Change-Id: I4457ea826e9ade4ec187f973851d855b7b93a31b
2015-04-15 13:19:38 -07:00
Dan Stoza 668285721b am 172ff24c: am 5977851b: am 00afb817: Merge "libgui: Plumb detachBuffer through ConsumerBase"
* commit '172ff24ccbc232cdf244a2bcbbb51df754929521':
  libgui: Plumb detachBuffer through ConsumerBase
2015-04-07 23:18:48 +00:00
Dan Stoza 634f5ee6a7 libgui: Plumb detachBuffer through ConsumerBase
Exposes IGraphicBufferConsumer::detachBuffer as a ConsumerBase
method. attachBuffer is not currently exposed, because all current
clients will be recycling buffers through the allocator.

Bug: 19628705
Change-Id: I3e519767fa43d5d880c1d5695e31b60f6ad588af
2015-04-07 15:05:40 -07:00
Dan Stoza 921d1d7a61 Revert "libgui: Plumb attach/detach through CpuConsumer"
This reverts commit 20c5672883.
2015-04-02 13:48:15 -07:00
Dan Stoza 231832eb27 DO NOT MERGE libgui: Plumb attach/detach through Surface
Exposes the attachBuffer and detachNextBuffer calls from
IGraphicBufferProducer to the public Surface interface. Also moves
the version of connect that takes a producer callback from protected
to public.

Bug: 19628705
Change-Id: I9ebc3013c4d9c84c4e8ef150c00e03f8af80319e
(cherry picked from commit c14ecb9de2)
2015-04-02 13:35:45 -07:00
Aravind Akella 4949c50372 Support restricted mode in SensorService.
In restricted mode, only CTS tests can register for sensors or call flush() on them. The requests
from other applications will be ignored.

Change-Id: Ieb923df3e0cfe3390fe2d052af776da79589744b
2015-03-24 15:41:35 -07:00
Dan Stoza 1c87e474d8 DO NOT MERGE libgui: Remove IGBC::BufferItem
Removes IGraphicBufferConsumer::BufferItem. Depends on the
following changes:
    I187b3a7d05196b6289596afac8fb9a9d4aebff76
    I0ddd38df37500cfd6b21d1e768ed14e39c5cd9fc

Cherry-pick of Id1fa56d092188f2cb712768d5d2fc6a9027fb73c

Change-Id: I3edf0db8fba656fd78e18a5a7f1137f0fb6b237d
2015-03-20 12:29:04 -07:00
Dan Stoza cf3834db10 DO NOT MERGE libgui: Prepare for IGBC::BufferItem removal
Currently, there are two instances of BufferItem: one inside of
IGraphicBufferConsumer, and a standalone one inside of libgui. They
only differ in the name of one of the fields, and we want to remove
the IGBC version. This changes things so that client code may be
incrementally switched over to the libgui version.

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

Change-Id: Ic4d51f5df6dbc70b376d13fceba2335b9bae4f3d
2015-03-19 13:58:07 -07:00
Eino-Ville Talvala 82c6bcc970 DO NOT MERGE Add dataSpace to buffer queues; remove old format enums.
- Wire up new dataSpace parameter through buffer queue stack
- Update tests to include the parameter
- Switch eglApi to using dataSpace to indicate sRGB gamma/linear
  difference
- Remove RAW_SENSOR in favor of RAW16
- Remove use of sRGB format enums
- Add default dataspace to buffer queue core
- Add query for default dataspace

Cherry pick of I070bd2e7c56506055c419004c29e2e3feac725df

Change-Id: I461952389c18051176c6b75e664f20ad369f5760
2015-03-19 13:56:00 -07:00
Dan Stoza ad36432de8 Merge "Surface: Permit an IProducerListener on connect" 2015-03-19 17:45:26 +00:00
Dan Stoza 744fc02fe8 libgui: Only allow one return from useFenceSync
An #ifdef was causing multiple returns in this function, which was
triggering an unreachable code error on some build targets. This
adds an #else to ensure that only one return is exposed in any given
build.

Cherry pick of I9ed7c3e769bc9094ad31d810944227d1d8302886

Change-Id: Ibddc5706159d168031d1805fcce3eedc068296cf
2015-03-19 10:32:51 -07:00
Dan Stoza 48245f0c6d Merge "libgui: Plumb attach/detach through Surface" 2015-03-19 16:48:30 +00:00
Dan Stoza 966b98bd86 Surface: Permit an IProducerListener on connect
This change allows clients of Surface to provide an IProducerListener
callback object to Surface::connect, which will be passed down to the
underlying IGraphicBufferProducer.

Cherry pick of I5ea5229bf3a329bf02c6bd20e7247039c75d136b

Change-Id: I6f8f52c72654e4cee649721383819bafe378f964
2015-03-18 16:01:20 -07:00
Dan Stoza 2632350ac8 GLConsumer: Fix unsigned subtraction during crop
Since some variables had been switched from signed to unsigned, there
was a section of code that was guaranteed to be incorrect because it
effectively did 'if (a < b) { c = a - b; }'. This change fixes it.

Cherry pick of I9cdd6c9a0179801addebb5d6dc1fbaddf8f53c62

Bug: 19346631
Change-Id: Id13a46f74c9ae7278463ce22b586f4dc21b5e453
2015-03-18 16:00:44 -07:00
Dan Stoza 3be1c6b60a libgui: Enable -Weverything and -Werror
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

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

Change-Id: Iaec610477ea0122317b0578fb74caf2383d4cf08
2015-03-18 15:57:27 -07:00
Dan Stoza 20c5672883 libgui: Plumb attach/detach through CpuConsumer
Adds CpuConsumer::{detachNextBuffer,attachAndReleaseBuffer}, which
can be used to more carefully manage the ownership of GraphicBuffers.

Bug: 19628705
Change-Id: Ia7a7e30da6d81eb2367241998f14988db0afc3bf
2015-03-17 19:37:15 -07:00
Dan Stoza 724768f916 Revert "libgui: Plumb attach/detach through CpuConsumer"
This reverts commit 43078e2827.

Change-Id: Ifef774d9922bb90450384e810e4767b56cc29de3
2015-03-17 15:54:50 +00:00
Dan Stoza c14ecb9de2 libgui: Plumb attach/detach through Surface
Exposes the attachBuffer and detachNextBuffer calls from
IGraphicBufferProducer to the public Surface interface. Also moves
the version of connect that takes a producer callback from protected
to public.

Bug: 19628705
Change-Id: I9ebc3013c4d9c84c4e8ef150c00e03f8af80319e
2015-03-16 13:02:01 -07:00
Dan Stoza 43078e2827 libgui: Plumb attach/detach through CpuConsumer
Adds CpuConsumer::{detachNextBuffer,attachAndReleaseBuffer}, which
can be used to more carefully manage the ownership of GraphicBuffers.

Bug: 19628705
Change-Id: Ia7aa1ac59c2f768f2d8a0f35ad23067936a7427c
2015-03-16 12:58:45 -07:00
Dan Stoza 54716317b5 libgui: Remove IGBC::BufferItem
Removes IGraphicBufferConsumer::BufferItem. Depends on the
following changes:
    I187b3a7d05196b6289596afac8fb9a9d4aebff76
    I0ddd38df37500cfd6b21d1e768ed14e39c5cd9fc

Change-Id: Id1fa56d092188f2cb712768d5d2fc6a9027fb73c
2015-03-16 10:11:40 -07:00
Dan Stoza 9cf51a7c86 libgui: Fix infinite recursion
One of the overloads of BufferQueueConsumer::acquireBuffer was
calling itself infinitely instead of calling the other overload.
This fixes that issue.

Bug: 19733425
Change-Id: Iac8425e1241774304a131da2fb9dec6e82922f13
2015-03-13 15:44:59 -07:00
Dan Stoza dd26416fe1 libgui: Prepare for IGBC::BufferItem removal
Switches some dependencies from IGraphicBufferConsumer::BufferItem to
android::BufferItem and adds some methods to facilitate incrementally
changing client code to do the same.

Change-Id: I699ed0a6837076867ca756b28d1ffb2238f7a0d9
2015-03-12 14:44:28 -07:00
Dan Stoza de7100ab23 libgui: Add a BufferItem overload to IGBC::acquire
Adds an overload of IGraphicBufferConsumer::acquireBuffer which takes
an android::BufferItem instead of an IGBC::BufferItem.

Change-Id: I9c3bc8037fa9438d4d9080b8afb694219ef2f71f
2015-03-11 16:38:47 -07:00
Dan Stoza 8757c016c8 libgui: Add BufferItem(IGBC::BufferItem)
Add a constructor for building a BufferItem from an
IGraphicBufferConsumer::BufferItem.

Change-Id: I1394e693314429ada93427889f10b7b01c948053
2015-03-11 15:37:12 -07:00
Eino-Ville Talvala 94d5ac4802 Merge "Add dataSpace to buffer queues; remove old format enums." 2015-03-06 22:13:07 +00:00
Dan Stoza d8bf6e0baf Merge "Surface: Permit an IProducerListener on connect" 2015-03-06 20:50:09 +00:00
Dan Stoza abf952c1b1 GLConsumer: Fix unsigned subtraction during crop
Since some variables had been switched from signed to unsigned, there
was a section of code that was guaranteed to be incorrect because it
effectively did 'if (a < b) { c = a - b; }'. This change fixes it.

Bug: 19346631
Change-Id: I9cdd6c9a0179801addebb5d6dc1fbaddf8f53c62
2015-03-04 14:58:02 -08:00
Eino-Ville Talvala 5b75a513e4 Add dataSpace to buffer queues; remove old format enums.
- Wire up new dataSpace parameter through buffer queue stack
- Update tests to include the parameter
- Switch eglApi to using dataSpace to indicate sRGB gamma/linear
  difference
- Remove RAW_SENSOR in favor of RAW16
- Remove use of sRGB format enums
- Add default dataspace to buffer queue core
- Add query for default dataspace

Change-Id: I070bd2e7c56506055c419004c29e2e3feac725df
2015-03-04 11:58:52 -08:00
Dan Stoza f8e3c6b6d8 Surface: Permit an IProducerListener on connect
This change allows clients of Surface to provide an IProducerListener
callback object to Surface::connect, which will be passed down to the
underlying IGraphicBufferProducer.

Change-Id: I5ea5229bf3a329bf02c6bd20e7247039c75d136b
2015-03-02 22:17:27 -08:00
Nick Vaccaro fc35dd8bc9 am 26cc3d0b: am b9bb1f13: Merge "Add support for SENSOR_TYPE_WRIST_TILT_GESTURE" into lmp-mr1-modular-dev
* commit '26cc3d0b67ff4daf31eaeed0ecd87b391978aadb':
  Add support for SENSOR_TYPE_WRIST_TILT_GESTURE
2015-02-11 20:12:12 +00:00
Nick Vaccaro 26cc3d0b67 am b9bb1f13: Merge "Add support for SENSOR_TYPE_WRIST_TILT_GESTURE" into lmp-mr1-modular-dev
* commit 'b9bb1f139bd1cbf3b3faa002b509f3f0a167e20b':
  Add support for SENSOR_TYPE_WRIST_TILT_GESTURE
2015-02-11 20:04:42 +00:00
Nick Vaccaro 9bb99b1570 Add support for SENSOR_TYPE_WRIST_TILT_GESTURE
Change-Id: I7e5516de805618df41de0f9b06805002e32708c3
2015-02-07 00:09:05 +00:00
Lajos Molnar b3ca72ce1e CpuConsumer: fix build error 2015-01-29 10:55:21 -08:00
Chad Jones bacce71e40 Merge commit 'ec41d55b8d018f349f7687cfe491651db600b51d' 2015-01-29 10:32:25 -08:00
Lajos Molnar ec41d55b8d am 94ee9b59: Merge "CpuConsumer: lock buffers that could be YUV as ycbcr" into lmp-mr1-dev
* commit '94ee9b5916903e6ee23bb1ce8f688900a4eb6f65':
  CpuConsumer: lock buffers that could be YUV as ycbcr
2015-01-29 08:41:35 +00:00
Lajos Molnar 6a26be7c2b CpuConsumer: lock buffers that could be YUV as ycbcr
Bug: 17906609
Change-Id: Ic71af69ec3b19ab1224ed3ad5e0a97c60e81cda6
2015-01-28 16:52:43 -08:00
Andreas Gampe a21b7a0686 am b93bca5d: am a59d7a6a: Merge "GUI: Remove unused variables"
* commit 'b93bca5d0831068cd599f905ba43dc8334095d65':
  GUI: Remove unused variables
2014-12-09 23:48:51 +00:00
Andreas Gampe b93bca5d08 am a59d7a6a: Merge "GUI: Remove unused variables"
* commit 'a59d7a6a66a2b8dcb2d00dbd6371fa89ae45ab04':
  GUI: Remove unused variables
2014-12-09 20:09:18 +00:00
Andreas Gampe 7398a5af38 GUI: Remove unused variables
For build-system CFLAGS clean-up, remove unused variables.

Bug: 18632512
Change-Id: I79fdcf830683d7278f4bf114cfb76a26da1b88ff
2014-12-08 20:42:40 -08:00
Dan Stoza dd883c0b08 libgui: Enable -Weverything and -Werror
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

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

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
2014-12-05 14:59:29 -08:00
Dan Stoza 00d504c06e libgui: Only allow one return from useFenceSync
An #ifdef was causing multiple returns in this function, which was
triggering an unreachable code error on some build targets. This
adds an #else to ensure that only one return is exposed in any given
build.

Change-Id: I9ed7c3e769bc9094ad31d810944227d1d8302886
2014-12-05 13:43:03 -08:00
Michael Lentine ae33effd43 Fix crash when user provides large values in the Parcel.
Bug: 18102648
Change-Id: Ie6a24718e586a34424238363de80f9545951514f
(cherry-picked from commit 8afa1c4ab8)
2014-12-05 20:31:09 +00:00
Dan Stoza d723bd7669 libgui: Enable -Weverything and -Werror
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
2014-12-05 11:06:44 -08:00
Dan Albert 7530114619 am 5588d900: Merge "Enable clang for libui/libgui/surfaceflinger"
* commit '5588d9000cd1ef217185c9001d6b5ecd84db9741':
  Enable clang for libui/libgui/surfaceflinger
2014-12-05 18:01:48 +00:00
Dan Stoza 01049c8321 Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
(cherry picked from commit f10c46ef85)
2014-12-04 17:56:17 -08:00
Marco Nelissen e12cfc23b2 am 55f71bc0: Merge "Replace IInterface::asBinder() with a static"
* commit '55f71bc0800b9ec7a779c5d30d5a90e074c2526b':
  Replace IInterface::asBinder() with a static
2014-11-17 18:52:56 +00:00
Marco Nelissen 097ca275f4 Replace IInterface::asBinder() with a static
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-17 08:47:01 -08:00
Marco Nelissen 2ea926bda2 Replace IInterface::asBinder() with a static
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-14 14:01:29 -08:00
Dan Stoza f10c46ef85 Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
2014-11-11 14:28:22 -08:00
Dan Stoza 8e624d4cad am 98d20f82: Merge "Add a BufferItem parameter to onFrameAvailable" into lmp-mr1-dev
* commit '98d20f82ca8979b30c81df9639f54ab11e1951f9':
  Add a BufferItem parameter to onFrameAvailable
2014-11-07 20:03:42 +00:00
Dan Stoza 98d20f82ca Merge "Add a BufferItem parameter to onFrameAvailable" into lmp-mr1-dev 2014-11-07 19:44:31 +00:00
Dan Stoza 8dc55396fc Add a BufferItem parameter to onFrameAvailable
Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents. Also
adds an onFrameReplaced callback, which is necessary if the consumer
wants to do anything more than simple queue length tracking.

Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
2014-11-07 10:39:13 -08:00
Dan Albert cad831fb15 am c6f93a43: Merge "Add missing include to fix libc++ build."
* commit 'c6f93a43d636b0ad16b75adf664c6a33d30b39dd':
  Add missing include to fix libc++ build.
2014-11-07 18:37:43 +00:00
Dan Albert 0d1c700214 Add missing include to fix libc++ build.
This was previously committed, but I guess it got lost in the merge
queue.

Bug: 15193147
Change-Id: Ic0e5d90ab403fb833d6a3bb7c55d279c56534869
2014-11-07 09:33:44 -08:00
Jesse Hall aa4ccfd123 am de288fe2: Revert "bufferqueue: workaround: allow NULL fence with queueBuffer"
* commit 'de288fe2d43adfa1b2243ae534faaf832bf50491':
  Revert "bufferqueue: workaround: allow NULL fence with queueBuffer"
2014-11-04 17:35:22 +00:00
Jesse Hall de288fe2d4 Revert "bufferqueue: workaround: allow NULL fence with queueBuffer"
Underlying bug has been fixed, workaround no longer needed

This reverts commit 5b0cbcf946.

Change-Id: Ic9532b407d1291a7780a12a75aaa117ae4aa9fcb
2014-11-04 08:47:37 -08:00
Michael Lentine 54430ca2a8 am 793fc0e1: Merge "Fix crash when user provides large values in the Parcel." into lmp-mr1-dev
* commit '793fc0e13d25bdecda1219999f8be2cb3c121d20':
  Fix crash when user provides large values in the Parcel.
2014-11-01 00:33:29 +00:00
Michael Lentine 8afa1c4ab8 Fix crash when user provides large values in the Parcel.
Bug: 18102648
Change-Id: Ie6a24718e586a34424238363de80f9545951514f
2014-10-31 16:08:44 -07:00
Jesse Hall f12f15502a am 1834f8ea: GLConsumer: correct EGL_NO_DISPLAY to EGL_NO_CONTEXT
* commit '1834f8ea975e9a882b44dc479320fe02e306e630':
  GLConsumer: correct EGL_NO_DISPLAY to EGL_NO_CONTEXT
2014-10-30 20:58:43 +00:00
Jesse Hall 1834f8ea97 GLConsumer: correct EGL_NO_DISPLAY to EGL_NO_CONTEXT
Change-Id: I4dcb57a0db9ee3c5222cd453c9213859384212b0
(cherry picked from commit 46a1f6b40e)
2014-10-29 17:15:09 +00:00
Michael Lentine 15b2ecf599 am dcc959be: Merge "Adding eglInitialize and eglTerminate image creation and deletion." into lmp-mr1-dev
* commit 'dcc959beb77099d319a94e3985da2f4ea4064e7b':
  Adding eglInitialize and eglTerminate image creation and deletion.
2014-10-21 18:35:24 +00:00
Michael Lentine dcc959beb7 Merge "Adding eglInitialize and eglTerminate image creation and deletion." into lmp-mr1-dev 2014-10-21 18:20:45 +00:00
Jesse Hall 937052fb1c am a069e853: am 649bafb7: Merge "bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)" into lmp-dev
* commit 'a069e8532ba272ac5b935e332e426a3dacf827fc':
  bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)
2014-10-20 14:31:38 +00:00
Jesse Hall a069e8532b am 649bafb7: Merge "bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)" into lmp-dev
* commit '649bafb7ba2c3204295bc3451ff7af7e28e714ed':
  bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)
2014-10-20 14:17:18 +00:00
Jesse Hall f35a5ba664 am 649bafb7: Merge "bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)" into lmp-dev
* commit '649bafb7ba2c3204295bc3451ff7af7e28e714ed':
  bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)
2014-10-20 14:13:05 +00:00
Jesse Hall 5b0cbcf946 bufferqueue: workaround: allow NULL fence with queueBuffer (DO NOT MERGE)
On one device there is a bug, not yet root-caused, that causes fence
fds to not make it across binder from producer to consumer in the
IGraphicBufferProducer::queueBuffer call. Rather than returning an
error, which the producer typically treats as a fatal error, this
change allows the buffer to be queued with no fence. This avoids an
application crash at the risk of (likely single-frame) visible
corruption.

Bug: 17946343
Change-Id: I9ca89f94098c455e1e90f5f58d5336c936b04a9c
2014-10-19 04:57:10 +00:00
Dan Albert 27b780b517 am 9cc84950: Merge "Don\'t check if this == NULL."
* commit '9cc849500df0bba42d3ed19b90c38ff1dffd2262':
  Don't check if this == NULL.
2014-10-15 22:52:51 +00:00
Dan Albert 759115cd6d am 9cc84950: Merge "Don\'t check if this == NULL."
* commit '9cc849500df0bba42d3ed19b90c38ff1dffd2262':
  Don't check if this == NULL.
2014-10-15 22:52:43 +00:00
Dan Albert 9cc849500d Merge "Don't check if this == NULL." 2014-10-15 22:45:07 +00:00
Michael Lentine 78be65e7bf Adding eglInitialize and eglTerminate image creation and deletion.
Previously it was possible to have the driver's eglTerminate called beofre
eglDestroyImageKHR in GLConsumer. This was because we didn't increment the
refcount for the lifetime of the image. This could lead to a crash or a deadlock
when multiple threads called terminate and destroy simultaneously.

Bug: 17700483
Change-Id: I7010d0f1b3db875332e95630b5e098a5564ba755
2014-10-09 10:26:37 -07:00
Jesse Hall 20fca75fbd am b7702c5c: Merge "BufferQueueProducer: Throttle EGL frame production." into lmp-mr1-dev
* commit 'b7702c5ce7f010fa5f19646fd79f28ff04e7014b':
  BufferQueueProducer: Throttle EGL frame production.
2014-10-08 16:59:38 +00:00
Jesse Hall b7702c5ce7 Merge "BufferQueueProducer: Throttle EGL frame production." into lmp-mr1-dev 2014-10-08 16:50:13 +00:00
Aravind Akella ae29ee0a9e am 93176114: am a7eb4b74: Merge "Fix sockfd leakage in SensorService." into lmp-dev
* commit '93176114cf34c9874c2db70fd7665e9f95dda9d0':
  Fix sockfd leakage in SensorService.
2014-10-03 22:39:19 +00:00
Eric Penner 99a0afbaee BufferQueueProducer: Throttle EGL frame production.
Throttling was previously controlled by a combination of the
driver and the number of buffers in the queue. This patch makes
a more consistent trade-off, which allows two GPU frames pending
but not three. More buffering could improve throughput in the
case of varying frame times, but this also increases latency.

Bug: 17502897
Change-Id: I4ee68019ca94c635294c5959931a555a6c4ef2df
2014-10-03 14:57:09 -07:00
Aravind Akella 021543fc65 am a7eb4b74: Merge "Fix sockfd leakage in SensorService." into lmp-dev
* commit 'a7eb4b74f74423dafd88adf94a7984ae927c3a23':
  Fix sockfd leakage in SensorService.
2014-10-03 21:50:52 +00:00
Aravind Akella a7eb4b74f7 Merge "Fix sockfd leakage in SensorService." into lmp-dev 2014-10-03 21:45:37 +00:00
Aravind Akella 8a96955c8e Fix sockfd leakage in SensorService.
i) Call removeFd() only if the fd in the BitTube has been
previously added to the Looper. Use a flag to determine whether the fd
has been previously added or not.
ii) Increment mPendingFlushEventsToSend after holding a connectionLock.
iii) Store the number of acks that are pending in SensorEventQueue
 and send them all at once.

Bug: 17472228
Change-Id: I1ec834fea1112a9cfbd9cddd2198438793698502
2014-10-02 18:59:56 -07:00
Jesse Hall 8619132f16 am 74efd6e6: am f05ef4e5: Merge "Surface: cancel the dequeued buffer when requestBuffer fails" into lmp-dev
* commit '74efd6e6bec8a49f66090a5c0c18b65ba8a6fcad':
  Surface: cancel the dequeued buffer when requestBuffer fails
2014-10-02 23:43:31 +00:00
Jesse Hall 0c2da9719b am f05ef4e5: Merge "Surface: cancel the dequeued buffer when requestBuffer fails" into lmp-dev
* commit 'f05ef4e542c3041379025e16497ff23710de5dbf':
  Surface: cancel the dequeued buffer when requestBuffer fails
2014-10-02 23:41:45 +00:00
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