Commit Graph

880 Commits

Author SHA1 Message Date
Naveen Leekha c1e6fbb52c Initialize local variables to avoid data leak
The uninitialized local variables pick up
whatever the memory content was there on stack.
This data gets sent to the remote process in
case of a failed transaction, which is a security
issue. Fixed.

(Manual merge of master change
 12ba0f57d028a9c8f4eb3afddc326b70677d1e0c )

For b/23696300

Change-Id: I665212d10da56f0803b5bb772d14c77e632ba2ab
2015-09-22 17:58:21 -07:00
Aravind Akella f9b7f8548e Set DATA_INJECTION mode flag for sensors.
Bug: 24001171
Change-Id: I70133546c68fb478b2c2062f05a4164a36cd9e4b
2015-09-11 11:33:49 -07:00
Prashant Malani e8293118b9 Add body sensors app op for custom sensors
If the custom sensor requires the BODY SENSOR permission, we should add
the body sensors app op for the custom sensor

Bug: 23396558
Change-Id: I132917d1bca12c76c8a9fb146e00951cba3e6d7a
2015-09-03 10:44:24 -07:00
Prashant Malani 13c638255f am e35c7d65: Add body sensors app op for custom sensors
* commit 'e35c7d65bb3c226fe3c5fc5e3933f64f0963eaeb':
  Add body sensors app op for custom sensors
2015-09-03 17:26:13 +00:00
Prashant Malani e35c7d65bb Add body sensors app op for custom sensors
If the custom sensor requires the BODY SENSOR permission, we should add
the body sensors app op for the custom sensor

Bug: 23396558
Change-Id: I132917d1bca12c76c8a9fb146e00951cba3e6d7a
2015-09-03 04:03:25 +00:00
Aravind Akella 8f35ca9730 SensorManager fixes.
i) Use pingBinder() to check the status of sensorservice everytime an
   event_queue is created. Retry to establish the binder connection if
   SensorService has recovered from a runtime restart.
ii) LOG_ALWAYS_FATAL_IF getService(SensorService) returns NULL or malloc
    returns NULL.

Bug: 22634472
Change-Id: I4e3912839b6f4114be1a124510878774dbd576a4
2015-08-25 11:24:02 -07:00
Aravind Akella e2806cb445 Bug fix in SensorManager.
If SensorService hasn't started when SensorManager instance is requested, keep retrying for a
longer duration.

Bug: 22529981
Change-Id: I3c506d962b61347085fc80b2c5832289539d6853
2015-07-30 19:05:21 +00:00
Narayan Kamath 8034fc63a0 Revert "Bug fix in SensorManager."
This reverts commit 869eb2089e.

Change-Id: I4fb865e3b18bbb011fa4e4b4732336930c3a45ae
2015-07-29 09:36:05 +00:00
Aravind Akella 869eb2089e Bug fix in SensorManager.
If SensorService hasn't started when SensorManager instance is requested, keep retrying for a
longer duration.

Bug: 22529981
Change-Id: I4ba6b760608e34d79273aeb39568f0fa72fbaf9d
2015-07-26 11:48:06 -07:00
Lajos Molnar 5f920c1a2c BufferQueueConsumer: signal onFrameReleased on dropped frames
Bug: 22552826
Change-Id: I9bdfeb8c68f403301af90d4b494f0ae7166a767c
2015-07-17 08:37:47 -07:00
Amith Dsouza bbd4f23247 Merge "Revert "Revert "Modify EGL to disconnect the window when the surface gets destroyed.""" into mnc-dev 2015-07-01 17:45:05 +00:00
Amith Dsouza 4f21a4cc22 Revert "Revert "Modify EGL to disconnect the window when the surface gets destroyed.""
This reverts commit 6e1a2fea67.

Driver level issues fixed by an updated graphics driver.

Bug: 21266976
Change-Id: I93339fb6c6bab988f3550adb49ef8e70cda6473e
2015-07-01 10:22:22 -07:00
Aravind Akella 841a5926fc Enable sensor data injection mode through adb.
Change-Id: I415cf8ff0871fa74babaf9b879c68f210298b472
2015-06-30 14:59:58 -07:00
Dan Stoza db4850c01f libgui: Fix handling of rotated surface damage
Incoming surface damage was not aware that the EGL implementation was
rotating buffers in response to SurfaceFlinger's transform hint. This
didn't affect all cases because the effect was to apply a 90 degree
rotation instead of a 270 degree rotation. For full-screen updates,
things more or less worked, but in other cases this caused corruption.

This fixes that by correctly undoing the effect of rotated buffers on
the incoming surface damage, and then passing that damage down
untouched to HWC.

Bug: 22068334
Change-Id: I226ecfc7a91fe2e16edd2aa6d9149f0d26b529d6
2015-06-25 16:10:18 -07:00
Dan Stoza 2311608667 libgui/SF: Propagate SECURE Layer flag changes
This allows changes to the SECURE flag to propagate down to
Layers in SurfaceFlinger so that WindowManager can change it on the fly
in response to device policy updates.

