OSDN Git Service

android-x86/frameworks-native.git
7 years agoMerge "Reference nativehelper/jni.h as jni.h"
Steven Moreland [Tue, 18 Jul 2017 20:05:57 +0000 (20:05 +0000)]
Merge "Reference nativehelper/jni.h as jni.h"
am: 28c9177f66

Change-Id: If460edb57fbd4678cfe932eb76b0931024f17f80

7 years agoMerge "Reference nativehelper/jni.h as jni.h"
Treehugger Robot [Tue, 18 Jul 2017 02:47:33 +0000 (02:47 +0000)]
Merge "Reference nativehelper/jni.h as jni.h"

7 years agoresolve merge conflicts of 8a094116b to stage-aosp-master
Ian Elliott [Mon, 17 Jul 2017 21:05:03 +0000 (15:05 -0600)]
resolve merge conflicts of 8a094116b to stage-aosp-master

Test: I solemnly swear I tested this conflict resolution.
Change-Id: I87e2955a7e44aa28eafacd44d404a23a1ae2e4a0

7 years agoMerge "Update the Khronos EGL and GLES* header files."
Treehugger Robot [Mon, 17 Jul 2017 19:54:28 +0000 (19:54 +0000)]
Merge "Update the Khronos EGL and GLES* header files."

7 years agoReference nativehelper/jni.h as jni.h
Steven Moreland [Mon, 17 Jul 2017 19:08:45 +0000 (12:08 -0700)]
Reference nativehelper/jni.h as jni.h

nativehelper will no longer export nativehelper/jni.h so that everywhere
can reference this file with the same name.

Bug: 63762847
Change-Id: Ifc3a3feb7578fd1352c25a3f55884ab75f337039

7 years agoUpdate the Khronos EGL and GLES* header files.
Ian Elliott [Thu, 6 Jul 2017 19:02:32 +0000 (13:02 -0600)]
Update the Khronos EGL and GLES* header files.

The latest Khronos header file contents are used.  Some
not-yet-registered Android extensions are added in, along with a few
data types that were accidentally deleted from "GLES/gl.h".  Note that
Khronos rearranged some of the content.

In addition, a repeat of a 2012 fix was required to avoid ANativeWindow
being declared twice during the compilation of source files which also
include "window.h".  Both "window.h" and "native_window.h" contain the
following line:  typedef struct ANativeWindow ANativeWindow;

I tested this by building Android as well as other source that includes
"window.h", and carefully compared diff's of the old and new content.

Bug: None
Test: Built Android

Merged-In: I5f908f88923378e4d121dfd5fbc11e4f210cbb2a
Change-Id: Ic40276fc8bc0b7120a11db34c3e59ebeec9c9f97

7 years agoMerge "Add getBinderKernelReferences"
Colin Cross [Thu, 13 Jul 2017 19:55:08 +0000 (19:55 +0000)]
Merge "Add getBinderKernelReferences"
am: 4bd6f567d5  -s ours

Change-Id: I42dcecfe9d49d60c1552bdb597a2f3c2001fd7ed

7 years agoMerge "Add getBinderKernelReferences"
Colin Cross [Thu, 13 Jul 2017 19:41:25 +0000 (19:41 +0000)]
Merge "Add getBinderKernelReferences"

7 years agoAdd getBinderKernelReferences
Colin Cross [Wed, 21 Jun 2017 00:48:33 +0000 (17:48 -0700)]
Add getBinderKernelReferences

Add a wrapper for the new BINDER_GET_NODE_DEBUG_INFO ioctl for use by
libmemunreachable.

Test: memunreachable_binder_test
Bug: 28275695
Change-Id: Ic112584fa05071bd336974b3a18869077a69389b
Merged-In: Ic112584fa05071bd336974b3a18869077a69389b
(cherry picked from commit b869cc94704d1a3d6226f471984eb33ff1bac7d5)

7 years agoAdd getBinderKernelReferences
Colin Cross [Wed, 21 Jun 2017 00:48:33 +0000 (17:48 -0700)]
Add getBinderKernelReferences

Add a wrapper for the new BINDER_GET_NODE_DEBUG_INFO ioctl for use by
libmemunreachable.

Test: memunreachable_binder_test
Bug: 28275695
Change-Id: Ic112584fa05071bd336974b3a18869077a69389b
Merged-In: Ic112584fa05071bd336974b3a18869077a69389b
(cherry picked from commit b869cc94704d1a3d6226f471984eb33ff1bac7d5)

7 years agoMerge "remove extraneous `using namespace android`"
Tom Cherry [Wed, 12 Jul 2017 00:54:21 +0000 (00:54 +0000)]
Merge "remove extraneous `using namespace android`"
am: 8e661076b6

Change-Id: Ie4c4191c448b78afddba31c712c6963238d92169

7 years agoMerge "remove extraneous `using namespace android`"
Tom Cherry [Wed, 12 Jul 2017 00:49:35 +0000 (00:49 +0000)]
Merge "remove extraneous `using namespace android`"

7 years agoremove extraneous `using namespace android`
Tom Cherry [Tue, 11 Jul 2017 21:25:01 +0000 (14:25 -0700)]
remove extraneous `using namespace android`

