OSDN Git Service

android-x86/frameworks-native.git
7 years agoMerge "pdx: Rework error reporting when transfering file and channel handles" into...
Alex Vakulenko [Tue, 4 Apr 2017 15:31:24 +0000 (15:31 +0000)]
Merge "pdx: Rework error reporting when transfering file and channel handles" into oc-dev

7 years agoMerge "Remove driver workaround" into oc-dev
Courtney Goeltzenleuchter [Tue, 4 Apr 2017 12:59:41 +0000 (12:59 +0000)]
Merge "Remove driver workaround" into oc-dev

7 years agoMerge "Fix typo causing GL_EXT_debug_marker to disappear" into oc-dev
TreeHugger Robot [Tue, 4 Apr 2017 05:57:05 +0000 (05:57 +0000)]
Merge "Fix typo causing GL_EXT_debug_marker to disappear" into oc-dev

7 years agoMerge changes from topic 'sensors_framework_hal' into oc-dev
TreeHugger Robot [Tue, 4 Apr 2017 05:43:52 +0000 (05:43 +0000)]
Merge changes from topic 'sensors_framework_hal' into oc-dev

* changes:
  android.frameworks.sensorservice@1.0: make classes final
  android.frameworks.sensorservice@1.0: ashmem direct channel check sizes.
  android.frameworks.sensorservice@1.0: fix configureDirectChannel return positive integer.
  Implement android.frameworks.sensorservice@1.0::IEventQueue.
  Renamed HIDL SensorManager::mManager -> mInternalManager.

7 years agoMerge "ANativeWindow_toSurface header" into oc-dev
TreeHugger Robot [Tue, 4 Apr 2017 04:30:11 +0000 (04:30 +0000)]
Merge "ANativeWindow_toSurface header" into oc-dev

7 years agoMerge "vndservicemanager: load vendor service_contexts." into oc-dev
Martijn Coenen [Tue, 4 Apr 2017 03:41:46 +0000 (03:41 +0000)]
Merge "vndservicemanager: load vendor service_contexts." into oc-dev

7 years agoANativeWindow_toSurface header
Jiwen 'Steve' Cai [Fri, 31 Mar 2017 18:19:37 +0000 (11:19 -0700)]
ANativeWindow_toSurface header

This enables the conversion from an ANativeWindow (created by NDK API
such as: AImageReader_create) to a Java Surface, so that developers can
hookup a Java Producer to a native buffer consumer.

Bug: 36862948
Test: android.media.cts.NativeImageReaderTest
Change-Id: I11962bc791680a62579e51c32f2d51911cac48f8

7 years agoandroid.frameworks.sensorservice@1.0: make classes final
Yifan Hong [Tue, 4 Apr 2017 02:08:16 +0000 (19:08 -0700)]
android.frameworks.sensorservice@1.0: make classes final

Make SensorManager and DirectReportChannel final.

Test: pass
Change-Id: Idc7f7fcacf1ad1ad6282a603538529ff99f88184

7 years agoandroid.frameworks.sensorservice@1.0: ashmem direct channel check sizes.
Yifan Hong [Mon, 3 Apr 2017 21:59:47 +0000 (14:59 -0700)]
android.frameworks.sensorservice@1.0: ashmem direct channel check sizes.

Test: VtsHalSensorManagerV1_0TargetTest
Change-Id: I18b87128da2607f82ffddb260bf440786c378010

7 years agoandroid.frameworks.sensorservice@1.0: fix configureDirectChannel return positive...
Yifan Hong [Mon, 3 Apr 2017 19:52:24 +0000 (12:52 -0700)]
android.frameworks.sensorservice@1.0: fix configureDirectChannel return positive integer.

SensorManager::configureDirectChannel can return a positive integer
as the token to indicate success. android.frameworks.sensorservice@1.0
doesn't care about the token.

Test: VtsHalSensorManagerV1_0TargetTest
Change-Id: I6bcbbe5dc747a0d93d2a0fd37f0b7187cb681101

7 years agoImplement android.frameworks.sensorservice@1.0::IEventQueue.
Yifan Hong [Wed, 29 Mar 2017 02:07:17 +0000 (19:07 -0700)]
Implement android.frameworks.sensorservice@1.0::IEventQueue.

Test: pass
Bug: 35219747
Change-Id: I52ddd64db500c23db22768fc0603bce0cc14f8c6

7 years agoMerge "Add VNDK API to access AHardwareBuffer from ANativeWindowBuffer" into oc-dev
Mathias Agopian [Tue, 4 Apr 2017 01:49:08 +0000 (01:49 +0000)]
Merge "Add VNDK API to access AHardwareBuffer from ANativeWindowBuffer" into oc-dev

7 years agoVR: Update VR Window Manager to use the VR Hardware Composer service
Daniel Nicoara [Fri, 10 Mar 2017 18:02:09 +0000 (13:02 -0500)]
VR: Update VR Window Manager to use the VR Hardware Composer service

Decouples VR HWC from VR Window Manager.

Bug: 36051907
Test: Compiled and ran on device in VR mode.
Change-Id: Ifd76e742148765b3cf3e71b0cf538b920814eb7b

7 years agoFix typo causing GL_EXT_debug_marker to disappear
Pyry Haulos [Tue, 4 Apr 2017 01:22:58 +0000 (18:22 -0700)]
Fix typo causing GL_EXT_debug_marker to disappear

