Commit Graph

1232 Commits

Author SHA1 Message Date
Michael Lentine d74ba85c6f Add hotplug support for primary display.
When the primary is connected/disconnected on tv devices HWComposer updates
it's display parameters but doesn't destroy or recreate the display.

Bug: 18698244

Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702
(cherry picked from commit 10613dc3b5)
2015-05-28 13:35:24 -07:00
Michael Lentine b64d875152 Fix surfaceflinger tests.
Update the screenshot code and add correct return values to surface flinger's
capturescreenshot function.

Buf: 18138368

Change-Id: Ieb42d289088589f941502fbd69da7aa939265e07
(cherry picked from commit 5a16a62950)
2015-05-28 13:33:25 -07:00
Dan Stoza f008799d37 SF: Skip render-to-texture for color transforms
In cases where SurfaceFlinger is applying a color matrix (usually for
accessibility features), we previously would perform a render-to-
texture for the initial composition, and then apply the matrix during
a copy to the framebuffer. This changes that behavior to just apply the
matrix during composition without a render-to-texture pass.

This may result in a perceived change of the image in cases with alpha
blending, since the blending is performed at a different stage of the
pipeline and the system effectively performs non-linear blends.
However, neither this nor the prior render-to-texture pass is strictly
correct in that regard, and this approach is less error-prone and
likely faster.

Change-Id: I2110ff0374f61d76df7b087dde8a1ed98990440c
2015-05-27 13:32:51 -07:00
Michael Lentine 10613dc3b5 Add hotplug support for primary display.
When the primary is connected/disconnected on tv devices HWComposer updates
it's display parameters but doesn't destroy or recreate the display.

Bug: 18698244

Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702
2015-05-22 13:14:57 -07:00
Michael Lentine 5a16a62950 Fix surfaceflinger tests.
Update the screenshot code and add correct return values to surface flinger's
capturescreenshot function.

Buf: 18138368

Change-Id: Ieb42d289088589f941502fbd69da7aa939265e07
2015-05-22 13:14:57 -07:00
Dan Stoza 59bfd2bbed SurfaceFlinger: Handle EGL errors more cleanly
Adds some more safety checking for cases where we get an error while
trying to create the EGLImage. The checking puts the Layer into a
failed state after detecting an error, since the shadow queue may no
longer be synchronized.

Bug: 20957332
Change-Id: I68b4c40eab3e58731b875ed5752f2c7d17f14bcb
(cherry picked from commit 65476f3332)
2015-05-14 10:43:07 -07:00
Dan Stoza 65476f3332 SurfaceFlinger: Handle EGL errors more cleanly
Adds some more safety checking for cases where we get an error while
trying to create the EGLImage. The checking puts the Layer into a
failed state after detecting an error, since the shadow queue may no
longer be synchronized.

Bug: 20957332
Change-Id: I68b4c40eab3e58731b875ed5752f2c7d17f14bcb
2015-05-14 09:48:19 -07:00
Dan Stoza e64a79cd85 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
(cherry picked from commit a4650a50a0)
2015-05-13 09:43:35 -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 a3b6693272 libgui: Hook up onFrameReplaced
This completes the plumbing from ConsumerListener::onFrameReplaced into
SurfaceFlinger (and other consumers that may care).

Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300
(cherry picked from commit dc13c5b85b)
2015-05-12 09:35:29 -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 98a13a1475 Merge "SF: Apply pending transactions to new sidebands" into mnc-dev 2015-05-08 16:32:27 +00:00
Ajay Dudani 4e3e30c2d5 surfaceflinger: Fix range check for getFormat
Fix potential buffer overflow error in getFormat with indices
greater than MAX_HWC_DISPLAYS.

Change-Id: I5e5b69d8d043e900f5e33ca9a62e94ae5f857b68
2015-05-07 13:23:32 -07:00
Dan Stoza 12e0a27aa3 SF: Apply pending transactions to new sidebands
When a Layer's sideband stream is set, apply any pending transactions.
Otherwise they would never be applied since sideband streams don't
trigger updates by pushing new buffers.