This namespace is not used by this file and its declaration is removed
in a separate CL from the only header that defines it, so remove this
extraneous line.

Test: Build
Change-Id: Ibec16b8889f4d886a9f9ec865d872e2437da034b

7 years agoMerge "vulkan: update Vulkan headers to 1.0.53"
Jesse Hall [Mon, 10 Jul 2017 14:29:17 +0000 (14:29 +0000)]
Merge "vulkan: update Vulkan headers to 1.0.53"
am: 38bcc110b8

Change-Id: I986ac1445697fb93fd72ab196087145a6b9945a0

7 years agoMerge "vulkan: update Vulkan headers to 1.0.53"
Treehugger Robot [Mon, 10 Jul 2017 14:19:19 +0000 (14:19 +0000)]
Merge "vulkan: update Vulkan headers to 1.0.53"

7 years agoMerge "Add target binderDriverInterfaceTest_IPC_32"
Hsin-Yi Chen [Mon, 10 Jul 2017 09:13:53 +0000 (09:13 +0000)]
Merge "Add target binderDriverInterfaceTest_IPC_32"
am: 86c1fa9527

Change-Id: I86a28976f575c314bcd74cb8edc18334ced9c575

7 years agoMerge "Add target binderDriverInterfaceTest_IPC_32"
Hsin-Yi Chen [Mon, 10 Jul 2017 09:06:14 +0000 (09:06 +0000)]
Merge "Add target binderDriverInterfaceTest_IPC_32"

7 years agoAdd target binderDriverInterfaceTest_IPC_32
Hsin-Yi Chen [Wed, 7 Jun 2017 10:05:05 +0000 (18:05 +0800)]
Add target binderDriverInterfaceTest_IPC_32

Add the target binderDriverInterfaceTest_IPC_32 which tests 32-bit
kernel and is independent from product_variables.

Bug: 62124459
Test: vts-tradefed run commandAndExit vts -m VtsKernelBinderTest
Change-Id: Ifad9ef24c35060179650955e24d1f046af7b7385

7 years agovulkan: update Vulkan headers to 1.0.53
Jesse Hall [Sat, 8 Jul 2017 00:13:23 +0000 (17:13 -0700)]
vulkan: update Vulkan headers to 1.0.53

Key changes since 1.0.49:
* Rename some extension enumerants to conform to naming style
* Add VK_EXT_sampler_filter_minmax
* Add VK_EXT_blend_operation_advanced
* Add VK_AMD_texture_gather_bias_lod
* Add VK_AMD_gpu_shader_int16
* Add VK_NV_fragment_coverage_to_color
* Add VK_NV_framebuffer_mixed_samples
* Add VK_NV_fill_rectangle

Test: build
Change-Id: I6b7931f4b7dfe4cae4fbc85fa961249534ccc11e

7 years agoMerge "vulkan: update Vulkan headers to 1.0.49"
Jesse Hall [Sat, 8 Jul 2017 05:11:03 +0000 (05:11 +0000)]
Merge "vulkan: update Vulkan headers to 1.0.49"
am: fa3c1590b9  -s ours

Change-Id: I1d22e6ffa33b6cd4479d6b09bb9d54c67f72ebfa

7 years agoMerge "vulkan: update Vulkan headers to 1.0.49"
Treehugger Robot [Sat, 8 Jul 2017 05:08:30 +0000 (05:08 +0000)]
Merge "vulkan: update Vulkan headers to 1.0.49"

7 years agoMerge "libbinder: really make it available to vendors"
Jiyong Park [Tue, 27 Jun 2017 00:42:42 +0000 (00:42 +0000)]
Merge "libbinder: really make it available to vendors"
am: 2bb661ca09

Change-Id: I58c2069544d39337b3a054a29fe8fdf98d00a33e

7 years agoMerge "libbinder: really make it available to vendors"
Treehugger Robot [Tue, 27 Jun 2017 00:35:48 +0000 (00:35 +0000)]
Merge "libbinder: really make it available to vendors"

7 years agolibbinder: really make it available to vendors
Jiyong Park [Fri, 14 Apr 2017 04:19:48 +0000 (21:19 -0700)]
libbinder: really make it available to vendors

Fixed a bug that vendor variant of the lib is not built due to missing
global include path.

Bug: 36426473
Bug: 36079834
Test: BOARD_VNDK_VERSION=current m -j libbinder.vendor successful

Change-Id: Ice32a23023d7fd9b78c084c3bef455f7008fe4da

7 years agoMerge "IWYU RegionHelper += <limits>" am: bbf3096e22
Steven Moreland [Fri, 23 Jun 2017 19:36:01 +0000 (19:36 +0000)]
Merge "IWYU RegionHelper += <limits>" am: bbf3096e22
am: f08008db9f

Change-Id: Ida5d67d96a8c3eb87f25202872b2c30ed5b6c25e

7 years agoMerge "IWYU RegionHelper += <limits>"
Steven Moreland [Fri, 23 Jun 2017 19:23:34 +0000 (19:23 +0000)]
Merge "IWYU RegionHelper += <limits>"
am: bbf3096e22