Bug: 20934462
Change-Id: I558f6d22c6273be373f1f480365e42536af18a33
2015-06-18 15:11:20 -07:00
Dan Stoza ec4cb38750 GLConsumer: Fix crop math
When we have excess pixels that need to be removed from (for example)
the left and right sides, we currently do something like:

  left += excess / 2;
  right -= excess / 2;

If excess is odd, however, this removes 1 too few pixels since the odd
pixel gets rounded down twice. This changes the math to effectively:

  left += excess / 2;
  right -= (excess - excess / 2);

Which removes the correct total number of pixels.

Bug: 19611086
Change-Id: I8d1ad9fe7ba67c149794c148663d12acbccccef0
2015-06-10 10:24:51 -07:00
Dan Stoza c6f30bdee1 libgui/SurfaceFlinger: Add getConsumerName
Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is update on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: I22c7881d778e495cf8276de7bbcd769e52429915
2015-06-08 09:40:49 -07:00
Dan Stoza a2ca9bf0a9 Revert "libgui: Add getConsumerName"
This reverts commit 107fbe5599.

Change-Id: I0c2b0f7c81193b05eb3dd2f5a59f83598434b744
2015-06-08 16:30:08 +00:00
Dan Stoza 107fbe5599 libgui: Add getConsumerName
Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is updated on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: Ife94bd89023fe7c00bad916932b9a19233fd2290
2015-06-05 15:01:58 -07:00
Dan Stoza 812ed0644f libgui: Add generation numbers to BufferQueue
This change allows producers to set a generation number on a
BufferQueue. This number will be embedded in any new GraphicBuffers
created in that BufferQueue, and attempts to attach buffers which have
a different generation number will fail.

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

Bug: 20923096
Change-Id: I32bf726b035f99c3e5834beaf76afb9f01adcbc2
2015-06-03 11:09:33 -07:00
Dan Stoza 6a04e5fcf6 libgui: Propagate error by clearing sp<GB>
Clears the sp<GraphicBuffer> returned by createGraphicBuffer when there
is an error during unflattening.

Bug: 21498231
Change-Id: I886da4474fc06853cc59188d62044b7d7549126b
2015-06-01 13:59:15 -07:00
Michael Lentine 04b00cea67 Fix libgui crop matrix test.
On devices that have the crop image extension the crop is not applied to the
transform matrix so we have to expect different results in this case.

Change-Id: If62dec1111fb77c9fa2c4332d121665960ce0216
2015-05-29 16:26:36 -07:00
Michael Lentine 6e1a2fea67 Revert "Modify EGL to disconnect the window when the surface gets destroyed."
This reverts commit 00699fa641.
2015-05-28 16:48:08 -07:00
Dan Stoza 0e65e6c283 libgui: Fix surface damage on rotated buffers
Flips the width and height when the buffer comes in with a 90 degree
rotation so that performing the Y-flip from GL works correctly.

Bug: 20761426
Change-Id: I41c9edc8549c6cbdb534277b996ff20c59034582
2015-05-26 13:22:27 -07:00
Michael Lentine 01f9e920b0 Merge "Fix libgui tests." into mnc-dev 2015-05-22 20:16:01 +00:00
Michael Lentine d8ead0ccd4 Fix libgui tests.
Update IGraphicsBufferProducerTest to the new maximum enum value which is now
NATIVE_WINDOW_BUFFER_AGE. Update SurfaceTextureGLToGL_test to use the correct
counts for GraphicsBuffer refs.

Buf: 18138368

Change-Id: Ie2f7e00b414d63100b16944e3ab36b1ffceecd57
2015-05-22 13:14:57 -07:00
Chong Zhang 041b945e07 Merge "fix BufferItem flatten/unflatten alignment" into mnc-dev 2015-05-22 19:04:05 +00:00
Chong Zhang 47f674dfec fix BufferItem flatten/unflatten alignment
bug: 21370100
Change-Id: Ia3991dc591c176bdbd1d78d1804aa22777525b62
2015-05-22 10:54:25 -07:00
Michael Lentine 699a32bcdf Merge "Refactor ConsumerBase and it's derived classes." into mnc-dev 2015-05-18 21:29:39 +00:00
Michael Lentine 847f11e215 Refactor ConsumerBase and it's derived classes.
Move setDefaultBufferSize, setDefaultBufferFormat, and
setDefaultBufferDataSpace into ConsumerBase and remove them from
CpuConsumer and BufferItemConsumer.

Bug: 19977701

Change-Id: Ic68992464c5da6da7a41c4063a53029a69efcd1b
2015-05-18 14:29:18 -07:00
John Reck 3db36803b2 Merge "Add ConsumerBase::isAbandoned" into mnc-dev 2015-05-14 23:27:46 +00:00
John Reck e478305181 Add ConsumerBase::isAbandoned
Bug: 20105644
Change-Id: I21526b5397ea51a15500c44a99daa9d75fc4ea67
2015-05-14 15:55:11 -07:00
Michael Lentine 51c8c502f6 Merge "Modify EGL to disconnect the window when the surface gets destroyed." into mnc-dev 2015-05-14 16:39:28 +00:00
Michael Lentine 00699fa641 Modify EGL to disconnect the window when the surface gets destroyed.
Bug: 14445579

