Commit Graph

52908 Commits

Author SHA1 Message Date
Dan Stoza
b8efdc4003 libui: Apply GRALLOC_USAGE_ALLOC_MASK during alloc
Applies GRALLOC_USAGE_ALLOC_MASK to the incoming usage bits before
calling alloc on the gralloc module. This filters out the new flag
GRALLOC_USAGE_FOREIGN_BUFFERS, which is used to send a hint to the
producer, but which does not affect the allocation of buffers.

Bug: 19801661
Change-Id: Ia37a3eddba2e97598e50ac3e10877430adfa9247
2015-05-29 19:52:43 +00:00
Michael Lentine
1c4537e2e8 Check that width and height parameters are small.
The product of width and height should be less than UINT32_MAX (in practice
smaller). Adding the checks prevents overflows when allocating buffers.

Bug: 20726612
Change-Id: I9769edf0688a9bfe69906d49fa0540cadf4c49b0
2015-05-29 10:54:30 -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
Alistair Strachan
bd87fd1ab2 am 89301eaf: Fix EGL shim extension injection for GL ES 3 drivers.
* commit '89301eaf214f0da74c5266e7a548899d5f491b50':
  Fix EGL shim extension injection for GL ES 3 drivers.
2015-05-28 23:29:23 +00:00
Alistair Strachan
89301eaf21 Fix EGL shim extension injection for GL ES 3 drivers.
The Android EGL shim injects GL_EXT_debug_marker into the ES driver
EXTENSIONS string for the OpenGL ES 1.x and 2.0/3.0/3.1 drivers if
the extension is not already provided. This feature is used by
GLES_trace.

In Open GL ES 3.0 it became possible to query an indexed version of
the EXTENSIONS string via GetStringi(). NUM_EXTENSIONS Gets were
also added to the specification (taken from Open GL).

If the shim does not have to inject the extension, then there is no
problem, as glGetString() and glGetStringi() / NUM_EXTENSIONS will
be consistent. However, if the Android EGL shim injects the
extension, NUM_EXTENSIONS and GetStringi() will report one less
extension than is really available.

Consistency between these methods is tested by the dEQP framework
with the dEQP-GLES3.functional.state_query.string.extensions test.
If the driver does not provide GL_EXT_debug_marker, this test
fails.

This change wraps all of the affected entry points so that the
wrapped driver extensions are never visible directly to dEQP,
eliminating the inconsistency.
2015-05-28 15:34:31 -07:00
Dan Stoza
fc13571ac0 am 2a185c24: am a8702c47: Merge "SurfaceFlinger: Tweak whitespace in DdmConnection"
* commit '2a185c24767c34681f7537a000d533caac5d77a5':
  SurfaceFlinger: Tweak whitespace in DdmConnection
2015-05-28 21:56:07 +00:00
Dan Stoza
4f4e683b67 am adb3aff0: am 5566d9db: Merge "Bypass surface flinger permission check for calls from system."
* commit 'adb3aff05c8203b483b2469515b54e86ec2f8758':
  Bypass surface flinger permission check for calls from system.
2015-05-28 21:56:06 +00:00
Dan Stoza
382d20471e am 84a507ae: am 13c04c27: Merge "surfaceflinger: Fix range check for getFormat"
* commit '84a507aeea37753090ce8a34845fef5befca7060':
  surfaceflinger: Fix range check for getFormat
2015-05-28 21:56:05 +00:00
Dan Stoza
2a185c2476 am a8702c47: Merge "SurfaceFlinger: Tweak whitespace in DdmConnection"
* commit 'a8702c4765993f31a70243e4f89c251fe9911cde':
  SurfaceFlinger: Tweak whitespace in DdmConnection
2015-05-28 21:40:29 +00:00
Dan Stoza
adb3aff05c am 5566d9db: Merge "Bypass surface flinger permission check for calls from system."
* commit '5566d9db26e656a53ee9a5e87c0af997bb1a10d5':
  Bypass surface flinger permission check for calls from system.
2015-05-28 21:40:28 +00:00
Dan Stoza
84a507aeea am 13c04c27: Merge "surfaceflinger: Fix range check for getFormat"
* commit '13c04c27622c7be474e9368211795bcec052dedb':
  surfaceflinger: Fix range check for getFormat
2015-05-28 21:40:27 +00:00
Dan Stoza
d63a954468 am 967482f6: am 20f7a6f0: Merge "Modify EGL to disconnect the window when the surface gets destroyed."
* commit '967482f6a70d49b6a8ff58474d203f31e6d6295f':
  Modify EGL to disconnect the window when the surface gets destroyed.