Change-Id: I9dd08e98eee2924554b623f755869fac35a80605

7 years agoMerge "IWYU RegionHelper += <limits>"
Treehugger Robot [Fri, 23 Jun 2017 19:18:41 +0000 (19:18 +0000)]
Merge "IWYU RegionHelper += <limits>"

7 years agoDisable setting saved_cmdline_size
John Reck [Fri, 23 Jun 2017 19:02:13 +0000 (19:02 +0000)]
Disable setting saved_cmdline_size
am: ba54d5baf4

Change-Id: Icd17c5257c03fd9e33114c5760ece6c21c74d025

7 years agoIWYU RegionHelper += <limits>
Steven Moreland [Fri, 23 Jun 2017 17:23:41 +0000 (10:23 -0700)]
IWYU RegionHelper += <limits>

Test: compiles when transitive dependency is removed
Bug: 35363681
Change-Id: Ia405e41102e6ded07720e424167df7e4d080581e

7 years agoDisable setting saved_cmdline_size
John Reck [Fri, 23 Jun 2017 16:44:08 +0000 (09:44 -0700)]
Disable setting saved_cmdline_size

Minimal revert of the addition of increasing
the saved_cmdline_size. This change
exposed kernel bugs that prevented
atrace from working.

Bug: 62375794
Test: manual
Change-Id: Ie946b9246ce9ba22af59dbf0b9fe8a59a5fa1f3f

7 years agoMerge "surfaceflinger: discard stale commands" into oc-dev
Chia-I Wu [Thu, 22 Jun 2017 20:07:16 +0000 (20:07 +0000)]
Merge "surfaceflinger: discard stale commands" into oc-dev
am: f8ca9a0875

Change-Id: I6b7ce1798d2fe753c577ff3baa954283c372b80c

7 years agoMerge "LibGUI remove DEBUG" into oc-dev
Fabien Sanglard [Thu, 22 Jun 2017 20:06:51 +0000 (20:06 +0000)]
Merge "LibGUI remove DEBUG" into oc-dev
am: be597daebd

Change-Id: Iece9f1428655c8674cf62a92ecb0a088ad74b629

7 years agoDisable skip Validate on client composition
Fabien Sanglard [Thu, 22 Jun 2017 20:06:31 +0000 (20:06 +0000)]
Disable skip Validate on client composition
am: 269c236109

Change-Id: I4c0a4a90ff0ca2e39075ad643d1892597301d3fd

7 years agoMerge "surfaceflinger: discard stale commands" into oc-dev
Chia-I Wu [Thu, 22 Jun 2017 19:59:35 +0000 (19:59 +0000)]
Merge "surfaceflinger: discard stale commands" into oc-dev

7 years agoMerge "LibGUI remove DEBUG" into oc-dev
Fabien Sanglard [Thu, 22 Jun 2017 19:56:29 +0000 (19:56 +0000)]
Merge "LibGUI remove DEBUG" into oc-dev

7 years agoDisable skip Validate on client composition
Fabien Sanglard [Thu, 22 Jun 2017 18:35:16 +0000 (11:35 -0700)]
Disable skip Validate on client composition

SurfaceFlinger should not skip validate when GLComposition is
needed. This can happen when SF decides to force GLComposition
(like when a screen rotation occurs).

Bug: 62906801
Test: Manual
Change-Id: I248146eade395a124cb149773287abd88ae36511

7 years agosurfaceflinger: discard stale commands
Chia-I Wu [Thu, 22 Jun 2017 17:48:28 +0000 (10:48 -0700)]
surfaceflinger: discard stale commands

When we skip validate, we may have stale commands on the command
buffer.  They should be discarded.

Bug: 62906801
Test: manual
Change-Id: Ie7921ba75ab2252b834cda6924e1fcfdf236f759

7 years agoLibGUI remove DEBUG
Fabien Sanglard [Thu, 22 Jun 2017 18:13:49 +0000 (11:13 -0700)]
LibGUI remove DEBUG

DEBUG_ONLY_CODE flag enables expensive checks such as
BufferQueueCore::validateConsistencyLocked() which when running
represents 15.1% of SurfaceFlinger total runtime. Enabling these
check for "eng" build only make "userdebug" build closer to "user".

Test: Manual
Bug: 62905241
Change-Id: I77065ecf4e62261c3f02b1cad9966d5c4845c639

7 years agoSkip Validate
Fabien Sanglard [Thu, 22 Jun 2017 05:57:15 +0000 (05:57 +0000)]
Skip Validate
am: 249c0ae80a

Change-Id: I55a564d600a422915f43111f4e02a10857512fcf

7 years agoSkip Validate
Fabien Sanglard [Tue, 20 Jun 2017 02:22:36 +0000 (19:22 -0700)]
Skip Validate

b/37474580
b/62806392

Test: marlin, ryu

Change-Id: I09e0c52cb7c914dcd883dc771d97a365c89f7037

7 years agoMerge "Move include/binder to libs/binder/include" am: d46d9f1243
Jiyong Park [Wed, 21 Jun 2017 00:44:55 +0000 (00:44 +0000)]
Merge "Move include/binder to libs/binder/include" am: d46d9f1243
am: b212140bbf  -s ours