Android EGL wrapper is supposed to always insert GL_EXT_debug_marker
implementation. A small typo in recent refactoring broke this logic.

Bug: 36865892
Test: dEQP-GLES2.functional.debug_marker.supported

7 years agoMerge "Surface: add getRemovedBuffer API" into oc-dev
TreeHugger Robot [Tue, 4 Apr 2017 00:33:14 +0000 (00:33 +0000)]
Merge "Surface: add getRemovedBuffer API" into oc-dev

7 years agoMerge "add surfaceflinger and servicemanager to animation class" into oc-dev
TreeHugger Robot [Mon, 3 Apr 2017 23:51:34 +0000 (23:51 +0000)]
Merge "add surfaceflinger and servicemanager to animation class" into oc-dev

7 years agopdx: Rework error reporting when transfering file and channel handles
Alex Vakulenko [Sat, 1 Apr 2017 01:06:19 +0000 (18:06 -0700)]
pdx: Rework error reporting when transfering file and channel handles

There is a lot of confusion about reporting errors when passing file
and channel handles over PDX transport between client and service.

Methods like Message::PushFileHandle return an integer which means
both a file handle reference value (if positive) and a possible error
code (if negative). But file handles could contain negative values too
(when they are empty). This is used frequently when passing buffer
fences around (when a fence is not being used, its fd is set to -1).

This results in a special case of when PushFileHandle is called with
a file handle with value of -1, the return value is actually "-errno"
which becomes dependent on a global state (errno is not set by
PushFileHandle itself in case file handle value is negative) and results
in unpredicted behavior (sometimes errno is 0, sometimes its >0).

Cleaned this all up by using Status<T> everywhere we used an int to
pass value payload along with possible error code.

Now the semantics of the calls are more clear.

Bug: 36866492
Test: `m -j32` for sailfish-eng succeeds
      Ran unit tests on device (pdx_tests, libpdx_uds_tests, bufferhub_tests,
      buffer_hub_queue-test, buffer_hub_queue_producer-test), all pass
      Ran CubeSea, NativeTreasureHunt and Ithaca on Sailfish with vrflinger
      enabled, was able to use controller and screen rendered correctly.

Change-Id: I0f40c3f356fcba8bc217d5219a0ddf9685e57fd7

7 years agoRemove driver workaround
Courtney Goeltzenleuchter [Mon, 3 Apr 2017 22:11:30 +0000 (16:11 -0600)]
Remove driver workaround

Appears that the workaround for bug #34177594 is no longer
necessary, so removing.
Bug: 34177594
Test: Run Vulkan app

Change-Id: Id574760bdea775ac7541a9657b5a8124eb9064ef

7 years agoMerge "Use gralloc1 usage in AHardwareBuffer_describe" into oc-dev
TreeHugger Robot [Mon, 3 Apr 2017 22:54:33 +0000 (22:54 +0000)]
Merge "Use gralloc1 usage in AHardwareBuffer_describe" into oc-dev

7 years agoAdd VNDK API to access AHardwareBuffer from ANativeWindowBuffer
Mathias Agopian [Mon, 3 Apr 2017 22:34:13 +0000 (15:34 -0700)]
Add VNDK API to access AHardwareBuffer from ANativeWindowBuffer

this is to allow vendors to use AHardwareBuffer’s
lock/unlock on buffer dequeued from an
ANativeWindow.

Test: compiled
Bug: 36866217
Change-Id: If630105572ae0e57f6fda19c13e82150f415ed6b

7 years agoSurface: add getRemovedBuffer API
Yin-Chia Yeh [Wed, 29 Mar 2017 02:07:39 +0000 (19:07 -0700)]
Surface: add getRemovedBuffer API

This allows clients to optionally sign up to track
buffers going out of Surface.

Test: compile
Bug: 34461678
Change-Id: I8696b304c169099c872bd9ba783015c0f0dad73a

7 years agovndservicemanager: load vendor service_contexts.
Martijn Coenen [Fri, 31 Mar 2017 23:12:12 +0000 (16:12 -0700)]
vndservicemanager: load vendor service_contexts.

Also, don't crash when /dev/vndbinder is not
accessible.

Bug: 36052864
Test: loads vendor service contexts
Test: doesn't crash without /dev/vndbinder, works with it
Change-Id: Ida9dd94791206e14246348a8b8e66be09ed8fca7

7 years agoRenamed HIDL SensorManager::mManager -> mInternalManager.
Yifan Hong [Wed, 29 Mar 2017 00:21:21 +0000 (17:21 -0700)]
Renamed HIDL SensorManager::mManager -> mInternalManager.

Use "Internal" to represent objects of the wrapped type.

Test: pass
Change-Id: I4f86bc2c7c272c9abb0c5b4c2837baccfdc2a748

7 years agoMerge "We really want f_frsize." into oc-dev
TreeHugger Robot [Mon, 3 Apr 2017 07:37:44 +0000 (07:37 +0000)]
Merge "We really want f_frsize." into oc-dev

7 years agoMerge "Define upper-bound disk quotas for all apps." into oc-dev
TreeHugger Robot [Mon, 3 Apr 2017 05:46:04 +0000 (05:46 +0000)]
Merge "Define upper-bound disk quotas for all apps." into oc-dev

7 years agoWe really want f_frsize.
Jeff Sharkey [Mon, 3 Apr 2017 05:29:30 +0000 (23:29 -0600)]
We really want f_frsize.

