Commit Graph

51737 Commits

Author SHA1 Message Date
Mark Salyzyn
dfe7e7e63f Merge "dumpstate: report per-partition MMC performance" 2015-05-01 21:48:51 +00:00
Dan Stoza
bb58111c22 Merge "SurfaceFlinger: Fix PTS on stale buffers" 2015-05-01 20:28:47 +00:00
Dan Stoza
2e36f2283f 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
2015-04-30 15:29:05 -07:00
Dan Stoza
32d4b6c8e1 Merge "SurfaceFlinger: Limit to 4k Layers" 2015-04-30 22:09:38 +00:00
Dan Stoza
676d10b270 Merge "SurfaceFlinger: Fix integer overflow in Mesh ctor" 2015-04-30 21:57:15 +00:00
Dan Stoza
ed6e907bc7 Merge "Close Fence FDs in error cases of Surface and GraphicBufferMapper" 2015-04-30 21:49:40 +00:00
Dan Stoza
e7f8dde3f3 SurfaceFlinger: Limit to 4k Layers
Sets a limit of 4k Layers which SurfaceFlinger will allow to be in
existence at any given time. An attempt to create Layers in excess of
this limit will fail with NO_MEMORY.

Bug: 20674586
Change-Id: I2dfaf59643d826f982b2fa44e8a9ed643176d972
2015-04-30 14:29:30 -07:00
Mark Salyzyn
540e3de99f dumpstate: report per-partition MMC performance
Change-Id: If5cabe186d8377056effa1c0672a90e277cd7221
2015-04-30 12:58:32 -07:00
Dan Stoza
ab79e33ef3 SurfaceFlinger: Fix integer overflow in Mesh ctor
Performs range checking on the inputs to Mesh::Mesh() before allocating
the storage array.

Bug: 20674682
Change-Id: I4fc918a8c312d967dd6d9f91a098b2e0a7081027
2015-04-30 12:44:03 -07:00
Dan Stoza
08a7c79284 Merge "Remove gamma correction from color correction shader" 2015-04-30 19:36:30 +00:00
Dan Stoza
f0c17b0831 Merge "Avoid closing invalid FD in Surface and GraphicBufferMapper" 2015-04-30 16:34:11 +00:00
Taiju Tsuiki
dcfe91e1f3 Avoid closing invalid FD in Surface and GraphicBufferMapper
GraphicBufferMapper::lockAsync{,YCbCr} close the fence FD even when the FD
is invalid.

Change-Id: Ia2b4dae3b2c06426e34f623f19ba92435f486ab7
2015-04-30 22:56:25 +09:00
Taiju Tsuiki
c7263fb432 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
2015-04-30 22:55:36 +09:00
Alan Viverette
ad84681d31 Remove gamma correction from color correction shader
Gamma correction was incorrectly skewing both color inversion and
Daltonization, which resulted in washed-out colors.

Bug: 20346301
Change-Id: I34d879f902c3be115b2d23f09c3ed3902799759e
(cherry picked from commit 3acd9f1d8f)
2015-04-29 12:27:18 -07:00
Dan Stoza
8de71a2408 Merge "BufferQueue: Add NATIVE_WINDOW_BUFFER_AGE query" 2015-04-29 17:21:51 +00:00
Dan Stoza
ca8c569598 Merge "libgui: Implement onTransact for sideband streams" 2015-04-29 17:17:52 +00:00
Nick Kralevich
becd89d185 Merge "Parcel.cpp: use calloc instead of malloc" 2015-04-29 04:16:23 +00:00
Nick Kralevich
6329f0199e Parcel.cpp: use calloc instead of malloc
Bug: 20669363
Change-Id: Ia4c8d8ca9d8b4b87954d7267e8b1c94cf4e570e1
2015-04-28 16:21:30 -07:00
Dan Stoza
81cde67a55 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
2015-04-28 14:26:05 -07:00
Dan Stoza
17166698d9 libgui: Implement onTransact for sideband streams
Implements the GET_SIDEBAND_STREAM case of
IGraphicBufferConsumer::onTransact