Bug: 20125898
Change-Id: I0c7a91cdf84e6205801f4ab64eee0b09e4c0b3e0
(cherry picked from commit 3b04e1383eca6cb1d43ebe23a421c427007690c7)
2015-05-05 16:05:32 -07:00
Dan Stoza 8afb76731a SF: Apply pending transactions to new sidebands
When a Layer's sideband stream is set, apply any pending transactions.
Otherwise they would never be applied since sideband streams don't
trigger updates by pushing new buffers.

Bug: 20125898
Change-Id: I0c7a91cdf84e6205801f4ab64eee0b09e4c0b3e0
(cherry picked from commit 3b04e1383eca6cb1d43ebe23a421c427007690c7)
2015-05-05 14:21:20 -07:00
Dan Stoza bb58111c22 Merge "SurfaceFlinger: Fix PTS on stale buffers" 2015-05-01 20:28:47 +00: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
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 7b2fc93007 Merge "SurfaceFlinger: Limit to 4k Layers" into mnc-dev 2015-04-30 22:12:46 +00:00
Dan Stoza 7d89d06a6f 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
(cherry picked from commit e7f8dde3f3)
2015-04-30 15:10:00 -07:00
Dan Stoza 32d4b6c8e1 Merge "SurfaceFlinger: Limit to 4k Layers" 2015-04-30 22:09:38 +00:00
Dan Stoza aa4041f70a 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
(cherry picked from commit ab79e33ef3)
2015-04-30 14:57:41 -07:00
Dan Stoza 676d10b270 Merge "SurfaceFlinger: Fix integer overflow in Mesh ctor" 2015-04-30 21:57:15 +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
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
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
Alan Viverette 3acd9f1d8f 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
2015-04-28 17:15:57 -07: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 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 c7a3cd6228 am 423b40f7: am 368270fd: am de5c15b8: Merge "SF: Always perform sideband transactions"
* commit '423b40f7bd004a8ab5bca887e3855cd20c6bcc28':
  SF: Always perform sideband transactions
2015-04-23 02:17:42 +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 d5296b342e am 66dc4ee3: am b47584f4: am 2e398e64: Merge "SF: Permit changing DispSync offsets at runtime"
* commit '66dc4ee3729c4e6fea624805a1e58843ce920477':
  SF: Permit changing DispSync offsets at runtime
2015-04-15 22:16:03 +00:00
Dan Stoza 91dea34652 am 19f06de0: am 40b2a8b4: am e7d20eb0: Merge "SurfaceFlinger: Pass surface damage to HWC"
* commit '19f06de0930e0f741ed113c37faf306fceee39bd':
  SurfaceFlinger: Pass surface damage to HWC
2015-04-15 21:42:44 +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 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
Jeff Brown 3bfe51d790 Bypass surface flinger permission check for calls from system.
Early during the boot, before activity manager is ready to handle
permission checks, the system needs to be able to change the display
state.  Added a hardcoded exemption for AID_SYSTEM (which already
has permission to talk to surface flinger anyhow).

Bug: 19029490
Change-Id: I6222edcab8e394e5fb6adf7a982be446e4505a1e
2015-04-10 20:26:51 -07:00
Jesse Hall 5b20fd0882 am 28c03cca: am c2a5b469: am a527c07b: Merge "Fix mistake using width instead of height."
* commit '28c03cca9835957f6e304b18358243b184fa46f8':
  Fix mistake using width instead of height.
2015-03-24 21:20:24 +00:00
Jesse Hall c2a5b469a3 am a527c07b: Merge "Fix mistake using width instead of height."
* commit 'a527c07b8d078f7da1114b7055f65b479a148729':
  Fix mistake using width instead of height.
2015-03-24 20:59:51 +00:00
Christopher Ferris 0e7497957a Fix mistake using width instead of height.
Found by rodrigo.chiossi@intel.com.

Change-Id: I49d590ed39f6b47ba58a77a75d66b2964ea1cb1d
2015-03-23 14:37:26 -07:00
Dan Stoza 11611f9be5 DO NOT MERGE SurfaceFlinger: Stop using IGBC::BufferItem
Switches all uses of IGraphicBufferConsumer::BufferItem (and
BufferQueue::BufferItem) to the BufferItem in libgui. Depends on
frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9.

Cherry pick of I187b3a7d05196b6289596afac8fb9a9d4aebff76