It's confusing, but f_bsize is not the value you're looking for; the
real block size is f_frsize.  Fix all those bugs.

Test: builds, boots
Bug: 36840579
Change-Id: I2846b8998c27f3e9a71dbf573a0a22158215a3bd

7 years agoDefine upper-bound disk quotas for all apps.
Jeff Sharkey [Mon, 3 Apr 2017 03:53:14 +0000 (21:53 -0600)]
Define upper-bound disk quotas for all apps.

Abusive or broken apps can go crazy and try allocating all of the
disk space on the device.  To mitigate the impact on system health,
set hard limits to block any given app from using more than 90% of
disk blocks, or 50% of disk inodes.

Also define the hard limit for AID_MEDIA_RW to avoid filling up the
device via the SD card.

Kick QUOTAON when scanning devices, since ext4 doesn't toggle
DQUOT_LIMITS_ENABLED during initial mount.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.EnvironmentTest#testSaneInodes
Bug: 36450358
Change-Id: Iaa2bc6a2f0bc9047ee54c1d1a49bbda92142457a

7 years agoMerge "surfaceflinger: Generate unique layer names" into oc-dev
Cody Northrop [Sun, 2 Apr 2017 13:52:40 +0000 (13:52 +0000)]
Merge "surfaceflinger: Generate unique layer names" into oc-dev

7 years agoMerge "[libadapter] Fix nullpointer in acceptchanges" into oc-dev
TreeHugger Robot [Sat, 1 Apr 2017 22:15:50 +0000 (22:15 +0000)]
Merge "[libadapter] Fix nullpointer in acceptchanges" into oc-dev

7 years ago[libadapter] Fix nullpointer in acceptchanges
Fabien Sanglard [Thu, 30 Mar 2017 23:27:02 +0000 (16:27 -0700)]
[libadapter] Fix nullpointer in acceptchanges

Check the layer still exists upon accepting changes.

Bug: 36205238
Test: AUPT
Change-Id: I8443265ecc7b8b0a12347439fd75b138d14c7e3a

7 years agoDO NOT MERGE: ConsumerBase: call freeBufferLocked when a slot is overwritten
Yin-Chia Yeh [Thu, 30 Mar 2017 20:13:36 +0000 (13:13 -0700)]
DO NOT MERGE: ConsumerBase: call freeBufferLocked when a slot is overwritten

Cherrypicked from master.

Test: the CL + camera service side fix pass ReprocessCaptureTest
Bug: 34461678
Change-Id: Ia7863321bcb46cba53532fc1570c5facd9280aaa

7 years agoMerge "vulkan: Dequeue the shared buffer again after presenting" into oc-dev
TreeHugger Robot [Sat, 1 Apr 2017 06:08:37 +0000 (06:08 +0000)]
Merge "vulkan: Dequeue the shared buffer again after presenting" into oc-dev

7 years agoMerge "vulkan: Don't dequeue in AcquireNextImageKHR if in shared mode" into oc-dev
TreeHugger Robot [Sat, 1 Apr 2017 05:46:12 +0000 (05:46 +0000)]
Merge "vulkan: Don't dequeue in AcquireNextImageKHR if in shared mode" into oc-dev

7 years agoMerge "Allow VirtualDisplay's to use hardware composer when in VR mode even if physic...
TreeHugger Robot [Sat, 1 Apr 2017 04:45:36 +0000 (04:45 +0000)]
Merge "Allow VirtualDisplay's to use hardware composer when in VR mode even if physical composer does not support them." into oc-dev

7 years agoMerge changes I9ad4588e,I83a676fc,I749242c4,Idc0d3c23 into oc-dev
TreeHugger Robot [Sat, 1 Apr 2017 04:34:44 +0000 (04:34 +0000)]
Merge changes I9ad4588e,I83a676fc,I749242c4,Idc0d3c23 into oc-dev

* changes:
  vulkan: Only cancel buffers during swapchain creation if not shared
  vulkan: Set shared & auto refresh modes earlier
  vulkan: Track whether in shared mode in Swapchain
  vulkan: Always request at least 2 images for swapchain

7 years agoMerge "Add UID in bugreport" into oc-dev
TreeHugger Robot [Sat, 1 Apr 2017 01:01:37 +0000 (01:01 +0000)]
Merge "Add UID in bugreport" into oc-dev

7 years agoUse gralloc1 usage in AHardwareBuffer_describe
Jiwen 'Steve' Cai [Fri, 31 Mar 2017 23:34:45 +0000 (16:34 -0700)]
Use gralloc1 usage in AHardwareBuffer_describe

GraphicBuffer->getUsage() reports gralloc0 usage bits, convert it to
gralloc1 usage first then to AHardwareBuffer bits.

Bug: 35114769
Test: AImageReaderCts now passes with CPU_READ_OFTEN case.
Change-Id: Id461d9f9e98ccc1db8c4b4da79c61b9aedb417bf

7 years agoMerge "Add default .clang-format" into oc-dev
TreeHugger Robot [Fri, 31 Mar 2017 22:51:45 +0000 (22:51 +0000)]
Merge "Add default .clang-format" into oc-dev

7 years agosurfaceflinger: Generate unique layer names
Cody Northrop [Fri, 31 Mar 2017 18:00:08 +0000 (12:00 -0600)]
surfaceflinger: Generate unique layer names

Add a counter to layer names to make it clear when there are duplicates.

    layer foo#0
    layer foo#1
    layer bar#0
    layer bar#1
    layer bar#2