2015-05-28 21:36:15 +00:00
Dan Stoza
a8702c4765 Merge "SurfaceFlinger: Tweak whitespace in DdmConnection" 2015-05-28 21:25:11 +00:00
Dan Stoza
42ace4b5c6 SurfaceFlinger: Tweak whitespace in DdmConnection
Change-Id: I99e7b09e4bc3611ffb790eddfbb9b3c8b9bc5d4c
2015-05-28 14:23:54 -07:00
Dan Stoza
5566d9db26 Merge "Bypass surface flinger permission check for calls from system." 2015-05-28 21:21:28 +00:00
Dan Stoza
13c04c2762 Merge "surfaceflinger: Fix range check for getFormat" 2015-05-28 21:20:59 +00:00
Dan Stoza
967482f6a7 am 20f7a6f0: Merge "Modify EGL to disconnect the window when the surface gets destroyed."
* commit '20f7a6f004511486a2130030a4694ec2d2983c96':
  Modify EGL to disconnect the window when the surface gets destroyed.
2015-05-28 21:20:55 +00:00
Jeff Brown
8b04725f14 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
(cherry picked from commit 3bfe51d790)
2015-05-28 14:19:22 -07:00
Ajay Dudani
ae569747b6 surfaceflinger: Fix range check for getFormat
Fix potential buffer overflow error in getFormat with indices
greater than MAX_HWC_DISPLAYS.

Change-Id: I5e5b69d8d043e900f5e33ca9a62e94ae5f857b68
(cherry picked from commit 4e3e30c2d5)
2015-05-28 14:19:10 -07:00
Dan Stoza
a1dcd7abc8 am 07246a92: am c2bdfb86: Merge "SF: Skip render-to-texture for color transforms"
* commit '07246a92dcd9f1cac389aa4958918e57fb83b23a':
  SF: Skip render-to-texture for color transforms
2015-05-28 21:12:46 +00:00
Dan Stoza
6337111fe1 am 5ae340f7: am 0af1e0fe: Merge "Add hotplug support for primary display."
* commit '5ae340f7d21afb198db3b2288321f775da28ea6f':
  Add hotplug support for primary display.
2015-05-28 21:12:46 +00:00
Dan Stoza
64e9d9af72 am 38f09a6e: am 35283482: Merge "libgui: Fix surface damage on rotated buffers"
* commit '38f09a6e6e146ec0a44f0863652ddc557f5c3b0f':
  libgui: Fix surface damage on rotated buffers
2015-05-28 21:12:45 +00:00
Dan Stoza
5e0669e127 am 8191944f: am 0a70ed99: Merge "Fix surfaceflinger tests."
* commit '8191944fd2828ea3b848fcf378a39f146af7f38c':
  Fix surfaceflinger tests.
2015-05-28 21:12:44 +00:00
Dan Stoza
eb8ba08b63 am aac9729f: am 4ebb44e8: Merge "Fix libgui tests."
* commit 'aac9729fbe52a84166a8963927a3edb3a6c051bd':
  Fix libgui tests.
2015-05-28 21:12:43 +00:00
Dan Stoza
2b31f929d0 am fd9017e8: am 10cb68fb: Merge "fix BufferItem flatten/unflatten alignment"
* commit 'fd9017e8db29f2d87b70034bbb57ef1c424fa2b6':
  fix BufferItem flatten/unflatten alignment
2015-05-28 21:12:42 +00:00
Dan Stoza
362b38060b am d68c5f9c: am 1bdeb9d8: Merge "Refactor ConsumerBase and it\'s derived classes."
* commit 'd68c5f9cfa865c5f735d902b3999ff8209fca617':
  Refactor ConsumerBase and it's derived classes.
2015-05-28 21:12:41 +00:00
Jesse Hall
ac96ed19ab am 1d0a3e50: am 5a606c3a: Merge "Fix EGL shim extension injection for GL ES 3 drivers."
* commit '1d0a3e50fc17091ee1cb395f79aef3a56fcb9190':
  Fix EGL shim extension injection for GL ES 3 drivers.
2015-05-28 21:12:40 +00:00
Dan Stoza
cc5b0bbf44 am 8ab465d0: am d19ad6fb: Merge "Add ConsumerBase::isAbandoned"
* commit '8ab465d04ebe280e782c24a4c229402cfe60e9dd':
  Add ConsumerBase::isAbandoned