Change-Id: If344d9c14b3cf767956d55e0dd5d13b5a700c7a4

7 years agoMerge "Move include/binder to libs/binder/include"
Jiyong Park [Wed, 21 Jun 2017 00:40:25 +0000 (00:40 +0000)]
Merge "Move include/binder to libs/binder/include"
am: d46d9f1243

Change-Id: I41744e18ca3731b3027cb459b97945270a4d94ef

7 years agoMerge "Move include/binder to libs/binder/include"
Treehugger Robot [Wed, 21 Jun 2017 00:27:49 +0000 (00:27 +0000)]
Merge "Move include/binder to libs/binder/include"

7 years agoMerge "surfaceflinger: fix a potential child layer leak" into oc-dev
Chia-I Wu [Tue, 20 Jun 2017 20:28:58 +0000 (20:28 +0000)]
Merge "surfaceflinger: fix a potential child layer leak" into oc-dev
am: 1b02b6329e

Change-Id: I3548aaa0a071f5b1009c5b1070405a09d7841095

7 years agoMerge "surfaceflinger: fix a potential child layer leak" into oc-dev
TreeHugger Robot [Tue, 20 Jun 2017 20:15:29 +0000 (20:15 +0000)]
Merge "surfaceflinger: fix a potential child layer leak" into oc-dev

7 years agoMerge "Fix minor version bump reflected in lshal --init-vintf" am: ac6575097d
Yifan Hong [Tue, 20 Jun 2017 04:52:23 +0000 (04:52 +0000)]
Merge "Fix minor version bump reflected in lshal --init-vintf" am: ac6575097d
am: 99065302ed

Change-Id: Ic2a1f895312dee90e9e0eaf691edb48df4897c4e

7 years agoMerge "Fix minor version bump reflected in lshal --init-vintf"
Yifan Hong [Tue, 20 Jun 2017 01:10:56 +0000 (01:10 +0000)]
Merge "Fix minor version bump reflected in lshal --init-vintf"
am: ac6575097d

Change-Id: I05dafdba2c7f302dc6200bd2d274e30a33f77de7

7 years agoMerge "Fix minor version bump reflected in lshal --init-vintf"
Treehugger Robot [Tue, 20 Jun 2017 01:06:52 +0000 (01:06 +0000)]
Merge "Fix minor version bump reflected in lshal --init-vintf"

7 years agoMerge "Fix incorrect bitness for lshal --init-vintf" am: e162a97703
Yifan Hong [Mon, 19 Jun 2017 23:08:15 +0000 (23:08 +0000)]
Merge "Fix incorrect bitness for lshal --init-vintf" am: e162a97703
am: 126eee4d14

Change-Id: I435466a45aa5217f99c73007d5f07c1754216995

7 years agoMerge "Fix incorrect bitness for lshal --init-vintf"
Yifan Hong [Mon, 19 Jun 2017 23:02:08 +0000 (23:02 +0000)]
Merge "Fix incorrect bitness for lshal --init-vintf"
am: e162a97703

Change-Id: Ib59a256b4491b2bf93e8eca1fa85d9a193719446

7 years agoMerge "Fix incorrect bitness for lshal --init-vintf"
Treehugger Robot [Mon, 19 Jun 2017 22:51:52 +0000 (22:51 +0000)]
Merge "Fix incorrect bitness for lshal --init-vintf"

7 years agoFix minor version bump reflected in lshal --init-vintf
Yifan Hong [Mon, 19 Jun 2017 22:47:39 +0000 (15:47 -0700)]
Fix minor version bump reflected in lshal --init-vintf

Test: lshal --init-vintf has no warnings, and power@1.1 / vibrator@1.1
      is shown in output.

Bug: 62675393
Change-Id: I1ffd8b6dc7fcadcf7228cf2b8838e918bb3afe6b
Merged-In: I1ffd8b6dc7fcadcf7228cf2b8838e918bb3afe6b

7 years agoFix incorrect bitness for lshal --init-vintf
Yifan Hong [Mon, 19 Jun 2017 19:27:08 +0000 (12:27 -0700)]
Fix incorrect bitness for lshal --init-vintf

Test: lshal --init-vintf, graphics.mapper has 32+64.

Change-Id: Ic586c8333064cc5636679ce8ad4e1231307191f4
Merged-In: Ic586c8333064cc5636679ce8ad4e1231307191f4
Fixes: 62675393

7 years agoMerge changes from topic 'layer-wp-race' into oc-dev
Chia-I Wu [Sat, 17 Jun 2017 01:58:31 +0000 (01:58 +0000)]
Merge changes from topic 'layer-wp-race' into oc-dev
am: a17b14eb92

Change-Id: I2fb898abae8b4602aa7257b45293f582f0641f24

7 years agoMerge changes from topic 'layer-wp-race' into oc-dev
TreeHugger Robot [Sat, 17 Jun 2017 01:51:06 +0000 (01:51 +0000)]
Merge changes from topic 'layer-wp-race' into oc-dev

* changes:
  surfaceflinger: Layer::getParent requires state lock held
  surfaceflinger: distinguish mCurrentParent/mDrawingParent
  surfaceflinger: protect Client::mParentLayer with a lock