Bug: b/32543755
Test: Build, install, run game with duplicate layers, see unique names.

Change-Id: I915531d7adbdc506c429b86a685665fb6c56d25e

7 years agoadd surfaceflinger and servicemanager to animation class
Keun-young Park [Thu, 23 Mar 2017 20:46:54 +0000 (13:46 -0700)]
add surfaceflinger and servicemanager to animation class

- necessary for running shutdown animation

bug: 36526187
Test: many reboots

Change-Id: Id26f5747a8903e91db8499093a489409dcafa129

7 years agobufferhubd: Fix an error on not closing post_fence explicitly.
Alex Vakulenko [Fri, 31 Mar 2017 16:10:43 +0000 (09:10 -0700)]
bufferhubd: Fix an error on not closing post_fence explicitly.

There is a typo in the code that instead of calling close() on a Post
fence, actually did get_fd() which is really a no-op.

Fixed by changing the call to call() explicitly.

Bug: None
Test: `m -j32` succeeds. Sailfish boots, CubeSea works.
Change-Id: If788aa8ea291317f0618724ecc35a4b355575772

7 years agolibbufferhub: Fix compiler warning with printf format mismatch
Alex Vakulenko [Fri, 31 Mar 2017 15:29:28 +0000 (08:29 -0700)]
libbufferhub: Fix compiler warning with printf format mismatch

std::vector<bool>::at() does not return bool& but a special reference
proxy class. Passing this class on the stack for "%d" printf specifier
is unsafe.

Compiler throws a warning to indicate this problem:

    format specifies type 'int' but the argument has type 'reference'
    (aka '__bit_reference<std::__1::vector<bool, std::__1::allocator<bool>>>')

Fixed by explicitly casting to int before pushing the value onto the stack.

Bug: None
Test: `m -j32` = no more warning
Change-Id: I7b3bc4908e4932c25be60fc350e0e0b439842b66

7 years agolibpdx_uds: Improve client connection logic
Alex Vakulenko [Fri, 24 Mar 2017 00:44:58 +0000 (17:44 -0700)]
libpdx_uds: Improve client connection logic

Handle the case where the service created a socket file but not bound the
socket to it, or not listening for incoming requests yet. Also, if the service
has crashed and left the socket file behind, need to make sure we reconnect
once the service is restarted.

Bug: None
Test: `m -j32` succeeds, device boots and CubeSea app works on Sailfish
Change-Id: I2039cfca6faccd5d1d4b725e454075669484b880
(cherry picked from commit d074fc416a7a90e76a0b28a870080c1dd30079a1)

7 years agoRemove unused dependency on libhardware from bufferhubd
Alex Vakulenko [Thu, 23 Mar 2017 18:52:44 +0000 (11:52 -0700)]
Remove unused dependency on libhardware from bufferhubd

'libhardware' doesn't seem to be used anymore. Remove it.

Bug: None
Test: `m -j32` succeeds.
Change-Id: I2ff002ce17d920f44509347ca86ca5f030348cf5
(cherry picked from commit f9f18b6b5c413ffeb8cc3ac67dd49bc17364a76f)

7 years agolibbufferhubqueue: Fix syntax in Android.bp
Alex Vakulenko [Thu, 30 Mar 2017 17:53:11 +0000 (10:53 -0700)]
libbufferhubqueue: Fix syntax in Android.bp

There was a spelling mistake for cflags property of libbufferhub
cc_library object.

Bug: None
Test: `m -j32` succeeds
Change-Id: I862c2266d86586469dc7299bf727f75bb3df6512
(cherry picked from commit 66fd7cb0f3b1a70121fb223b27a51f06534ebc46)

7 years agoAdd default .clang-format
Dan Stoza [Fri, 24 Mar 2017 18:09:55 +0000 (11:09 -0700)]
Add default .clang-format

Adds a default .clang-format for frameworks/native. If this style is
undesirable for a given component in this repo, it can be overriden
with a more local .clang-format file.

Test: None necessary, only for formatting
Change-Id: I0bf6bd9a15255d9a4ce3d485e841912955caa310
(cherry picked from commit ec106f6cc73e2cbe63ad6c8e942c11d764c8158c)

7 years agoAllow VirtualDisplay's to use hardware composer when in VR mode even if
Alex Sakhartchouk [Sun, 26 Mar 2017 16:28:34 +0000 (12:28 -0400)]
Allow VirtualDisplay's to use hardware composer when in VR mode even if
physical composer does not support them.

Bug: 36071574
Test: Applied remaining wip patches, launched 2D activity while in
persistent VR mode. Observed 2D activity rendered in VR in VirtualDisplay.
Further, instrumented SurfaceFlinger code to ensure DisplayDevice's are
created and destroyed with proper composers during VR mode transition.

Change-Id: I12b09f1209fcf33f97abfd77e14c6ce61f45a5e9
(cherry picked from commit d38ec4e294eadd4f655476fc90b675c78c1c8740)

7 years agovulkan: Dequeue the shared buffer again after presenting
Chris Forbes [Thu, 30 Mar 2017 06:48:39 +0000 (19:48 +1300)]
vulkan: Dequeue the shared buffer again after presenting

Ensures that the shared buffer is always dequeued. This is tidier than
the previous hacky approach of dequeueing it on demand just prior to
this.

Test: build
Change-Id: I0202271a12106470329180b51a2eea19ceab31af