Change-Id: I5bc79fb96b6cba6021af64b20890967aa3b7fcbf
2015-03-19 13:59:12 -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 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 84493cd420 SurfaceFlinger: Stop using IGBC::BufferItem
Switches all uses of IGraphicBufferConsumer::BufferItem (and
BufferQueue::BufferItem) to the BufferItem in libgui. Depends on
frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9.

Change-Id: I187b3a7d05196b6289596afac8fb9a9d4aebff76
2015-03-12 15:12:44 -07:00
Dan Stoza 35283ef01b am 105aa28e: am b275b4dc: am 3949f664: Merge "SurfaceFlinger: Fix null pointer exception"
* commit '105aa28eeff9d31eebc7645aecb7630918a09b2a':
  SurfaceFlinger: Fix null pointer exception
2015-03-10 15:48:55 +00:00
Dan Stoza b275b4dc3e am 3949f664: Merge "SurfaceFlinger: Fix null pointer exception"
* commit '3949f664c71ad1269ee0c921d176e3b4484015cc':
  SurfaceFlinger: Fix null pointer exception
2015-03-09 18:05:26 +00:00
Dan Stoza 24a42e9f54 SurfaceFlinger: Fix null pointer exception
Fixes a null pointer exception in getActiveConfig

Bug: 19416124
Change-Id: I45a01f67affb63a348866ce42a6013c5eb71fe8f
2015-03-09 10:04:11 -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 b90cf07f8b SurfaceFlinger: Add --static-screen stats
Adds a --static-screen option to dumpsys SurfaceFlinger, which
displays screen-on time broken down by the time between the prior
frame and the current frame. An example dump looks like this:

$ adb shell dumpsys SurfaceFlinger --static-screen
Static screen stats:
  < 1 frames: 12.235 s (3.5%)
  < 2 frames: 29.898 s (8.7%)
  < 3 frames: 15.370 s (4.4%)
  < 4 frames: 13.103 s (3.8%)
  < 5 frames: 15.780 s (4.6%)
  < 6 frames: 2.022 s (0.6%)
  < 7 frames: 0.201 s (0.1%)
  7+ frames: 256.887 s (74.4%)

The buckets are exclusive, so '< 3 frames' covers the interval
[2, 3) frames

Bug: 19543586
Change-Id: I3253a54c23995d25e96016997acedd0775956b60
2015-03-05 14:43:08 -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
Greg Hackmann 53ec1f0d18 am beb89e11: am 6f57b269: am 56f8c6c4: Merge "Error compiling waitforvsync.cpp"
* commit 'beb89e11ca777c92b7e2cc06c25f47d5a75ee7ad':
  Error compiling waitforvsync.cpp
2015-02-26 02:27:29 +00:00
Greg Hackmann 6f57b269f9 am 56f8c6c4: Merge "Error compiling waitforvsync.cpp"
* commit '56f8c6c42dab4c3636edb62162088e5d765fa956':
  Error compiling waitforvsync.cpp
2015-02-26 01:07:03 +00:00
Greg Hackmann 56f8c6c42d Merge "Error compiling waitforvsync.cpp" 2015-02-25 23:42:17 +00:00
Mark Salyzyn 129da2ba07 am 453c6a78: am a455ec21: am d80268ba: Merge "vsync.cpp test is throwing error whe compiled"
* commit '453c6a781de3dc728212d66f1ca7fda2ae984974':
  vsync.cpp test is throwing error whe compiled
2015-02-23 15:30:22 +00:00
Mark Salyzyn a455ec21fa am d80268ba: Merge "vsync.cpp test is throwing error whe compiled"
* commit 'd80268ba19f9217c5459a2952580090ef84a7b78':
  vsync.cpp test is throwing error whe compiled