7 years agosurfaceflinger: fix a potential child layer leak
Chia-I Wu [Thu, 15 Jun 2017 19:53:59 +0000 (12:53 -0700)]
surfaceflinger: fix a potential child layer leak

We should not remove a child layer from its already removed parent.
Call p->removeChild only after we've checked that the ancestor is
alive.

Apply e6b63e1ae12692327f7e46d5f10d6ade5a7bf192 and this fix to
SurfaceFlinger_hwc1.cpp as well.

Bug: 37121786
Test: manual stress test
Change-Id: I7b811450a998acc4ad9690bd4eda058ce6588e14

7 years agosurfaceflinger: Layer::getParent requires state lock held
Chia-I Wu [Thu, 15 Jun 2017 19:53:59 +0000 (12:53 -0700)]
surfaceflinger: Layer::getParent requires state lock held

We rely on mStateLock to synchronize accesses to
Layer::mCurrentParent.

Bug: 38505866
Test: manual stress test
Change-Id: I5f8ec358ed7e35df28f8c6aec31ae6ee51cb5b93

7 years agoAdd method to explicitly create Surface.
Bryce Lee [Fri, 16 Jun 2017 23:24:46 +0000 (23:24 +0000)]
Add method to explicitly create Surface.
am: 4e623e259c

Change-Id: Ie3755008a75dc67f1d01a0a5fc8bf4e953c8cf9d

7 years agoAdd method to explicitly create Surface.
Bryce Lee [Fri, 16 Jun 2017 14:06:17 +0000 (07:06 -0700)]
Add method to explicitly create Surface.

It is sometimes necessary for a SurfaceControl client to request the
associated Surface object be created rather than reuse the cached
value. This changelist adds an additional method that performs the
same creation operations as if the Surface object was created for the
first time.

Bug: 62108743
Test: go/wm-smoke
Change-Id: I2f460f20b2d16ed9ff81cb36842bcd2f8641e03c

7 years agosurfaceflinger: distinguish mCurrentParent/mDrawingParent
Chia-I Wu [Tue, 13 Jun 2017 21:10:56 +0000 (14:10 -0700)]
surfaceflinger: distinguish mCurrentParent/mDrawingParent

Updates to wp<> is not atomic.  We cannot use/update it at the same
time from the main thread and a binder thread.  With this change,
binder threads use mCurrentParent with the external state lock held.
The main thread uses mDrawingParent.

This is also an alternative fix to bug 62099658 and allows us to
revert "SurfaceFlinger: Update parent pointer while performing
transaction."

Bug: 38505866
Bug: 62099658
Test: boots and no repro (but I can never repro)
Change-Id: Id286a437537daaeec5eee5de62b1d9df245ece53

7 years agosurfaceflinger: protect Client::mParentLayer with a lock
Chia-I Wu [Thu, 15 Jun 2017 21:01:18 +0000 (14:01 -0700)]
surfaceflinger: protect Client::mParentLayer with a lock

Updates to wp<> is not atomic.  Use Client::mLock to protect
mParentLayer.

Bug: 38505866
Test: camera and youtube work
Change-Id: I2739382d5bb99961a47c1011963b6f676d34eec6

7 years agoMove include/binder to libs/binder/include
Jiyong Park [Fri, 16 Jun 2017 06:16:33 +0000 (15:16 +0900)]
Move include/binder to libs/binder/include

Also moved include/private/binder to libs/binder/include/private/binder.
This allows libbinder to be compiled without depending on global
headers.

Bug: 33241851
Test: Build, flash, and run sailfish.
Test: Try building with BOARD_VNDK_VERSION := current
Change-Id: I266d5338677a92dd0563b311a479e7ad27bbaf55
Merged-In: I0a82b733353add589de26eb2db7af5a246e5c97f

7 years agoFix getDisplayInfo() for SurfaceFlinger in HWC2 mode.
Alistair Strachan [Thu, 15 Jun 2017 17:30:17 +0000 (17:30 +0000)]
Fix getDisplayInfo() for SurfaceFlinger in HWC2 mode.
am: c175253b6d

Change-Id: I8a1db090809ec0354dda54a6202ff92b76681bb4

7 years agoFix getDisplayInfo() for SurfaceFlinger in HWC2 mode.
Alistair Strachan [Wed, 7 Jun 2017 23:34:44 +0000 (16:34 -0700)]
Fix getDisplayInfo() for SurfaceFlinger in HWC2 mode.

When HWC2 mode is enabled in SurfaceFlinger, the getDisplayInfo()
function would fail to return the correct active mode in some cases.

This bug was only noticable if you had more than one mode registered
by the HWC2 backend.

The SurfaceComposerClient::getDisplayInfo() function works by calling
getDisplayConfigs(), and de-referencing the config at the index
returned by getActiveConfig(). The active config returned was correct,
but the getDisplayConfigs() array was not properly sorted.

Tracing this back, this problem occurs because the configId is stored
alongside the config in an unordered_map, so when this is converted
to a vector and the configId is discarded, the conversion must be
sorted correctly; it can't just be the hash order returned from
the unordered_map.