7 years agovulkan: Don't dequeue in AcquireNextImageKHR if in shared mode
Chris Forbes [Thu, 30 Mar 2017 06:47:37 +0000 (19:47 +1300)]
vulkan: Don't dequeue in AcquireNextImageKHR if in shared mode

We've already got the shared buffer dequeued. All we need to do here
is make the semaphore and fence work.

Test: build
Change-Id: I77a49c312e91b5e0657b87ac2748428c631bdbc0

7 years agovulkan: Only cancel buffers during swapchain creation if not shared
Chris Forbes [Thu, 30 Mar 2017 06:44:15 +0000 (19:44 +1300)]
vulkan: Only cancel buffers during swapchain creation if not shared

When a buffer queue is in shared mode, we're not allowed to cancel
buffers. Just keep the shared buffer dequeued all the time.

Test: build
Change-Id: I9ad4588ebd792ccdfee247d030579e2ef68aaef1

7 years agovulkan: Set shared & auto refresh modes earlier
Chris Forbes [Thu, 30 Mar 2017 06:37:50 +0000 (19:37 +1300)]
vulkan: Set shared & auto refresh modes earlier

We'd like to be able to remove the 2-buffer-minimum workaround -- but to
make that reasonable, we need the lower layers to know we're trying to
use shared mode. Set the appropriate modes before determining the buffer
counts, as a first step toward that.

Change-Id: I83a676fc1a86510abd4521cf9a5e80c0334d5941
Test: build

7 years agovulkan: Track whether in shared mode in Swapchain
Chris Forbes [Thu, 30 Mar 2017 06:31:40 +0000 (19:31 +1300)]
vulkan: Track whether in shared mode in Swapchain

We need to adjust our behavior in various other places if this is the
case.

Test: build
Change-Id: I749242c4c7f0b19693b6cc5bfcf2dd6e01ed0e5b

7 years agovulkan: Always request at least 2 images for swapchain
Chris Forbes [Thu, 16 Mar 2017 22:28:32 +0000 (11:28 +1300)]
vulkan: Always request at least 2 images for swapchain

For shared mode, we really only care about 1 image, but there are other
changes further down the stack that need to be made for that to really
work. For now, just tell the bufferqueue that we want 2. After that, we
still only dequeue one buffer (as in fact required by BQ in shared mode)
and construct one VkImage over it for giving back to the vulkan app.

[in V1 we were just smashing the buffer count to 2, which is messier and
observable by the app]

Change-Id: Idc0d3c232d56a5c0127f9472611d151f3605939c
Test: build

7 years agoMerge "Add alpha channel for the EGLConfig" into oc-dev
TreeHugger Robot [Thu, 30 Mar 2017 21:58:58 +0000 (21:58 +0000)]
Merge "Add alpha channel for  the EGLConfig" into oc-dev

7 years agoMerge "fix the api style" into oc-dev
TreeHugger Robot [Thu, 30 Mar 2017 20:57:56 +0000 (20:57 +0000)]
Merge "fix the api style" into oc-dev

7 years agoMerge "VR: Pass display size in the HWC observer callback" into oc-dev
TreeHugger Robot [Thu, 30 Mar 2017 20:22:29 +0000 (20:22 +0000)]
Merge "VR: Pass display size in the HWC observer callback" into oc-dev

7 years agoAdd alpha channel for the EGLConfig
neo.he [Tue, 21 Mar 2017 03:48:36 +0000 (11:48 +0800)]
Add alpha channel for  the EGLConfig

If the alpha channel is not assigned,the framebuffer will be Opaque.
And it will mask the underlying video and make the video invisible
when play video width mediaplayer

cherry-picked from AOSP master

Issue: b/36025630
Test: clean build and boot PixelC
Change-Id: If756ad2aaa789f6ddb178333b3e8854f52c8eac3

7 years agofix the api style
Hendrik Wagenaar [Thu, 30 Mar 2017 18:53:32 +0000 (11:53 -0700)]
fix the api style

google3 c++ style says "no _ on struct members"

Happy to oblige

Bug: None
Test: Compiled
Change-Id: I74b65908339551b703125fe16e5a6d11cd3e9a89

7 years agoFix seamless rotation with SurfaceView WM bypass.
Robert Carr [Wed, 29 Mar 2017 19:10:31 +0000 (12:10 -0700)]
Fix seamless rotation with SurfaceView WM bypass.

First a brief review on seamless rotation. In seamless rotation
the WM will do the following atomically:

1. Update the display transform.
2. Set window transforms to make the surfaces at their old size appear
   at the correct location in the new coordinate space.
3. Set a flag to undo the transforms when the surfaces resize.

However, windows with NATIVE_WINDOW_TRANSFORM_DISPLAY needed to be special cased.
The flag will perform step 2 in terms of buffer mapping, but not in terms of bounds
computation. So to compensate the WM would apply the transform to the bounds,
set these bounds, and then skip applying the transform matrix (as the buffer is
transformed by the flag).

Now that the WM can't see the Camera view, it can't implement this special logic
and the Camera view inherits the parent transform. We compensate for this in
SurfaceFlinger by omitting parent rotation transform components for
Surfaces with NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY. To some extent this
breaks arbitrary rotation for surfaces with NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY
but this is essentially ok:

1. We lived with that bug until N-MR1
2. We fixed it in N-MR1 because the camera was falling back to ROTATE
   a lot which shouldn't be happening anymore, following introduction
   of specifying rotation animation in manifest.