Change-Id: I1d263ff6cffcb6e448761fca7ca4b06466ad65aa
2015-05-13 15:41:41 -07:00
Dan Stoza 09d561dbee Merge "Fix PTS handling for buffer replacement" into mnc-dev 2015-05-13 16:34:07 +00:00
Dan Stoza 2b83cc920a libgui: Always allow allocation on connect
This change places BufferQueue into a predictable state where
allocation is allowed whenever a producer connects. This allows clients
to disconnect and reconnect without having to worry about being locked
out of allocation.

Bug: 20554276
Change-Id: Ic0f920a3d4204f2cafdfa69e46f3bb4204571d7e
2015-05-12 14:55:15 -07:00
Dan Stoza a4650a50a0 Fix PTS handling for buffer replacement
This changes the way that SurfaceFlinger's shadow buffer management
works such that instead of tracking the size of the shadow queue in the
BufferQueue, SF tracks the last frame number it has seen, and passes
that into the acquireBuffer call. BufferQueueConsumer then ensures that
it never returns a buffer newer than that frame number, even if that
means that it must return PRESENT_LATER for an otherwise valid buffer.

Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
2015-05-12 13:10:17 -07:00
Dan Stoza dc13c5b85b libgui: Hook up onFrameReplaced
This completes the plumbing from ConsumerListener::onFrameReplaced into
SurfaceFlinger (and other consumers that may care).

Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300
2015-05-11 15:33:01 -07:00
Dan Stoza 79e287890d Merge "libgui: Clear frame number while freeing slot" into mnc-dev 2015-05-04 16:33:47 +00:00
Dan Stoza 52937cd9a5 libgui: Clear frame number while freeing slot
Clears the frame number of a slot when it is freed, since it is used
to determine if a released buffer is stale.

Bug: 20445852
Change-Id: I02415e7b25a1eafe7414d6eb1cedf62ac5543cd9
2015-05-01 16:42:55 -07:00
Svetoslav c28fe8f5c5 Merge "Add body sensors app op - framework native" into mnc-dev 2015-05-01 23:10:56 +00:00
Svetoslav b412f6e203 Add body sensors app op - framework native
Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
2015-05-01 13:51:45 -07:00
Dan Stoza ecc504043f SurfaceFlinger: Fix PTS on stale buffers
SurfaceFlinger's (Layer's) shadow copy of the BufferQueue queue was
getting out of sync for a few reasons. This change fixes these by
doing the following:

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

Bug: 20096136
Change-Id: I78d0738428005fc19b3be85cc8f1db498043612f
(cherry picked from commit 2e36f2283f)
2015-05-01 12:23:44 -07:00
Taiju Tsuiki 4d0cd3f524 Close Fence FDs in error cases of Surface and GraphicBufferMapper
Surface::{cancel,queue}Buffer and GraphicBufferMapper::lockAsyncYCbCr take the
ownership of |fenceFd|s. Though they don't close it on error cases.

Change-Id: I49a7ce8837d5c510c4ac4ad4649f310d18610e80
(cherry picked from commit c7263fb432)
2015-04-30 14:50:17 -07:00
Dan Stoza 800b41ab84 libgui: Fix buffer age on 64-bit targets
Changes a %llu to a PRIu64 to fix compilation on 64-bit targets.

Change-Id: I8ba982662dbe8ee2e1e47c4f6ce4bbdbe2020960
2015-04-28 14:20:04 -07:00
Dan Stoza 4afd8b67f9 BufferQueue: Add NATIVE_WINDOW_BUFFER_AGE query
Adds a NATIVE_WINDOW_BUFFER_AGE query, which returns the age of the
contents of the most recently dequeued buffer as the number of frames
that have elapsed since it was last queued.

Change-Id: Ib6fd62945cb62d1e60133a65beee510363218a23
(cherry picked from commit 49f810c72df8d1d64128e376757079825c8decd4)
2015-04-28 13:46:49 -07:00
Dan Stoza 80640fca04 libgui: Implement onTransact for sideband streams
Implements the GET_SIDEBAND_STREAM case of
IGraphicBufferConsumer::onTransact

Change-Id: I46138b87ce2d70dde48b3561dcd378ce5fd8f383
(cherry picked from commit 17166698d9)
2015-04-28 13:29:19 -07:00
Dan Stoza d9c4971da2 libgui: Change detachNextBuffer to return sp<GB>
Changes Surface::detachNextBuffer to return an sp<GraphicBuffer>
instead of an ANativeWindowBuffer* to ensure that reference counting
works correctly.

Bug: 20092217
Change-Id: I3979ea6121aaf14845f0554477b778770413581e
(cherry picked from commit 8b2daa3ca29492b181fb67840640d771c4a2b3ac)
2015-04-27 11:45:58 -07:00
Aravind Akella 63a0f42823 Build fix SensorEventQueue.
Change-Id: I3e6ba031d42bd37067591771f378b7185169ab48
2015-04-24 20:30:09 -07:00
Aravind Akella cc60dc2128 Merge "Enable data injection mode in SensorService." 2015-04-25 01:40:35 +00:00
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