There are a few ways to fix this problem, but the easiest was to nip
the problem in the bud by not allowing an unsorted list of configs
to exist on the base HWC2 class. It may be better still to just get
rid of the map and go back to a vector, as this data is more often
used as an array than it is indexed by configId, so the use of an
unordered_map was probably overkill.

Change-Id: Ibfb015a6d9b49c870f37a1c892f15f90abbd1e2c
Bug: 62617569
Test: ./cts-tradefed run cts -m CtsViewTestCases -t android.view.cts.DisplayRefreshRateTest#testRefreshRate

7 years agoMerge changes Ibc1444b8,I14c200d1 into oc-dev
Eino-Ville Talvala [Wed, 14 Jun 2017 08:13:00 +0000 (08:13 +0000)]
Merge changes Ibc1444b8,I14c200d1 into oc-dev
am: fd43dc6723

Change-Id: I7a63dd4d785a3bc4e386cc10a427b12d678e7b28

7 years agoMerge changes Ibc1444b8,I14c200d1 into oc-dev
Eino-Ville Talvala [Wed, 14 Jun 2017 08:09:40 +0000 (08:09 +0000)]
Merge changes Ibc1444b8,I14c200d1 into oc-dev

* changes:
  ConsumerBase: discardFreeBuffers() also needs to dump its own cache
  BufferQueueProducer: Call onBuffersReleased() in detachNextBuffer

7 years agoMerge changes from topic 'sensor_looper_crash' into oc-dev
Peng Xu [Wed, 14 Jun 2017 06:20:49 +0000 (06:20 +0000)]
Merge changes from topic 'sensor_looper_crash' into oc-dev
am: 638055ef41

Change-Id: Ib48966c671e1cedb7ed1d26498b8389a62e30921

7 years agoSensorManager: attach background thread to JavaVM
Yifan Hong [Wed, 14 Jun 2017 06:20:40 +0000 (06:20 +0000)]
SensorManager: attach background thread to JavaVM
am: 09034f076e

Change-Id: Ib32d5a33c7de35d9d1181fc737848ba63fe94171

7 years agoFramework sensor manager init not depends on ::android::SensorManager.
Yifan Hong [Wed, 14 Jun 2017 06:20:31 +0000 (06:20 +0000)]
Framework sensor manager init not depends on ::android::SensorManager.
am: 542eace6bf

Change-Id: I8228b3afec41260135c4123fe8cd9e9dc99f46e5

7 years agoMerge changes from topic 'sensor_looper_crash' into oc-dev
Peng Xu [Wed, 14 Jun 2017 06:12:37 +0000 (06:12 +0000)]
Merge changes from topic 'sensor_looper_crash' into oc-dev

* changes:
  Fix race condition for SensorManager looper.
  SensorManager: attach background thread to JavaVM
  Framework sensor manager init not depends on ::android::SensorManager.

7 years agoFix race condition for SensorManager looper.
Yifan Hong [Wed, 14 Jun 2017 01:04:25 +0000 (18:04 -0700)]
Fix race condition for SensorManager looper.

Before the fix there could be two background threads started for two
loopers. Add a guard to prevent this from happening.

Test: pass
Bug: 62404135
Change-Id: I8230addaaa6b83670d7b83c96809b00fca95d352

7 years agoSensorManager: attach background thread to JavaVM
Yifan Hong [Wed, 14 Jun 2017 00:51:13 +0000 (17:51 -0700)]
SensorManager: attach background thread to JavaVM

Test: pass
Bug: 62404135

Change-Id: I63a128c3c933904211f5ff2483492674eaba93ed

7 years agoFramework sensor manager init not depends on ::android::SensorManager.
Yifan Hong [Tue, 9 May 2017 22:18:02 +0000 (15:18 -0700)]
Framework sensor manager init not depends on ::android::SensorManager.

Test: photo sphere
Change-Id: Ice37a758421827757226a9898bcf3e00857443ff
Merged-In: Ice37a758421827757226a9898bcf3e00857443ff
Fixes: 36448245

7 years agoConsumerBase: discardFreeBuffers() also needs to dump its own cache
Eino-Ville Talvala [Wed, 14 Jun 2017 00:09:11 +0000 (17:09 -0700)]
ConsumerBase: discardFreeBuffers() also needs to dump its own cache

ConsumerBase has its own cached slots with graphic buffer references,
so it's not enough to just ask the buffer queue consumer to free
buffers.

Add code equivalent to what happens in the onBuffersReleased callback.

Test:
Bug: 62593139
Change-Id: Ibc1444b868c6150aa2da1c209e06bdba42f1595d

7 years agoBufferQueueProducer: Call onBuffersReleased() in detachNextBuffer
Eino-Ville Talvala [Tue, 13 Jun 2017 23:39:11 +0000 (16:39 -0700)]
BufferQueueProducer: Call onBuffersReleased() in detachNextBuffer

Like detachBuffer(), detachNextBuffer() needs to inform the consumer,
who generally has a cache of buffer items, that a buffer is no longer
owned by the buffer queue.

Otherwise the consumer layer can leak the buffer reference until
consumer teardown/disconnect.