Test: Rotate camera, disable HWC, rotate camera some more. Switch to front camera, repeat.
Bug: 36230754
Bug: 36727915
Change-Id: Ied390c9cb3968fcce32a84ee7947f699746fdc81

7 years agolibgui: Make ISurfaceComposerClient a SafeInterface
Dan Stoza [Thu, 23 Mar 2017 21:41:55 +0000 (14:41 -0700)]
libgui: Make ISurfaceComposerClient a SafeInterface

Converts ISurfaceComposerClient (specifically its Bp/Bn children) to be
SafeInterfaces such that all parceling/unparceling is done
automatically.

Test: Manual testing
Change-Id: Ie5eee51fc893b0e4d7c3b498fe756306f9a029b5

7 years agolibbinder: Add SafeInterface
Dan Stoza [Thu, 1 Dec 2016 23:16:31 +0000 (15:16 -0800)]
libbinder: Add SafeInterface

Adds SafeInterface, a mechanism which will automatically translate
IInterface method calls into remote procedure calls, avoiding the need
to manually write parceling and unparceling code for each method.

Test: binderSafeInterfaceTest
Change-Id: I0fc7a6eee5528371f40b90d056404cb024166b23

7 years agoVR: Pass display size in the HWC observer callback
Daniel Nicoara [Tue, 28 Mar 2017 15:48:42 +0000 (11:48 -0400)]
VR: Pass display size in the HWC observer callback

1) Unify the places where primary display size is queried.
2) Allows virtual displays to have a different size than the primary
display and the size propagates properly to VR HWC and its observer.

Bug: None
Test: Unittest and manually on device
Change-Id: I7e026c4f9b018d47ca400247beed27841d71c806
(cherry picked from commit 04c73d23d5e366c9f0337cdaa71bd2d15ebf1f4e)

7 years agoAdd UID in bugreport
Tony Mak [Thu, 30 Mar 2017 16:47:09 +0000 (17:47 +0100)]
Add UID in bugreport

Test: adb bugreport, found uid in logcat.

Change-Id: I90ab10adb05fe835a6ce74bddb0f1b88aacd22a7
Fix: 36339235

7 years agoMerge "vndk/window.h must be C compatible" into oc-dev
TreeHugger Robot [Thu, 30 Mar 2017 01:57:31 +0000 (01:57 +0000)]
Merge "vndk/window.h must be C compatible" into oc-dev

7 years agoMerge "Add 180 rotation to sensord orientation" into oc-dev
TreeHugger Robot [Thu, 30 Mar 2017 01:02:13 +0000 (01:02 +0000)]
Merge "Add 180 rotation to sensord orientation" into oc-dev

7 years agoMerge "Add basic dvrSurface C API" into oc-dev
TreeHugger Robot [Thu, 30 Mar 2017 00:24:40 +0000 (00:24 +0000)]
Merge "Add basic dvrSurface C API" into oc-dev

7 years agovndk/window.h must be C compatible
Mathias Agopian [Wed, 29 Mar 2017 23:06:48 +0000 (16:06 -0700)]
vndk/window.h must be C compatible

Test: added a c compatibility test
Bug: 36725813
Change-Id: Ic7e1c8b50e1818707a9a457d84ed74e7e6c816c8

7 years agoAdd 180 rotation to sensord orientation
Hendrik Wagenaar [Fri, 24 Mar 2017 20:51:17 +0000 (13:51 -0700)]
Add 180 rotation to sensord orientation

Bug: None
Test: Manually tested locally
Change-Id: I135416a2c5be68172ff466bad503261adf29c5a9

7 years agoMerge "vrwm: Fix controller input/rendering mismatch" into oc-dev
TreeHugger Robot [Wed, 29 Mar 2017 22:31:14 +0000 (22:31 +0000)]
Merge "vrwm: Fix controller input/rendering mismatch" into oc-dev

7 years agoAdd basic dvrSurface C API
Jiwen 'Steve' Cai [Fri, 24 Mar 2017 01:53:16 +0000 (18:53 -0700)]
Add basic dvrSurface C API

Test: Build and flash system
Bug: 36563654
Change-Id: Id6c79d33d80e719b1d1d7f43aec99aadfad40c03

7 years agoMerge "Make sure dvr functions are prepended with dvr" into oc-dev
TreeHugger Robot [Wed, 29 Mar 2017 21:01:20 +0000 (21:01 +0000)]
Merge "Make sure dvr functions are prepended with dvr" into oc-dev

7 years agovrwm: Fix controller input/rendering mismatch
Albert Chaulk [Wed, 29 Mar 2017 15:27:58 +0000 (11:27 -0400)]
vrwm: Fix controller input/rendering mismatch

This works for portrait mode only for now. Landscape phones present
some weird buffer sizes (1080x1080) that get scaled incorrectly for
input

This also removes all of our older hacks, such as swapping
width/height in SurfaceFlingerView and the swap + invert of touch
input. A global 90 degree rotation is applied to present the portrait
buffers in the correct orientation

vr_wm_ctl has a command to stack another rotation on top of the
existing ones in order to facilitate development for now. Apps will
likely show up rotated, "vr_wm_ctl rotate 1" will fix it, or -1 if
it needs to be rotated the other way.

Bug: None
Test: Manual with permissions and calculator

Change-Id: Ifd31b444b944fbf3085613349caae37e817538f6
(cherry picked from commit eb49c451cbc5de7bbe5ba440dc8e43291daa6d4e)