2015-02-23 15:19:59 +00:00
Nanik Tolaram 5b06dc00ac vsync.cpp test is throwing error whe compiled
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:55:44: error: 'ALOOPER_EVENT_INPUT' was not declared in this scope
     loop->addFd(myDisplayEvent.getFd(), 0, ALOOPER_EVENT_INPUT, receiver,
                                            ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:64:18: error: 'ALOOPER_POLL_WAKE' was not declared in this scope
             case ALOOPER_POLL_WAKE:
                  ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:67:18: error: 'ALOOPER_POLL_CALLBACK' was not declared in this scope
             case ALOOPER_POLL_CALLBACK:
                  ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:70:18: error: 'ALOOPER_POLL_TIMEOUT' was not declared in this scope
             case ALOOPER_POLL_TIMEOUT:
                  ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:73:18: error: 'ALOOPER_POLL_ERROR' was not declared in this scope
             case ALOOPER_POLL_ERROR:
                  ^

it is missing one header file

Change-Id: Ie2fb02523a866b13a99edf837f072d101cacb466
Signed-off-by: Nanik Tolaram <nanikjava@gmail.com>
2015-02-23 15:13:56 +00:00
Nanik Tolaram ee9701744a Error compiling waitforvsync.cpp
The waitforvsync.cpp throws error when compiling. Following is the error log

target thumb C++: test-waitforvsync <= frameworks/native/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp
frameworks/native/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp: In function 'int main(int, char**)':
frameworks/native/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp:43:17: error: 'close' was not declared in this scope
         close(fd);
                 ^
....
....

make: *** [out/target/product/grouper/obj/EXECUTABLES/test-waitforvsync_intermediates/waitforvsync.o] Error 1

the file is missing #include <unistd.h>

Change-Id: I57728dbde65641cd3138625f9a590f9db8648158
Signed-off-by: Nanik Tolaram <nanikjava@gmail.com>
2015-02-14 00:26:59 +11:00
Dan Stoza 3890c83721 am 40b4e23a: Merge "resolved conflicts for merge of 1665c8e1 to lmp-mr1-dev-plus-aosp" into lmp-mr1-dev-plus-aosp
* commit '40b4e23a0396614c841977e932218e3f53089a4a':
  Revert "SurfaceFlinger: Attempt to attribute fds to layers"
2015-01-27 23:42:56 +00:00
Yabin Cui 3d6c569140 am 39d890d9: am 6e32c037: Merge "Kill HAVE_PTHREADS."
* commit '39d890d9aed5cb07b8a166a749299b9d24d8f137':
  Kill HAVE_PTHREADS.
2015-01-27 23:42:55 +00:00
Dan Stoza 40b4e23a03 Merge "resolved conflicts for merge of 1665c8e1 to lmp-mr1-dev-plus-aosp" into lmp-mr1-dev-plus-aosp 2015-01-27 20:06:34 +00:00
Yabin Cui 39d890d9ae am 6e32c037: Merge "Kill HAVE_PTHREADS."
* commit '6e32c0377db89bafa477715b3a02431d651978cf':
  Kill HAVE_PTHREADS.
2015-01-27 19:56:06 +00:00
Dan Stoza 22d0bdf326 resolved conflicts for merge of 1665c8e1 to lmp-mr1-dev-plus-aosp
Change-Id: I0be2ecb8085f2cd9560138460bcc27d71c011608
2015-01-27 11:49:26 -08:00
Dan Stoza 1665c8e101 Revert "SurfaceFlinger: Attempt to attribute fds to layers"
This reverts commit 03eccb6616.

Change-Id: I4f0da7bb62bf77bb3d399aee601beae5e03928fe
2015-01-27 11:03:50 -08:00
Yabin Cui 8fb2d25ff3 Kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: I355491de945590f43c82bdcb7968b01b4bff6e06
2015-01-26 22:36:36 -08:00
Dan Stoza b62767e855 am a5cbb1f1: am ef1c17ae: SurfaceFlinger: Make log message 64-bit compatible
* commit 'a5cbb1f18b6eb4e0db27d98bea0731393b7438d1':
  SurfaceFlinger: Make log message 64-bit compatible
2015-01-17 00:53:36 +00:00
Dan Stoza 3c7eb4fe23 am 3372cc25: resolved conflicts for merge of 03eccb66 to lmp-mr1-dev-plus-aosp
* commit '3372cc25df255b94e4eb75920afaf43ee5edc39f':
  SurfaceFlinger: Attempt to attribute fds to layers
2015-01-17 00:53:35 +00:00
Dan Stoza a5cbb1f18b am ef1c17ae: SurfaceFlinger: Make log message 64-bit compatible
* commit 'ef1c17ae9417abc1e21e49dbc629e448efc947dc':
  SurfaceFlinger: Make log message 64-bit compatible
2015-01-17 00:50:53 +00:00
Dan Stoza 3372cc25df resolved conflicts for merge of 03eccb66 to lmp-mr1-dev-plus-aosp
Change-Id: I1f38cbe7019b2b48b1094dee154ad97c23fd22c2
2015-01-16 16:18:51 -08:00
Dan Stoza ef1c17ae94 SurfaceFlinger: Make log message 64-bit compatible
Fixes the build on 64-bit targets that complain about using a size_t
with a %d in a format string

Change-Id: I7dfcd3a49eb0dbc5dffeb82bb7208de7f7925f08
2015-01-16 15:58:13 -08:00
Dan Stoza 03eccb6616 SurfaceFlinger: Attempt to attribute fds to layers
This tracks fds when layers are created and destroyed in an effort to
determine which specific app (if any) is active when fds are leaked

Bug: 19017008
Change-Id: I1f1d5a9cbc1399e3df3a2d350324f80b3a4e3477
2015-01-16 15:02:22 -08:00
Jesse Hall 8eb8069a2d am 9c22ac77: am 5b730570: Merge "surfaceflinger: use Mutex timedLock instead of tryLock loop"
* commit '9c22ac77e41b8bbddbb64959acabce3f3a07345d':
  surfaceflinger: use Mutex timedLock instead of tryLock loop
2015-01-13 20:32:28 +00:00
Jesse Hall 9c22ac77e4 am 5b730570: Merge "surfaceflinger: use Mutex timedLock instead of tryLock loop"
* commit '5b730570be2bd1f90346a5921d0b70dc11351396':
  surfaceflinger: use Mutex timedLock instead of tryLock loop
2015-01-12 23:41:46 +00:00
Jesse Hall fcd15b478c surfaceflinger: use Mutex timedLock instead of tryLock loop
Rather than trying to acquire the state lock without waiting three
times at 1 second intervals in SurfaceFlinger::dump(), just try to
acquire the lock once with a 1 second timeout. Avoids spurious mutex
acquire failures that lead to flaky
com.android.cts.jank.opengl.CtsHostJankOpenGl results.

Bug: 18842510
Change-Id: I00ce6109647de2aef8831dd2f8fa98652ba7f4e0
2015-01-10 15:41:01 -08:00
Dmitriy Ivanov e9b6f1f7bb Switch to libsigchain.a
Use LOCAL_WHOLE_STATIC_LIBRARIES to instruct static linker
  to export symbols from the static library.

(cherry picked from commit 4340a14fbf)

Bug: 18701723
Change-Id: I70f6fdb64b0d1adbadf96c8de85870a903ec186a
2014-12-10 10:28:50 -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 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
Dan Stoza d6739d5e44 am db5827d3: am 5878444f: SurfaceFlinger: Listen to HWC invalidate
* commit 'db5827d314ddca3d473947b4ef49e811fad70069':
  SurfaceFlinger: Listen to HWC invalidate
2014-12-04 16:15:54 +00:00
Dan Stoza db5827d314 am 5878444f: SurfaceFlinger: Listen to HWC invalidate
* commit '5878444fb8da043021f30d3de739531f15390df5':
  SurfaceFlinger: Listen to HWC invalidate
2014-12-03 20:43:29 +00:00
Dan Stoza 5878444fb8 SurfaceFlinger: Listen to HWC invalidate
"Do less work when using PTS" broke the invalidate path up from HWC
to SurfaceFlinger. When HWC would signal an invalidate, SurfaceFinger
would wake up, see no new buffers, and go back to sleep. This is fine,
except when the invalidate is a result of an HDMI hotplug, in which
case the screen remains blank. This change makes that functionality
work again.

Bug: 18564815
Bug: 18558468
Change-Id: I2e2171d86839945f4e4e6555d66f7e2895bd096a
2014-12-02 16:58:17 -08:00
Michael Lentine 347a2acf7e am 1e611662: am b947f29a: Merge "Add clamp to Layer and update Transform inverse." into lmp-mr1-dev
* commit '1e6116621bc2f7aedfd52a5f1327b530328435b0':
  Add clamp to Layer and update Transform inverse.
2014-11-25 18:56:41 +00:00
Michael Lentine 1e6116621b am b947f29a: Merge "Add clamp to Layer and update Transform inverse." into lmp-mr1-dev
* commit 'b947f29a6af1622cda16d0b7112595082750dd07':
  Add clamp to Layer and update Transform inverse.
2014-11-25 18:44:51 +00:00
Michael Lentine 28ea217ff4 Add clamp to Layer and update Transform inverse.
Ensure that the adjusted transparent region is within
the display bounds by clamping after the transformation
is applied and clean up transform's inverse function.

Bug: 18452546

Change-Id: Ia473e483ee8374177bcb84d8192eb1f0e86f022a
2014-11-21 17:05:18 -08:00
Dan Albert c1ced8bbcd am c894c204: Merge "C++11 compatibility."
* commit 'c894c2045f589571c80af0648e7a9dcd7e97b6a8':
  C++11 compatibility.
2014-11-20 23:00:48 +00:00
Dan Albert 3bdc5b8268 C++11 compatibility.
* Explicit conversion for atomic_uintptr_t initialization.
 * Fix string literal concatenation to not be a UD literal.
 * Use __typeof__ instead of typeof (should become decltype once this
   actually moves to C++11).

Bug: 18466763
Change-Id: I4eedddfb945a2a703ed27317cb6e2b3041b1ebfc
2014-11-20 21:04:35 +00:00
Dan Stoza e8e23c8b79 am 686c5be4: am 6b9454d1: SurfaceFlinger: Do less work when using PTS
* commit '686c5be4722dce02ae8e5580d6677f1eeea22464':
  SurfaceFlinger: Do less work when using PTS
2014-11-18 20:18:27 +00:00
Dan Stoza 686c5be472 am 6b9454d1: SurfaceFlinger: Do less work when using PTS
* commit '6b9454d1fee0347711af1746642aa7820b1ea04d':
  SurfaceFlinger: Do less work when using PTS
2014-11-18 02:07:36 +00:00
Dan Stoza 6b9454d1fe SurfaceFlinger: Do less work when using PTS
Currently, SurfaceFlinger is very dumb about how it handles buffer
updates at less than 60fps. If there is a new frame pending, but its
timestamp says not to present it until later SurfaceFlinger will wake
up every vsync until it is time to present it. Even worse, if
SurfaceFlinger has woken up but nothing has changed, it still goes
through the entire composition process.

This change (mostly) fixes that inefficiency. SurfaceFlinger will
still wake up every refresh period while there is a new frame
pending, but if there is no work to do, it will almost immediately go
back to sleep.

Bug: 18111837
Change-Id: I7825bacd37f40bf26edcc6a5e0f051dce45291fb
2014-11-17 21:32:13 +00: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 Albert 41a0ef3e28 resolved conflicts for merge of 4037c458 to master
Change-Id: I8a2e73b7ba48b790054e0ab99f81b2693244389e
2014-11-14 11:13:20 -08:00
Andreas Gampe 4037c458a7 resolved conflicts for merge of 07dffa18 to lmp-mr1-dev-plus-aosp
Change-Id: I42d8bc291f4f48f3098754b076889159c4b20e41
2014-11-13 15:16:53 -08:00
Andreas Gampe 89fd4f7fa6 Frameworks/native: Wall Werror in surfaceflinger
Turn on -Wall -Werror in services/surfaceflinger. Fix warnings.

Change-Id: Ifef830300d9d4bc657d8f1257c02bfe8c2b4d9c5
2014-11-13 14:18:56 -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
Naseer Ahmed ff520bb938 am 7aa0c47e: sf: Add a NULL check in getDisplayConfigs
* commit '7aa0c47e4205c6fca136c38f272d911c25c8a8fa':
  sf: Add a NULL check in getDisplayConfigs
2014-11-03 22:31:50 +00:00
Naseer Ahmed 7aa0c47e42 sf: Add a NULL check in getDisplayConfigs
Validate the display binder by adding a NULL check in getDisplayConfigs.
This will prevent a false match if the caller queries the display
configs for an inactive display (whose binder is NULL by default).

Without this change we might end up attempting to index the display
config array, which is unpopulated for inactive displays, and this will
result in a crash. (See getDisplayInfo in SurfaceComposerClient.cpp for
an example of this scenario)

Change-Id: I1a12f43b7c375b9c01998dadd5b658275c733fb2
Acked-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2014-11-03 12:16:18 -08:00