Change-Id: I46138b87ce2d70dde48b3561dcd378ce5fd8f383
2015-04-28 13:23:18 -07:00
Dan Stoza
b5c7ccfdc7 Merge "libgui: Change detachNextBuffer to return sp<GB>" 2015-04-28 17:36:54 +00:00
Dan Stoza
745ac038b9 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
2015-04-27 11:16:15 -07:00
Andreas Gampe
bec3de4ac5 Merge "Installd: Add debug.gencfi to run_dex2oat" 2015-04-27 15:14:43 +00:00
Andreas Gampe
816243d470 Installd: Add debug.gencfi to run_dex2oat
Add the debug.gencfi system property that forces generation of
CFI data.

Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369
2015-04-27 08:12:23 -07:00
Michael Wright
7ecc8952c4 Merge "Check orientation range has been initialized first" 2015-04-27 14:13:22 +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
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
de5c15b8bd Merge "SF: Always perform sideband transactions" 2015-04-22 23:57:28 +00:00
Dan Stoza
9e9b044554 SF: Always perform sideband transactions
On normal Layers, we defer applying resize transactions until a buffer
of the correct size arrives. This breaks with sideband streams, because
buffers are not seen by SurfaceFlinger. This change applies
transactions immediately for Layers which have a sideband stream
attached to avoid that problem.

Bug: 20428254
Change-Id: I379d8aaef460d467cdf8432764b4a504928fb65a
(cherry picked from commit c300b8b506536e1bf94ffd8a3b75d46e776923e0)
2015-04-22 16:53:15 -07: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
e647dddebb Merge "libgui: Fix CPU rendering on Surface" 2015-04-22 00:07:52 +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
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
ff5c1a6b67 Merge "libgui: Change BufferQueue to use free lists" 2015-04-20 20:14:14 +00: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
2e398e64b3 Merge "SF: Permit changing DispSync offsets at runtime" 2015-04-15 21:37:19 +00:00
Dan Stoza
db4ac3ce63 SF: Permit changing DispSync offsets at runtime
This modifies EventThread such that its phase offsets for both
Choreographer and SurfaceFlinger may be modified at runtime. It also
plumbs this functionality up to the SurfaceFlinger debug interface so
that it is possible to rapidly test different offsets without
restarting the framework.

Change-Id: I426873f8553f931250dfebc9a8a4a78e9f1f4309
2015-04-15 13:56:28 -07:00
Dan Stoza
e7d20eb000 Merge "SurfaceFlinger: Pass surface damage to HWC" 2015-04-15 20:34:51 +00:00
Dan Stoza
fd5f41bee9 Merge "libgui: Pass surface damage through BufferQueue" 2015-04-15 20:26:55 +00:00
Dan Stoza
ee44edd0ac SurfaceFlinger: Pass surface damage to HWC
Passes the surface damage from the incoming SurfaceFlingerConsumer
BufferQueue down to the hardware composer HAL interface, if the
HWC version number is 1.5 or greater.

Bug: 11239309
Change-Id: Ic4305210593874a8d6deba3319055b2b8c57e926
2015-04-15 13:20:01 -07: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
4d769d8bdc Merge "libui: Clean up Fence and Region flattening" 2015-04-15 20:13:53 +00:00
Dan Stoza
22412a34c6 Merge "libEGL: Add wrappers for partial update functions" 2015-04-15 20:08:36 +00:00
Dan Stoza
6fbefbbd8e libui: Clean up Fence and Region flattening
Fence was flattening incorrectly, causing issues with any fields
flattened after it, and Region was relying on being the last object
flattened. This change addresses both.

Change-Id: If49de061de6e2f11f4d846b4d8c18627dfb7e109
2015-04-15 13:04:15 -07:00