7 years agoMerge "Recenter upon notification from VrCore" into oc-dev
Kevin Schoedel [Wed, 29 Mar 2017 20:27:48 +0000 (20:27 +0000)]
Merge "Recenter upon notification from VrCore" into oc-dev

7 years agoMake sure dvr functions are prepended with dvr
Hendrik Wagenaar [Wed, 29 Mar 2017 17:50:25 +0000 (10:50 -0700)]
Make sure dvr functions are prepended with dvr

* Fix some inconsistencies

Bug: None
Test: Compiled
Change-Id: I9d67d2335f543700bd1a90d329e4b155f4c22c69

7 years agoRecenter upon notification from VrCore
Kevin Schoedel [Wed, 29 Mar 2017 17:45:59 +0000 (13:45 -0400)]
Recenter upon notification from VrCore

Bug: 36201389
Test: manual on device
Change-Id: I690b70130e45732f052d136bedd587ddbf9493b4

7 years agoMerge "Return jobject when getting android Java Surface" into oc-dev
Jiwen Cai [Wed, 29 Mar 2017 17:35:11 +0000 (17:35 +0000)]
Merge "Return jobject when getting android Java Surface" into oc-dev

7 years agoTemporarily disable 2 unratified Khronos extensions.
Ian Elliott [Tue, 28 Mar 2017 19:20:35 +0000 (13:20 -0600)]
Temporarily disable 2 unratified Khronos extensions.

Test: Ran the following CTS test cases, which now say "NotSupported":
dEQP-VK.wsi.android.surface.query_capabilities2
dEQP-VK.wsi.android.surface.query_formats2
dEQP-VK.wsi.android.shared_presentable_image.scale_none.demand
dEQP-VK.wsi.android.shared_presentable_image.scale_none.continuous
dEQP-VK.wsi.android.shared_presentable_image.scale_up.demand
dEQP-VK.wsi.android.shared_presentable_image.scale_up.continuous
dEQP-VK.wsi.android.shared_presentable_image.scale_down.demand
dEQP-VK.wsi.android.shared_presentable_image.scale_down.continuous

Disable the Khronos/Vulkan VK_KHR_get_surface_capabilities2 and
VK_KHR_shared_presentable_image extensions until the May 5th
ratification of these two extensions.  A macro/ifdef's are used to allow
easy enablement of the extensions for internal testing and bug fixes.

V2: convert preprocessor flag to constant [chrisforbes]

Change-Id: Ic41360e42561a822d51e1d7fc3172c76c12e5bde

7 years agoReturn jobject when getting android Java Surface
Jiwen 'Steve' Cai [Wed, 29 Mar 2017 02:15:34 +0000 (19:15 -0700)]
Return jobject when getting android Java Surface

This logic is originally borrowed from similar API from shim_gvr API
where we cannot explicity deps on JNI.h in the public header. This
constrain no longer exists as libdvr is an Android platform library.

Bug: 2013449
Test: Built libdvr
Change-Id: Ide72f5fb706cd24e13507749216d7708f1f40fcc

7 years agoMerge "Use lshal's new --debug option when emitting bugreports." into oc-dev
TreeHugger Robot [Wed, 29 Mar 2017 01:23:47 +0000 (01:23 +0000)]
Merge "Use lshal's new --debug option when emitting bugreports." into oc-dev

7 years agoMerge "Use gralloc usage conversion library" into oc-dev
TreeHugger Robot [Tue, 28 Mar 2017 20:55:50 +0000 (20:55 +0000)]
Merge "Use gralloc usage conversion library" into oc-dev

7 years agoTemporarily skipping dump of bluetooth logs.
Felipe Leme [Tue, 28 Mar 2017 18:54:20 +0000 (11:54 -0700)]
Temporarily skipping dump of bluetooth logs.

Bug: 35998031
Test: manual verification
Change-Id: I0bdf6eb1546c0850b301441f48753b65fa7b1e5e

7 years agoUse lshal's new --debug option when emitting bugreports.
Andreas Huber [Thu, 23 Mar 2017 16:47:51 +0000 (09:47 -0700)]
Use lshal's new --debug option when emitting bugreports.

This calls into live binderized services and logs their "IBase::debug(...)"
output.

Bug: 36520620
Test: make, adb shell lshal, adb shell bugreport
Change-Id: I421e30e74c82817adf276b5750ce40038852df83

7 years agoUse gralloc usage conversion library
Jesse Hall [Thu, 23 Mar 2017 18:03:23 +0000 (11:03 -0700)]
Use gralloc usage conversion library

Converting from ..graphics.allocator@2.0 usage to gralloc0 usage isn't
quite as simple as ORing and truncating, which is what the default
implementation was doing. Switch to using library functions that do it
correctly.

Test: boot bullhead
Change-Id: Ibe644b53655e191b9bca9d619825a8918e8fc365

7 years agoMerge "Remove legacy cache clearing logic."
TreeHugger Robot [Tue, 28 Mar 2017 05:41:04 +0000 (05:41 +0000)]
Merge "Remove legacy cache clearing logic."

7 years agoMerge "Add stub for SensorManager::createEventQueue"
TreeHugger Robot [Tue, 28 Mar 2017 02:39:12 +0000 (02:39 +0000)]
Merge "Add stub for SensorManager::createEventQueue"

7 years agofixed bug undefining LIKELY/UNLIKELY in math lib
Jaesoo Lee [Fri, 24 Mar 2017 04:52:12 +0000 (13:52 +0900)]
fixed bug undefining LIKELY/UNLIKELY in math lib