2015-05-28 21:12:39 +00:00
Dan Stoza
20f7a6f004 Merge "Modify EGL to disconnect the window when the surface gets destroyed." 2015-05-28 21:10:35 +00:00
Michael Lentine
87dd528bee Modify EGL to disconnect the window when the surface gets destroyed.
Bug: 14445579

Change-Id: I1d263ff6cffcb6e448761fca7ca4b06466ad65aa
(cherry picked from commit 00699fa641)
2015-05-28 14:09:36 -07:00
Dan Stoza
07246a92dc am c2bdfb86: Merge "SF: Skip render-to-texture for color transforms"
* commit 'c2bdfb869427f840c37a977ca91c87ca75b89b0f':
  SF: Skip render-to-texture for color transforms
2015-05-28 21:08:24 +00:00
Dan Stoza
5ae340f7d2 am 0af1e0fe: Merge "Add hotplug support for primary display."
* commit '0af1e0feb6c3c693707fe5b970518713d0149741':
  Add hotplug support for primary display.
2015-05-28 21:08:23 +00:00
Dan Stoza
38f09a6e6e am 35283482: Merge "libgui: Fix surface damage on rotated buffers"
* commit '35283482d0d82f7d264b77941aabe41dacfe3155':
  libgui: Fix surface damage on rotated buffers
2015-05-28 21:08:20 +00:00
Dan Stoza
8191944fd2 am 0a70ed99: Merge "Fix surfaceflinger tests."
* commit '0a70ed998cad67bf1c82e82d4229291c9dcc22ac':
  Fix surfaceflinger tests.
2015-05-28 21:08:17 +00:00
Dan Stoza
aac9729fbe am 4ebb44e8: Merge "Fix libgui tests."
* commit '4ebb44e8cc42231bc9c4588ec3432eae9770483a':
  Fix libgui tests.
2015-05-28 21:08:15 +00:00
Dan Stoza
c2bdfb8694 Merge "SF: Skip render-to-texture for color transforms" 2015-05-28 21:02:23 +00:00
Dan Stoza
0af1e0feb6 Merge "Add hotplug support for primary display." 2015-05-28 20:59:45 +00:00
Dan Stoza
35283482d0 Merge "libgui: Fix surface damage on rotated buffers" 2015-05-28 20:57:48 +00:00
Dan Stoza
0a70ed998c Merge "Fix surfaceflinger tests." 2015-05-28 20:55:44 +00:00
Dan Stoza
fd9017e8db am 10cb68fb: Merge "fix BufferItem flatten/unflatten alignment"
* commit '10cb68fb971c899d7d1eb6c131ecf59761af6ddf':
  fix BufferItem flatten/unflatten alignment
2015-05-28 20:55:20 +00:00
Dan Stoza
d68c5f9cfa am 1bdeb9d8: Merge "Refactor ConsumerBase and it\'s derived classes."
* commit '1bdeb9d84f4c63a0fb6be2517aebe5de88a3bb45':
  Refactor ConsumerBase and it's derived classes.
2015-05-28 20:55:19 +00:00
Jesse Hall
1d0a3e50fc am 5a606c3a: Merge "Fix EGL shim extension injection for GL ES 3 drivers."
* commit '5a606c3ab9ead418709c0f63940b60347d11e925':
  Fix EGL shim extension injection for GL ES 3 drivers.
2015-05-28 20:55:18 +00:00
Dan Stoza
8ab465d04e am d19ad6fb: Merge "Add ConsumerBase::isAbandoned"
* commit 'd19ad6fb676f6934bf9208a47d33738234570145':
  Add ConsumerBase::isAbandoned
2015-05-28 20:55:17 +00:00
Dan Stoza
4ebb44e8cc Merge "Fix libgui tests." 2015-05-28 20:54:05 +00:00
Dan Stoza
10cb68fb97 Merge "fix BufferItem flatten/unflatten alignment" 2015-05-28 20:51:56 +00:00
Dan Stoza
1bdeb9d84f Merge "Refactor ConsumerBase and it's derived classes." 2015-05-28 20:48:47 +00:00
Jesse Hall
5a606c3ab9 Merge "Fix EGL shim extension injection for GL ES 3 drivers." 2015-05-28 20:46:45 +00:00
Dan Stoza
d19ad6fb67 Merge "Add ConsumerBase::isAbandoned" 2015-05-28 20:40:00 +00:00
Dan Stoza
8e8eba5091 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
(cherry picked from commit f008799d37)
2015-05-28 13:35:39 -07:00
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