Test: Camera CTS is fine, using a camera app shows correct memory
  behavior
Bug: 62591036

Change-Id: I14c200d13e60dbbe21261343941f84fb786db117

7 years agoatrace.rc: Correct path to saved_cmdlines_size when setting permission
Joel Fernandes [Tue, 13 Jun 2017 20:18:14 +0000 (20:18 +0000)]
atrace.rc: Correct path to saved_cmdlines_size when setting permission
am: 922e418f45

Change-Id: I99862d8e16d1c10405a696b89553a855881c967a

7 years agoatrace.rc: Correct path to saved_cmdlines_size when setting permission
Joel Fernandes [Tue, 13 Jun 2017 03:47:27 +0000 (20:47 -0700)]
atrace.rc: Correct path to saved_cmdlines_size when setting permission

Bug: 62375794
Test: CTS test

Change-Id: Ie252be152ba26aced63af55734d3155ad93f2919
Signed-off-by: Joel Fernandes <joelaf@google.com>
(cherry picked from commit 0094a2d5962ed81c6c624c900450d84f1967ba49)

7 years agoMerge "Add missing VNDK pixel formats to AHardwareBuffer" into oc-dev
Mathias Agopian [Fri, 9 Jun 2017 19:39:25 +0000 (19:39 +0000)]
Merge "Add missing VNDK pixel formats to AHardwareBuffer" into oc-dev
am: 2563c0f3b0

Change-Id: Iba3dfbfcbaa778da25de68a16beee024ac1b6efe

7 years agoMerge "Add missing VNDK pixel formats to AHardwareBuffer" into oc-dev
Mathias Agopian [Fri, 9 Jun 2017 19:02:45 +0000 (19:02 +0000)]
Merge "Add missing VNDK pixel formats to AHardwareBuffer" into oc-dev

7 years agoFix build
Jorim Jaggi [Fri, 9 Jun 2017 07:59:34 +0000 (07:59 +0000)]
Fix build
am: aaef0983ba

Change-Id: I087952f069da1ba624bef32d1ac913a242533321

7 years agoFix build
Jorim Jaggi [Fri, 9 Jun 2017 06:55:29 +0000 (23:55 -0700)]
Fix build

Test: builds
Bug: 36631902
Change-Id: Iec23f8ab2b16c923f07d1857aa3471cfefc057dd

7 years agoProperly run window animations at vsync-sf (2/2)
Jorim Jaggi [Fri, 9 Jun 2017 04:16:44 +0000 (04:16 +0000)]
Properly run window animations at vsync-sf (2/2)
am: b1e2f8deb3

Change-Id: I2cf08e016fcd177117d7135d211e2676a1945eba

7 years agoAdd missing VNDK pixel formats to AHardwareBuffer
Mathias Agopian [Fri, 9 Jun 2017 02:44:17 +0000 (19:44 -0700)]
Add missing VNDK pixel formats to AHardwareBuffer

AHardwareBuffer is now the only API available to
vendors to create graphic buffers in their HAL
implementations, unfortunately AHardwareBuffer
was designed for NDK use and was missing all
HAL specific pixel formats.

This CL adds these missing format to the VNDK-only
header.

The implementation is changed to accept all formats
which means, VNDK formats are indirectly exposed
to the NDK.

Bug: 38466076
Test: manual
Change-Id: I1e752cd33641aa861d9d15432cde6bec5a682e9a

7 years agoProperly run window animations at vsync-sf (2/2)
Jorim Jaggi [Thu, 8 Jun 2017 22:43:59 +0000 (15:43 -0700)]
Properly run window animations at vsync-sf (2/2)

- Add new Choreographer instance that runs on vsync-sf
- Use this new Choreographer for WindowAnimator, and remove all
the hacks around it

Test: Open apps and close apps, notice no stutter
Test: Screen zoom animations
Test: go/wm-smoke
Bug: 36631902
Change-Id: I72a8b39709303a38fc077100229b8a81a153ba3e

7 years agoMerge "Don't double-count external cached app data." into oc-dev
Jeff Sharkey [Thu, 8 Jun 2017 15:34:49 +0000 (15:34 +0000)]
Merge "Don't double-count external cached app data." into oc-dev
am: b5a1f50f5e

Change-Id: Ia991cb98e842a9a9f64e669435c860611e79ff72

7 years agoMerge "Don't double-count external cached app data." into oc-dev
Jeff Sharkey [Thu, 8 Jun 2017 15:27:07 +0000 (15:27 +0000)]
Merge "Don't double-count external cached app data." into oc-dev

7 years agoMerge "No more ashmem equivalent checker false alarm" into oc-dev
Peng Xu [Thu, 8 Jun 2017 10:23:02 +0000 (10:23 +0000)]
Merge "No more ashmem equivalent checker false alarm" into oc-dev
am: d6d91e5833

Change-Id: I754b5d0d1e9426efa07821eba8a6ca6c826914cf

7 years agoMerge "No more ashmem equivalent checker false alarm" into oc-dev
TreeHugger Robot [Thu, 8 Jun 2017 10:16:09 +0000 (10:16 +0000)]
Merge "No more ashmem equivalent checker false alarm" into oc-dev