Bug: 36275627
Test: Built and check the surfaceflinger compiled

Change-Id: I062b8c0db540443635ac746824edb295190235d0

7 years agoMerge "Disable BufferQueueInAnotherProcess test"
TreeHugger Robot [Mon, 27 Mar 2017 23:16:23 +0000 (23:16 +0000)]
Merge "Disable BufferQueueInAnotherProcess test"

7 years agoRemove legacy cache clearing logic.
Jeff Sharkey [Mon, 27 Mar 2017 22:41:06 +0000 (16:41 -0600)]
Remove legacy cache clearing logic.

It was riddled with funky memory access, and it's been fully replaced
by the new V2 logic.

Test: builds, boots
Bug: 2794881736655947
Change-Id: Ic5f0636c414ccf5ccf56eb50fea321b6688a83a0

7 years agoMerge changes Iad7bf035,I870e08c6
Mathias Agopian [Mon, 27 Mar 2017 22:03:23 +0000 (22:03 +0000)]
Merge changes Iad7bf035,I870e08c6

* changes:
  VNDK ANativeWindow API - step 2
  VNDK ANativeWindow API

7 years agoDisable BufferQueueInAnotherProcess test
Kalle Raita [Mon, 27 Mar 2017 21:11:54 +0000 (14:11 -0700)]
Disable BufferQueueInAnotherProcess test

The BufferQueueInAnotherProcess relies on executing before any test that
tries to open a BufferQueue in the local process. A recent test addition
broke the condition. Upcoming SF & BQ changes are likely to obsolete the
test, so won't spend time on fixing it. Disabling for now and the test
will be removed when the infrastructure changes land.

Test: libgui_test
Bug: 36592665
Change-Id: I648e197cab6bab3aed445390069265589a717bf1

7 years agoMerge "Enable --debug option for "lshal" command." am: 16175ca725 am: 674d3acd18
Andreas Huber [Mon, 27 Mar 2017 21:12:41 +0000 (21:12 +0000)]
Merge "Enable --debug option for "lshal" command." am: 16175ca725 am: 674d3acd18
am: 829f3c6d85

Change-Id: I6751fec855783983b96672bec82ae9ba0c737a8b

7 years agoMerge "Enable --debug option for "lshal" command." am: 16175ca725
Andreas Huber [Mon, 27 Mar 2017 21:10:09 +0000 (21:10 +0000)]
Merge "Enable --debug option for "lshal" command." am: 16175ca725
am: 674d3acd18

Change-Id: If87550eb68a9c8e280d8863063b4311a44ff6896

7 years agoMerge "Enable --debug option for "lshal" command."
Andreas Huber [Mon, 27 Mar 2017 21:07:40 +0000 (21:07 +0000)]
Merge "Enable --debug option for "lshal" command."
am: 16175ca725

Change-Id: Ifa29afcb7677a3ec76a03d5f0365ba4de7ee4c9b

7 years agoMerge "Enable --debug option for "lshal" command."
Andreas Huber [Mon, 27 Mar 2017 21:02:30 +0000 (21:02 +0000)]
Merge "Enable --debug option for "lshal" command."

7 years agoMerge "libgfx: Remove SafeLog"
Dan Stoza [Mon, 27 Mar 2017 19:34:43 +0000 (19:34 +0000)]
Merge "libgfx: Remove SafeLog"

7 years agoMerge changes from topic 'libdvr'
Jiwen Cai [Mon, 27 Mar 2017 19:33:59 +0000 (19:33 +0000)]
Merge changes from topic 'libdvr'

* changes:
  Add dvr_buffer_queue C API
  Move DVR platform C API into libdvr

7 years agoVNDK ANativeWindow API - step 2
Mathias Agopian [Tue, 21 Mar 2017 01:07:26 +0000 (18:07 -0700)]
VNDK ANativeWindow API - step 2

The vndk API is a superset of the NDK API.
Prior to this, vendor would have access to
system/window.h which itself is a superset of
what they need, exposes too much of the internals.

With this change, system/window.h depends on
vndk/window.h which depends on
android/native_window.h

Test: compiled, booted Nexus 6P
Bug: 34453351
Change-Id: Iad7bf035143541843309437fe630cc603d96a76e

7 years agoVNDK ANativeWindow API
Mathias Agopian [Mon, 20 Mar 2017 22:48:44 +0000 (15:48 -0700)]
VNDK ANativeWindow API

The vndk API is a superset of the NDK API.
Prior to this, vendor would have access to
system/window.h which itself is a superset of
what they need, exposes too much of the internals.

With this change, system/window.h depends on
vndk/window.h which depends on
android/native_window.h

Test: compiled, booted Nexus 6P
Bug: 34453351
Change-Id: I870e08c652d90b3f2cf4ed7c7ca541ce2893f689

7 years agoMerge "VR: Rename HIDL service name from vr_hwcomposer to vr"
TreeHugger Robot [Mon, 27 Mar 2017 17:15:04 +0000 (17:15 +0000)]
Merge "VR: Rename HIDL service name from vr_hwcomposer to vr"

7 years agoMerge "Properly recover vr_wm from surface vr_flinger crashes."
TreeHugger Robot [Mon, 27 Mar 2017 14:00:29 +0000 (14:00 +0000)]
Merge "Properly recover vr_wm from surface vr_flinger crashes."