7 years agoMerge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw...
Matthew Bouyack [Wed, 7 Jun 2017 23:05:31 +0000 (23:05 +0000)]
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev am: 9e5585930a am: f613f073b2  -s ours
am: 4c0bb0a09a

Change-Id: I7872b8894502b9286206f7d73563634a3ac34c3b

7 years agoMerge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw...
Matthew Bouyack [Wed, 7 Jun 2017 22:59:18 +0000 (22:59 +0000)]
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev am: 9e5585930a
am: f613f073b2  -s ours

Change-Id: I8a6e0a9b7e7810cfc33db9de074c2cdac139d233

7 years agoMerge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw...
Matthew Bouyack [Wed, 7 Jun 2017 22:53:37 +0000 (22:53 +0000)]
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev
am: 9e5585930a

Change-Id: I3b534f26c60bd8d6cf0736da7de807cf339a1cdd

7 years agoMerge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw...
Matthew Bouyack [Wed, 7 Jun 2017 22:46:08 +0000 (22:46 +0000)]
Merge "DO NOT MERGE: Eliminate redundant changes to hardware vsync state." into cw-f-dev

7 years agoDO NOT MERGE: Eliminate redundant changes to hardware vsync state.
Matthew Bouyack [Thu, 1 Jun 2017 21:37:29 +0000 (14:37 -0700)]
DO NOT MERGE: Eliminate redundant changes to hardware vsync state.

When transitioning between NORMAL and DOZE power modes
we were redundantly calling resyncHardwareVsync.

Similarly, when transitioning from DOZE_SUSPEND to OFF
we were redundantly calling disableHardwareVsync.

This change eliminates those redundant calls.

Fixes bug 62235417

Change-Id: I513bbf94a7ab973ab258efe16436441ac2379b70

7 years agoDon't double-count external cached app data.
Jeff Sharkey [Wed, 7 Jun 2017 21:59:03 +0000 (15:59 -0600)]
Don't double-count external cached app data.

Cached app data is already counted in extStats.dataSize, so we don't
need to count it twice.

Test: builds, boots, verified Settings UI before/after
Bug: 62343684
Change-Id: Ic02cbe3f5938949730f9bc8d911ed398436f84d7

7 years agoNo crash from AHardwareBuffer_unlock on NULL fence
Jiwen 'Steve' Cai [Wed, 7 Jun 2017 19:30:46 +0000 (19:30 +0000)]
No crash from AHardwareBuffer_unlock on NULL fence
am: ae6955fda8

Change-Id: Iaedc2bbf55cf369b9c273678a0787572826b8f72

7 years agoNo crash from AHardwareBuffer_unlock on NULL fence
Jiwen 'Steve' Cai [Fri, 2 Jun 2017 22:23:26 +0000 (15:23 -0700)]
No crash from AHardwareBuffer_unlock on NULL fence

The API document states: "If fence is not NULL then it will be set to a
file descriptor that is signaled when all pending work on the buffer is
completed." As it's too late to change the document, we should probably
update the implement and use GraphicsBuffer::unlock under the hood.

Bug: 62302267
Test: Build, AHardware CTS
Change-Id: Ic0fac5d7addfba67baaa1b5d7c221fc25d02df56
(cherry picked from commit 6cdbb537105b663572e71afe06bde1164fc215f3)

7 years agoDo not use default initializer for union
Yi Kong [Thu, 11 May 2017 18:51:08 +0000 (11:51 -0700)]
Do not use default initializer for union

The next Clang update complains about this code pattern. Rewrite default
constructor to explicitly initialize the union field instead of using
the default initializer.

Test: Build
Bug: 37752547
Change-Id: I22a2aa392d7f4803282baed832b0fa2f852016ac
(cherry picked from commit 4fdbdd1692a549a31382f33f5d529fd141453ea1)

7 years agoatrace: setup saved_cmdlines_size and write only if available
Joel Fernandes [Tue, 6 Jun 2017 20:54:50 +0000 (20:54 +0000)]
atrace: setup saved_cmdlines_size and write only if available
am: 9351f72049

Change-Id: I6ac54d96cda205bc5d4e4d569b03b2064140e310

7 years agoatrace: setup saved_cmdlines_size and write only if available
Joel Fernandes [Tue, 6 Jun 2017 19:20:29 +0000 (12:20 -0700)]
atrace: setup saved_cmdlines_size and write only if available

Older kernels (bullhead etc) don't have saved_cmdlines_size, check and
write only if available. Also make work on non-root by setting
permissions in rc file (thanks John Reck for suggestion).

Bug: 62375794

Change-Id: Iefffc3203afd092ffb6cf420a144b38844aaee39
Signed-off-by: Joel Fernandes <joelaf@google.com>
7 years agoMerge "Revert "Disable in-place vdex update"" into oc-dev
Nicolas Geoffray [Tue, 6 Jun 2017 20:38:42 +0000 (20:38 +0000)]
Merge "Revert "Disable in-place vdex update"" into oc-dev
am: 7258088ea5

Change-Id: I3e36f53541ccac1cccd2361d4d6b752e8e881668