OSDN Git Service

android-x86/frameworks-native.git
7 years agoAdd support for consumer queue initial import and hangup.
Corey Tabaka [Thu, 20 Apr 2017 20:42:02 +0000 (13:42 -0700)]
Add support for consumer queue initial import and hangup.

- Add support for consumer queues to import buffers that are created
  before the consumer queue is created, making multi-consumer queue
  patterns possible. This is essential for VrFlinger operation.
- Add support for notifying consumer queues when the producer queue
  hangs up.
- Correct the epoll event loop to check for hangups even when buffers
  are available.
- Add method to retrieve the event fd from a queue.
- Add trace logging and minor cleanup.
- Improve bufferhubd dump state output.

Bug: 36401174
Test: build; bufferhub tests pass.
Change-Id: Idd6f38a3341c048192062734e288d11de48bc4d4

7 years agoMerge "Deprecate producer/consumer usage: Step 2" into oc-dev
TreeHugger Robot [Thu, 4 May 2017 22:16:53 +0000 (22:16 +0000)]
Merge "Deprecate producer/consumer usage: Step 2" into oc-dev

7 years agoMerge "Correct sensor handle for operation parameter" into oc-dev
TreeHugger Robot [Thu, 4 May 2017 01:44:30 +0000 (01:44 +0000)]
Merge "Correct sensor handle for operation parameter" into oc-dev

7 years agoMerge "Fix lshal --init-vintf may have empty <instance> tags." into oc-dev
TreeHugger Robot [Wed, 3 May 2017 22:45:11 +0000 (22:45 +0000)]
Merge "Fix lshal --init-vintf may have empty <instance> tags." into oc-dev

7 years agoCorrect sensor handle for operation parameter
Peng Xu [Mon, 1 May 2017 22:09:49 +0000 (15:09 -0700)]
Correct sensor handle for operation parameter

Sensor handle 0 is a valid sensor handle. Use SENSORS_HANDLE_BASE - 1
instead in inject_sensor_data for operation parameter.

Test: sensor cts passes
Bug: 37956047
Change-Id: I138c2e21d74f532526a53a76be857866764a3d53

7 years agoFix lshal --init-vintf may have empty <instance> tags.
Yifan Hong [Wed, 3 May 2017 20:13:23 +0000 (13:13 -0700)]
Fix lshal --init-vintf may have empty <instance> tags.

Test: on bullhead, lshal --init-vintf | grep "<instance></instance>"

Change-Id: Ic6ab977adcdc5293015e9daba506b625629e5352
Fixes: 37311367

7 years agoMerge "Remove newline from "capturing trace..."" into oc-dev
TreeHugger Robot [Wed, 3 May 2017 17:28:01 +0000 (17:28 +0000)]
Merge "Remove newline from "capturing trace..."" into oc-dev

7 years agoMerge "SurfaceFlinger: Select which layer state to visit" into oc-dev
TreeHugger Robot [Wed, 3 May 2017 17:27:09 +0000 (17:27 +0000)]
Merge "SurfaceFlinger: Select which layer state to visit" into oc-dev

7 years agoMerge "Revert "Disable input-vdex when doing speed-profile."" into oc-dev
TreeHugger Robot [Wed, 3 May 2017 11:56:22 +0000 (11:56 +0000)]
Merge "Revert "Disable input-vdex when doing speed-profile."" into oc-dev

7 years agoMerge "Update installd to new compiler filters." into oc-dev
Nicolas Geoffray [Wed, 3 May 2017 08:04:28 +0000 (08:04 +0000)]
Merge "Update installd to new compiler filters." into oc-dev

7 years agoRemove newline from "capturing trace..."
Carmen Jackson [Tue, 2 May 2017 23:55:33 +0000 (16:55 -0700)]
Remove newline from "capturing trace..."

Turns out this broke a test.

Bug: 37906221
Test: Compiled
Change-Id: I750a2831114071de2627da08de033cbe7924b51b

7 years agoDeprecate producer/consumer usage: Step 2
Jiwen 'Steve' Cai [Tue, 2 May 2017 18:21:18 +0000 (11:21 -0700)]
Deprecate producer/consumer usage: Step 2

Clean up bufferhub_rpc, display_rpc and service side producer/consumer
usage reference.

Next (final) step is to remove all remaining client side reference to
producer/consumer usage and update dvr_xxx API.

This also fixes a minor typo in dvr_named_buffer-test

Bug: 37881101
Test: Build, flash, ran particles.apk and buffer_hub_queue-test
Change-Id: Ibae4376c1fd1ed964843d8b2ad2fb27204fe5e28

7 years agoSurfaceFlinger: Select which layer state to visit
Dan Stoza [Thu, 27 Apr 2017 20:42:17 +0000 (13:42 -0700)]
SurfaceFlinger: Select which layer state to visit

Modifies the traverseIn[Reverse]ZOrder methods to also take an enum
value specifying whether to traverse the current state or the drawing
state.

This has the effect of fixing a bug where we weren't performing
transactions on a child layer because its parent was only visiting its
drawing layers (rather than its current layers) and was thus skipping
the child, which had not yet been moved from current to drawing.

Bug: 36858924
Test: ChildLayerTest.Bug36858924 doesn't hang
Change-Id: I1959f40bc07e77864ba024511d429592a398a67a

7 years agoDeprecate producer/consumer usage: Step 1
Jiwen 'Steve' Cai [Tue, 2 May 2017 05:43:21 +0000 (22:43 -0700)]
Deprecate producer/consumer usage: Step 1

Clean up producer/consumer usage from IonBuffer.

Bug: 37881101
Test: Build, flash, ran particles.apk
Change-Id: I66a8c4db2348b014a7b458b69157ed7c150112e1

7 years agoRevert "Disable input-vdex when doing speed-profile."
Nicolas Geoffray [Mon, 24 Apr 2017 13:34:59 +0000 (13:34 +0000)]
Revert "Disable input-vdex when doing speed-profile."

https://android-review.googlesource.com/#/c/377754/ is fixing vdex and delayout.

bug: 37558732
Test: device boots, vdex works on OTA, input-vdex is passed
      for speed-profile

This reverts commit a2dbefc7a51482acb8d5d139c9e2f01306ef9ceb.

(cherry picked from commit 3c95f2da655567d9fcc28d7a35dcc79d75cb61f6)

Change-Id: I4d36ec79ca681e20ffb181ec099ce5b229e38aed

7 years agoUpdate installd to new compiler filters.
Nicolas Geoffray [Tue, 25 Apr 2017 11:28:28 +0000 (12:28 +0100)]
Update installd to new compiler filters.

bug:34715556
Test: build and boot aosp bullhead

(cherry picked from commit 4b64ed991b23dc1215ce10fce69c3e2595dd34b7)

Change-Id: Ib94bda97ed131878c3be092d58920500d2d8d556

7 years agoBufferQueue: plumbing mConsumerIsProtected
Jiwen 'Steve' Cai [Sat, 22 Apr 2017 01:49:53 +0000 (18:49 -0700)]
BufferQueue: plumbing mConsumerIsProtected

This replaces current logic in BufferQueue that uses
GRALLOC_USAGE_PROTECTED to indicate whether an ANativeWindow is capable
of handling hardware protected gralloc buffers. Current logic is
problematic as it enforces producer to use protected buffer no matter
whether producer side is capable of writing into a protected buffer.

This new solution, however, introduces a new NATIVE_WINDOW_* flag that
consumer can set on IGraphicBufferConsumer to indicate its capacity,
which can then be queried by producer via Surface::query (or
IGraphicBufferProducer::query).

When consumer is capable of reading protected buffer (e.g. a protected
GL context), the producer can generate either a protected or unprotected
buffer.

When consumer is not capable of reading protected buffer, the producer
should only generate unprotected buffer.

Bug: 35726763
Test: videoplayer-nodrm-protected.apk and videoplayer-drm-protected.apk
both works.

Change-Id: I1bf6814c9f1f81f9e04f0e89646b0733ff1a4758

7 years agoMerge "Fix lshal not to squash HAL entries incorrectly." into oc-dev
Yifan Hong [Mon, 1 May 2017 22:02:15 +0000 (22:02 +0000)]
Merge "Fix lshal not to squash HAL entries incorrectly." into oc-dev

7 years agoMerge "Call validateDisplay() when skipping frames" into oc-dev
TreeHugger Robot [Mon, 1 May 2017 20:26:21 +0000 (20:26 +0000)]
Merge "Call validateDisplay() when skipping frames" into oc-dev

7 years agoFix lshal not to squash HAL entries incorrectly.
Yifan Hong [Tue, 18 Apr 2017 21:19:40 +0000 (14:19 -0700)]
Fix lshal not to squash HAL entries incorrectly.

Bug: 37311367
Test: lshal --init-vintf
Change-Id: I693b53f5f342c7600e4031d020792fd347e3ae83

7 years agoMerge "Set the atrace clock to boot when possible and mono otherwise." into oc-dev
TreeHugger Robot [Fri, 28 Apr 2017 22:39:33 +0000 (22:39 +0000)]
Merge "Set the atrace clock to boot when possible and mono otherwise." into oc-dev

7 years agoSet the atrace clock to boot when possible and mono otherwise.
Carmen Jackson [Fri, 28 Apr 2017 17:34:50 +0000 (10:34 -0700)]
Set the atrace clock to boot when possible and mono otherwise.

Bug: 32379831
Test: Inspected the trace_clock while running atrace, without including the .rc file change:
$ adb shell
marlin:/ # cat /d/tracing/trace_clock
[local] global counter uptime perf mono boot
marlin:/ # atrace --async_start freq
capturing trace...
marlin:/ # cat /d/tracing/trace_clock
local global counter uptime perf mono [boot]
marlin:/ # atrace --async_stop > /dev/null
marlin:/ # cat /d/tracing/trace_clock
local global counter uptime perf mono [boot]
marlin:/ # exit

Test: Inspected the trace_clock while running atrace, after the .rc file change:
$ adb shell
marlin:/ # cat /d/tracing/trace_clock
local global counter uptime perf mono [boot]
marlin:/ # atrace --async_start freq
capturing trace...
marlin:/ # cat /d/tracing/trace_clock
local global counter uptime perf mono [boot]

Change-Id: I9ec88df109b311b90c9d88fe3a70f9ce090b4d15

7 years agoMerge changes from topic 'allow-vrcore' into oc-dev
Daniel Nicoara [Fri, 28 Apr 2017 15:15:17 +0000 (15:15 +0000)]
Merge changes from topic 'allow-vrcore' into oc-dev

* changes:
  Check for caller permissions in virtual touchpad service
  Restrict VR HWC access to services with RESTRICTED_VR_ACCESS permission

7 years agoAHardwareBuffer now reports its stride
Mathias Agopian [Wed, 26 Apr 2017 00:38:08 +0000 (17:38 -0700)]
AHardwareBuffer now reports its stride

Test: compile / manual
Bug: 37686713
Change-Id: I1d75c67816717dc5d8ef4c71c1ca45d1d86aefb3

7 years agoPlumb gralloc producer/consumer bits correctly
Mathias Agopian [Thu, 20 Apr 2017 23:35:39 +0000 (16:35 -0700)]
Plumb gralloc producer/consumer bits correctly

Bug: 33350696
Test: compile, boot device, cts
Change-Id: I2f078cf4bbdf0db49f2e914b051f55629fb37eb6

7 years agoMerge "SurfaceFlinger: Correct extra parent scaling with buffer transforms." into...
TreeHugger Robot [Thu, 27 Apr 2017 22:51:39 +0000 (22:51 +0000)]
Merge "SurfaceFlinger: Correct extra parent scaling with buffer transforms." into oc-dev

7 years agoSurfaceFlinger: Correct extra parent scaling with buffer transforms.
Robert Carr [Thu, 27 Apr 2017 01:32:15 +0000 (18:32 -0700)]
SurfaceFlinger: Correct extra parent scaling with buffer transforms.

We need to account for the buffer transform when calculating the extra
parent scaling.

Bug: 37673612
Test: Regression test included in Transaction_test
Change-Id: Ice21f1ecf3789358646d95c753ee361f50c0d246

7 years agoMerge "Fix minor corner cases in BufferHubQueueProducer" into oc-dev
TreeHugger Robot [Thu, 27 Apr 2017 19:37:49 +0000 (19:37 +0000)]
Merge "Fix minor corner cases in BufferHubQueueProducer" into oc-dev

7 years agoCall validateDisplay() when skipping frames
Steven Thomas [Wed, 26 Apr 2017 21:34:01 +0000 (14:34 -0700)]
Call validateDisplay() when skipping frames

Layer management was getting screwed up in vr flinger in the following
scenario:

1. In frame X, post a new buffer to layer L.

2. Decide to skip frame X (e.g. because we're behind our target
schedule).

3. In frame X+1, delete layer L.

When we skip the frame in step 2, we weren't calling validateDisplay()
or presentDisplay() on the hardware composer, so the composer's internal
command queue wasn't being flushed. When we called validateDisplay() for
frame X+1 the update buffer call from frame X would be run, referencing
the deleted layer L, causing a crash.

Now we always call validateDisplay() when we change the layer state,
even if we decide to skip the frame.

I also added code to explicitly clear the Composer object's internal
command buffer when we transfer control from surface flinger to vr
flinger and back. There were certain cases where there could be commands
left in the command buffer after the display handoff.

Bug: 37159844

Test: I used an app switcher script that quickly switches vr apps, which
would consistently trigger the setLayerBuffer crash. I confirmed with
this CL applied I can run the app switcher until surface flinger runs
out of file descriptors (that's a separate bug), and I never see the
setLayerBuffer crash. I also confirmed from the log output there are no
additional hardware composer errors.

Change-Id: I85832b87f393754dc6b034eb38f2937d7b58ed74

7 years agoMerge "Newly create idmap only when it is outdated" into oc-dev
TreeHugger Robot [Wed, 26 Apr 2017 21:50:15 +0000 (21:50 +0000)]
Merge "Newly create idmap only when it is outdated" into oc-dev

7 years agoMerge "Sensor: Limit delay to maximum possible value before sending to HAL" into...
Peng Xu [Wed, 26 Apr 2017 17:42:33 +0000 (17:42 +0000)]
Merge "Sensor: Limit delay to maximum possible value before sending to HAL" into oc-dev

7 years agoNewly create idmap only when it is outdated
Jaekyun Seok [Wed, 19 Apr 2017 02:01:38 +0000 (11:01 +0900)]
Newly create idmap only when it is outdated

For now, OverlayManagerService calls Installd.idmap() whenever a user
is changed, and then a idmap is re-generated even though there are no
changes on its target apk and overlay apk.
This CL is to avoid such unnecessary re-generation of idmap. Instead
only a group id will be updated when the idmap isn't outdated.

Test: building succeeded and tested on sailfish.
Bug: 37179531
Change-Id: Id726cbbc621bd64f2a329798b2ab5436f0c28d70

7 years agoFix minor corner cases in BufferHubQueueProducer
Jiwen 'Steve' Cai [Sat, 15 Apr 2017 00:56:55 +0000 (17:56 -0700)]
Fix minor corner cases in BufferHubQueueProducer

1/ Set reasonable return value BufferHubQueueProducer::query.
2/ Don't error out for setSharedBufferMode(false),
setAutoRefresh(false), as they are just setting default values again.
3/ Supports addition buffer metadata: transformt, crop,
data_format (a.k.a. color_format).
4/ This also changes BufferHubQueueProducer to be based of
BnInterface<IGraphicBufferProducer> so that itself can be passed via Binder.

Bug: 37342387
Bug: 36907193
Test: exoplayer_demo
Change-Id: Ie00bb79f6a249e09905ae52f85a85a67744cc90d

7 years agoMerge "VR: fix libvr_hwc-hal build" into oc-dev
Chia-I Wu [Tue, 25 Apr 2017 22:12:56 +0000 (22:12 +0000)]
Merge "VR: fix libvr_hwc-hal build" into oc-dev

7 years agoMerge "SurfaceFlinger: Fix destruction of relatively Z-ordered layers." into oc-dev
TreeHugger Robot [Tue, 25 Apr 2017 20:49:33 +0000 (20:49 +0000)]
Merge "SurfaceFlinger: Fix destruction of relatively Z-ordered layers." into oc-dev

7 years agoMerge changes from topic 'atrace-pdx' into oc-dev
TreeHugger Robot [Tue, 25 Apr 2017 19:59:47 +0000 (19:59 +0000)]
Merge changes from topic 'atrace-pdx' into oc-dev

* changes:
  atrace: Poke PDX services using utility class.
  libpdx: Add service poke logic to ServiceUtility.

7 years agoSurfaceFlinger: Fix destruction of relatively Z-ordered layers.
Robert Carr [Tue, 25 Apr 2017 17:54:24 +0000 (10:54 -0700)]
SurfaceFlinger: Fix destruction of relatively Z-ordered layers.

We need to explicitly remove a layer from it's Z-order relative when
the layer is removed from compositing, and not rely on being the last
reference. In particular, at the time we are generating the list
of visible layers by traversing, any layer which had just been removed
will still be alive (but abandoned) with a ref in the previous list
of visible layers. So we will succeed in promotion, and copy it to the new
list. This way the layer achieves eternal life even after onRemoved is called.

Bug: 36693738
Test: Manual from BR
Change-Id: Ic6c3f64ceb0f603e7c0e51b136c23839858aa639

7 years agoMerge "Enable access to display/manager socket in surfaceflinger" into oc-dev
TreeHugger Robot [Tue, 25 Apr 2017 16:16:25 +0000 (16:16 +0000)]
Merge "Enable access to display/manager socket in surfaceflinger" into oc-dev

7 years agoMerge "Dump EGL Extension list" into oc-dev
Courtney Goeltzenleuchter [Tue, 25 Apr 2017 15:46:44 +0000 (15:46 +0000)]
Merge "Dump EGL Extension list" into oc-dev

7 years agoMerge "Clamp reported power for each sensor to 1 microAmp." into oc-dev
Ashutosh Joshi [Tue, 25 Apr 2017 12:10:00 +0000 (12:10 +0000)]
Merge "Clamp reported power for each sensor to 1 microAmp." into oc-dev

7 years agoVR: fix libvr_hwc-hal build
Chia-I Wu [Thu, 20 Apr 2017 18:30:57 +0000 (11:30 -0700)]
VR: fix libvr_hwc-hal build

libhwcomposer-client was updated to use
android.hardware.graphics.mapper@2.0.

Bug: 37540361
Test: boots
Change-Id: Id9f94087a04890de95711c91ce9d5aa2f6c8e35d

7 years agovr: Adjust for libui gralloc flags change
Chris Forbes [Thu, 20 Apr 2017 00:16:48 +0000 (17:16 -0700)]
vr: Adjust for libui gralloc flags change

Change-Id: I24dbe407ad9139ba1d206b9074c7c507537d198c
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agogui: Adjust for libui gralloc flags change
Chris Forbes [Thu, 20 Apr 2017 19:43:28 +0000 (12:43 -0700)]
gui: Adjust for libui gralloc flags change

Change-Id: I9f73a1753f9e991eb3a7f0a005c3ab240f0a38b4
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agonativewindow: Adjust for libui gralloc flags change
Chris Forbes [Thu, 20 Apr 2017 19:43:04 +0000 (12:43 -0700)]
nativewindow: Adjust for libui gralloc flags change

Change-Id: I451f045b42d1e3e3bfc35f1e30f27dedc35d4da3
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agoui: Rework GraphicBuffer + Allocator for 64bit usage
Chris Forbes [Wed, 19 Apr 2017 21:29:54 +0000 (14:29 -0700)]
ui: Rework GraphicBuffer + Allocator for 64bit usage

Removes gralloc1-style flags, and replaces with HIDL-style single 64bit
usage. Internal storage of the usage is still 32bit; to be addressed
with a future change.

Change-Id: I60062208cbb06bc8cf6c293e7c7e1530c1147912
Bug: b/33350696
Test: Bullhead: booted to launcher, take photo, watch youtube

7 years agoMerge "Remove/Cleanup Obselete References" into oc-dev
Luke Song [Sat, 22 Apr 2017 17:30:55 +0000 (17:30 +0000)]
Merge "Remove/Cleanup Obselete References" into oc-dev

7 years agoMerge "dumpstate: add graphics composer to hal_interfaces_to_dump" into oc-dev
TreeHugger Robot [Sat, 22 Apr 2017 09:00:07 +0000 (09:00 +0000)]
Merge "dumpstate: add graphics composer to hal_interfaces_to_dump" into oc-dev

7 years agodumpstate: add graphics composer to hal_interfaces_to_dump
Chia-I Wu [Thu, 20 Apr 2017 21:31:50 +0000 (14:31 -0700)]
dumpstate: add graphics composer to hal_interfaces_to_dump

Bug: 37152880
Test: adb shell dumpstate
Change-Id: Id9679d0f02350bc4f51b11b250c7703703dbdfe7

7 years agoMerge "Fix external cache and secondary user bugs." into oc-dev
Jeff Sharkey [Fri, 21 Apr 2017 20:01:36 +0000 (20:01 +0000)]
Merge "Fix external cache and secondary user bugs." into oc-dev

7 years agoMerge "Defer surfaceflinger composition until data latch" into oc-dev
Mike Stroyan [Fri, 21 Apr 2017 18:59:49 +0000 (18:59 +0000)]
Merge "Defer surfaceflinger composition until data latch" into oc-dev

7 years agoMerge "Fix AHardwareBuffer 10:10:10:2 format" into oc-dev
TreeHugger Robot [Fri, 21 Apr 2017 18:38:19 +0000 (18:38 +0000)]
Merge "Fix AHardwareBuffer 10:10:10:2 format" into oc-dev

7 years agoDefer surfaceflinger composition until data latch
Mike Stroyan [Thu, 20 Apr 2017 18:10:48 +0000 (12:10 -0600)]
Defer surfaceflinger composition until data latch

If layer data is not yet ready, latchBuffer will return an empty region.
SurfaceFlinger::handlePageFlip will now check if any layer has a queued
frame which succeeded in latching data.
If no new frame is latched, handlePageFlip will return false.
That will defer refresh until the next vsync.
That reduces HWC and GPU load, improving framerates.
It prevents dEQP tests from timing out on some devices.

Test: dEQP-VK.wsi.android.incremental_present.scale_down.fifo.reference
Bug: 37439915
Change-Id: Id46c82f79953f3a147af77bb0e8e81a395c606b3

7 years agoRemove/Cleanup Obselete References
Luke Song [Fri, 24 Mar 2017 21:17:31 +0000 (14:17 -0700)]
Remove/Cleanup Obselete References

Bug: 36039686
Bug: 36040117
Bug: 36039685
Bug: 36040550
Test: Build
Change-Id: Ifd5ae90138e39d0a14c6a5a8198a9145f74ec8f6
(cherry picked from commit 8126b9df8987fd9959eab1ae76620c343c32f4fc)

7 years agoMerge "Pose flicker fix on some devices" into oc-dev
TreeHugger Robot [Fri, 21 Apr 2017 08:09:37 +0000 (08:09 +0000)]
Merge "Pose flicker fix on some devices" into oc-dev

7 years agoSensor: Limit delay to maximum possible value before sending to HAL
Aniroop Mathur [Wed, 1 Jun 2016 16:47:05 +0000 (22:17 +0530)]
Sensor: Limit delay to maximum possible value before sending to HAL

Currently, all hals/drivers of different manufacturers/vendors have to add check
to modify delay value to maximum possible value if application requests for
delay greater than maximum possible value. Instead of putting this common check
in all different types of drivers/hals, it is best to put it in framework layer only.

For example:
If a sensor has maximum delay capability of 200 ms and application requests for
delay of 1 second  then sensor should run at 200 ms and not 1 second. This is
checked by cts application too like in testAccelerometer_1Hz test case.

Test: compile
Bug: 37543280
Change-Id: Ib921056659ea442ed854b69321d8b2ba0e319302
Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
7 years agoCheck for caller permissions in virtual touchpad service
Daniel Nicoara [Thu, 20 Apr 2017 21:40:48 +0000 (17:40 -0400)]
Check for caller permissions in virtual touchpad service

Bug: 37542947
Test: Compiled and ran on device and verified no permission errors in VR
mode

Change-Id: I8e6198faeeb510792238f6fcce879f6bfb572281

7 years agoEnable access to display/manager socket in surfaceflinger
Alex Vakulenko [Thu, 20 Apr 2017 21:25:01 +0000 (14:25 -0700)]
Enable access to display/manager socket in surfaceflinger

DisplayManager interface is needed by VrCore. Currently the entry
point for that service is not accessible outside of `graphics` user
group which VrCore is not part of. We need to allow access to that
socket (and subsequently use selinux to fine-tune access rights
in the future).

Bug: 37486608
Test: `lunch sailfish-eng && m -j32` works and device boots
Change-Id: I1d1b545ba85aa6700b409fbbdacc330b8302049b

7 years agoRestrict VR HWC access to services with RESTRICTED_VR_ACCESS permission
Daniel Nicoara [Thu, 20 Apr 2017 20:39:35 +0000 (16:39 -0400)]
Restrict VR HWC access to services with RESTRICTED_VR_ACCESS permission

Bug: 37542947
Test: Compiled
Change-Id: I0880e6a2caaf32f111ae70ba1d54f59960796287

7 years agoMerge "libui: log an error on allocation failure" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 18:56:25 +0000 (18:56 +0000)]
Merge "libui: log an error on allocation failure" into oc-dev

7 years agoPose flicker fix on some devices
Okan Arikan [Wed, 12 Apr 2017 18:32:21 +0000 (11:32 -0700)]
Pose flicker fix on some devices

The issue was that when the sensord starts on some devices, the initial
IMU sensor fusion pose timestamps are 0 (the first 20-30). It then
starts sending the timestamps. But the latency model looks into the
latency in the initial samples and fixes the latency estimate.

Therefore the estimated latency was way off.

The solution is checking the pose timestamps before using it.

Bug: 37278649
Test: Restart device and run a VR app.
Change-Id: Ic472cb43b32de5d4af3b19547bdc32e906fbfa6a

7 years agoatrace: Poke PDX services using utility class.
Corey Tabaka [Sat, 15 Apr 2017 00:52:17 +0000 (17:52 -0700)]
atrace: Poke PDX services using utility class.

Poke PDX services to enable tracing in stand-alone services.

Bug: 37432968
Test: build; run systrace with gfx flag; observe bufferhubd traces.
Change-Id: Id03a82fa51c6ca7c595ecc29c15a742295c53d46

7 years agolibpdx: Add service poke logic to ServiceUtility.
Corey Tabaka [Mon, 17 Apr 2017 21:38:59 +0000 (14:38 -0700)]
libpdx: Add service poke logic to ServiceUtility.

Consolidate PDX service poke logic (reload system props) in the
ServiceUtility class. This used by atrace to poke PDX services
during systrace.

Bug: 37432968
Test: build succeeds.
Change-Id: Ia650f81fd5d324529b70f8796c4efbf7b3117327

7 years agoClamp reported power for each sensor to 1 microAmp.
Ashutosh Joshi [Thu, 20 Apr 2017 06:27:49 +0000 (23:27 -0700)]
Clamp reported power for each sensor to 1 microAmp.

Avoids sensors reporting zero power !
Bug: 28980713
Test: Ensure thar power reported in greater than or equal to
     1 microAmperes for all sensors.

Change-Id: I01b40c8a3701d56ded7dcc82e4c7a85b9a8ddc00

7 years agolibui: log an error on allocation failure
Chia-I Wu [Thu, 20 Apr 2017 05:20:55 +0000 (22:20 -0700)]
libui: log an error on allocation failure

This was on the gralloc0/gralloc1 path, but was missing from the HIDL
gralloc path.

Bug: 37444686
Test: allocate an invalid buffer
Change-Id: If1ea0e27c228d82abbcd6f6290eb8fee423828e7

7 years agoMerge "libpdx_uds: Serialize access to connection socket between threads" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 04:11:17 +0000 (04:11 +0000)]
Merge "libpdx_uds: Serialize access to connection socket between threads" into oc-dev

7 years agoMerge "Fix reference loop in IEventQueue implementation." into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 04:08:29 +0000 (04:08 +0000)]
Merge "Fix reference loop in IEventQueue implementation." into oc-dev

7 years agoMerge "libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair" into...
TreeHugger Robot [Thu, 20 Apr 2017 03:57:16 +0000 (03:57 +0000)]
Merge "libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair" into oc-dev

7 years agoMerge "Calculate batching param in a smarter way" into oc-dev
Peng Xu [Thu, 20 Apr 2017 02:01:37 +0000 (02:01 +0000)]
Merge "Calculate batching param in a smarter way" into oc-dev

7 years agoFix reference loop in IEventQueue implementation.
Yifan Hong [Thu, 20 Apr 2017 01:45:30 +0000 (18:45 -0700)]
Fix reference loop in IEventQueue implementation.

EventQueue's destructor is never called because
EventQueueLooperCallback has a strong reference to it,
and EventQueueLooperCallback is never destroyed because
the file descriptor is never removed from the looper.

Bug: 37280081
Test: camera works
Test: event queue is destroyed when client removes
its reference (from logcat)

Change-Id: I12347b6d1cca354288382555d2d9a20acfa59233

7 years agoMerge "Fix default optics" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 01:20:01 +0000 (01:20 +0000)]
Merge "Fix default optics" into oc-dev

7 years agoMerge "Remove the lookup distortion class" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 01:19:47 +0000 (01:19 +0000)]
Merge "Remove the lookup distortion class" into oc-dev

7 years agoMerge "Otapreopt: Fix count" into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 00:34:55 +0000 (00:34 +0000)]
Merge "Otapreopt: Fix count" into oc-dev

7 years agoMerge "Reflect removal of vndservice_manager SELinux object manager." into oc-dev
TreeHugger Robot [Thu, 20 Apr 2017 00:06:41 +0000 (00:06 +0000)]
Merge "Reflect removal of vndservice_manager SELinux object manager." into oc-dev

7 years agoFix default optics
Hendrik Wagenaar [Tue, 18 Apr 2017 22:12:30 +0000 (15:12 -0700)]
Fix default optics

* Prior cl caused an infinite loop with the defaults
* Removed linear approximation - it caused issues with
  inverse distortion

Bug: 37443861
Test: Manually ran on a few phones
Test: Wrote a program that compared the distortion and
      undistortion values with the old and new path
Change-Id: I7221679585dd7f0fe966ff11170e9d3ec74a51df

7 years agoMerge "Hold onto FileHandles for glBindSharedBufferQCOM calls" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 23:11:12 +0000 (23:11 +0000)]
Merge "Hold onto FileHandles for glBindSharedBufferQCOM calls" into oc-dev

7 years agoFix AHardwareBuffer 10:10:10:2 format
Jesse Hall [Wed, 19 Apr 2017 22:43:02 +0000 (15:43 -0700)]
Fix AHardwareBuffer 10:10:10:2 format

Rename this format to match the component ordering we use in the other
formats (RGBA, in LSB to MSB order), and associate it with the right
Vulkan format (A2B10G10R10_UNORM_PACK32, not the BGRA-order
A2R10G10B10_UNORM_PACK32): the former is required in Vulkan while the
latter isn't, and it makes sense for us to be consistent with that.

Also use the _FLOAT suffix for the 4xFP16 format, not _SFLOAT; we don't
use the latter anywhere else and we don't have unsigned floats.

Bug: 37515907
Test: make checkbuild
Change-Id: I4f9e5e39ddef41d373290c26c92d5b94a884a740

7 years agoMerge changes If30bfa71,Ib8f78967 into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 22:34:25 +0000 (22:34 +0000)]
Merge changes If30bfa71,Ib8f78967 into oc-dev

* changes:
  pdx_benchmarks: Let the service create sockets by itself
  libpdx_uds: Fix send/receive over socket to handle signal interrupts

7 years agoDO NOT MERGE: SF: disable HW vsync while dozing am: 46d455b3ab
Zheng Zhang [Wed, 19 Apr 2017 22:31:37 +0000 (22:31 +0000)]
DO NOT MERGE: SF: disable HW vsync while dozing am: 46d455b3ab
am: eee8fc1cd2  -s ours

Change-Id: I27ca7dfc0618b18865379441f0ab32d06477d220

7 years agoDO NOT MERGE: SF: disable HW vsync while dozing
Zheng Zhang [Wed, 19 Apr 2017 22:29:07 +0000 (22:29 +0000)]
DO NOT MERGE: SF: disable HW vsync while dozing
am: 46d455b3ab

Change-Id: I8e2eb78fc79b5127d9baa6079095115c431e1823

7 years agoOtapreopt: Fix count
Andreas Gampe [Wed, 19 Apr 2017 20:58:49 +0000 (13:58 -0700)]
Otapreopt: Fix count

Don't count null for argc.

Bug: 37158297
Test: m
Test: OTA pre-versioned -> OTA versioned
Change-Id: I378b0b7b445f34c766460182d724d6abd84ff773

7 years agoMerge "Otapreopt: Add non-profile fallback" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 20:31:59 +0000 (20:31 +0000)]
Merge "Otapreopt: Add non-profile fallback" into oc-dev

7 years agoMerge "Run dex2oat from the staged apk directory." into oc-dev
Jeff Hao [Wed, 19 Apr 2017 20:16:18 +0000 (20:16 +0000)]
Merge "Run dex2oat from the staged apk directory." into oc-dev

7 years agoMerge "DVRBuffer functions should acquire AHardwareBuffer" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 19:51:37 +0000 (19:51 +0000)]
Merge "DVRBuffer functions should acquire AHardwareBuffer" into oc-dev

7 years agolibpdx_uds: Serialize access to connection socket between threads
Alex Vakulenko [Tue, 18 Apr 2017 21:41:33 +0000 (14:41 -0700)]
libpdx_uds: Serialize access to connection socket between threads

Added a mutex to allow only one client thread to perform atomic
send-request/receive-responce actions.

Also added a unit test that perfroms multiple parallel client requests
to the same service to ensure it can handle multithreaded access
correctly.

Bug: 37443070
Test: `libpdx_uds_tests` pass
Change-Id: Ica516f7806f9146fb530b5cb371d2ee89146fed7

7 years agolibpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair
Alex Vakulenko [Tue, 18 Apr 2017 21:37:20 +0000 (14:37 -0700)]
libpdx_uds: Allow to create Endpoint/ClientChannel from a socket pair

This is important to enable Service/Client operation in unit tests.
Being able to create a pair of Unix domain sockets and construct both
Service and Client so that they can talk to each other without having
to create a physical socket file is convenient.

This change makes it possible to create an instance of Endpoint and
ClientChannel classes based just on a pair of sockets (Endpoint does
take another socket to simulate the main endpoint FD to accept incoming
connection on, but it is not used for this, only the shutdown events
are received from that main socket. Endpoint uses the channel FD to
perform actual communication with the client).

Bug: 37443070
Test: `libpdx_uds_tests` pass
Change-Id: Ifa1a9d03b97bd90282a04715c2105ad37a8de936

7 years agopdx_benchmarks: Let the service create sockets by itself
Alex Vakulenko [Mon, 17 Apr 2017 23:19:51 +0000 (16:19 -0700)]
pdx_benchmarks: Let the service create sockets by itself

Default implementation of Endpoint::Create() takes the socket name
as provided by the init process when it forks. pdx_benchmark is not
a service but a command-line utility and it is being started manually
and not through init process. So, named sockets are not available.
Instead, it must create a socket by the specified name. For this,
it must use Endpoint::CreateAndBindSocket() method.

Bug: 37507039
Test: Tested manually on device: `pdx_benchmarks --service foo`.
Change-Id: If30bfa7138f5a97ba0bff9e61460c6bd3697ec19

7 years agoMerge "Return error when trying to disconnect twice" into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 18:47:44 +0000 (18:47 +0000)]
Merge "Return error when trying to disconnect twice" into oc-dev

7 years agoRun dex2oat from the staged apk directory.
Jeff Hao [Thu, 6 Apr 2017 00:11:39 +0000 (17:11 -0700)]
Run dex2oat from the staged apk directory.

The frameworks/base change makes the PackageManager pass relative paths
of previous code paths as shared library paths. This change passes the
base directory for these relative paths to dex2oat using the new switch
--classpath-dir.

Part of a multi-project change.

Bug: 34169257
Test: cts-tradefed run singleCommand cts -d --module
CtsAppSecurityHostTestCases -t android.appsecurity.cts.SplitTests

(cherry-picked from commit cc5c4e32637601432bc6359fb7ff34e4cadb6502)

Change-Id: I8f941eb9982a051c1f49256d5489f2575af1d80f

7 years agolibpdx_uds: Fix send/receive over socket to handle signal interrupts
Alex Vakulenko [Mon, 17 Apr 2017 19:02:38 +0000 (12:02 -0700)]
libpdx_uds: Fix send/receive over socket to handle signal interrupts

Previous implementation of send/receive didn't account for the fact that
send/receive operation might be interrupted by a signal and transfer
fewer bytes than requested.

Fix this by repeatedly calling send/recv until all the requested data
is transferred over sockets.

Also added a number of unit tests for send/receive functions.

Bug: 37427314
Test: `m -j32` succeeds for Sailfish.
      `libpdx_uds_tests` pass on device

Change-Id: Ib8f78967af3c218d9f18fb3dfe8953c35800540b

7 years agoOtapreopt: Add non-profile fallback
Andreas Gampe [Tue, 18 Apr 2017 03:04:02 +0000 (20:04 -0700)]
Otapreopt: Add non-profile fallback

Slightly refactor compilation flow. Add a fallback option: if the
compilation fails and was profile-guided, attempt a non-profile-
guided compilation. This makes A/B OTA more robust to profile
format changes.

Bug: 37256688
Test: m
Test: manual OTA N -> O
Change-Id: I20c4b44a87c0f7faa8920abdae01e39379405eca

7 years agoMerge "libui: remove gralloc0/gralloc1 support" into oc-dev
Chia-I Wu [Wed, 19 Apr 2017 16:16:21 +0000 (16:16 +0000)]
Merge "libui: remove gralloc0/gralloc1 support" into oc-dev

7 years agoDVRBuffer functions should acquire AHardwareBuffer
Hendrik Wagenaar [Wed, 19 Apr 2017 05:03:09 +0000 (22:03 -0700)]
DVRBuffer functions should acquire AHardwareBuffer

Bug: 37488135
Test: Updated DVR buffer tests
Change-Id: Ia255aca571e7162382e7be3c13be8ea192adbc90

7 years agoRemove the lookup distortion class
Hendrik Wagenaar [Wed, 19 Apr 2017 03:45:10 +0000 (20:45 -0700)]
Remove the lookup distortion class

* This class is no longer used.

Test: Compiled locally
Bug: 37487610
Change-Id: Ie0bd1441e04086990309d5eb4ca3b4f64351ae05

7 years agoFix external cache and secondary user bugs.
Jeff Sharkey [Mon, 17 Apr 2017 22:44:41 +0000 (16:44 -0600)]
Fix external cache and secondary user bugs.

External cache files now have their own GID range, so measure using
those quotas.  Fix secondary user code measurement, since it always
lives under user 0.  Fix secondary user data measurement in manual
mode; we need to match based on appId instead of pure UID.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 358128993584491937193650
Change-Id: Ic3b153798164c33ea10e8a4dabc65edff26c56ca

7 years agoMerge "atrace: Don't NPE if we can't access hal-related tracepoint files." into oc-dev
TreeHugger Robot [Wed, 19 Apr 2017 01:06:26 +0000 (01:06 +0000)]
Merge "atrace: Don't NPE if we can't access hal-related tracepoint files." into oc-dev

7 years agoMerge "Add atrace_userdebug.rc to enable some tracepoints for userdebug only." into...
Carmen Jackson [Tue, 18 Apr 2017 23:37:48 +0000 (23:37 +0000)]
Merge "Add atrace_userdebug.rc to enable some tracepoints for userdebug only." into oc-dev

7 years agoDO NOT MERGE: SF: disable HW vsync while dozing
Zheng Zhang [Fri, 17 Mar 2017 10:19:39 +0000 (11:19 +0100)]
DO NOT MERGE: SF: disable HW vsync while dozing

It cancels any in-progress resync when display goes to sleep, then
it avoids any unexpected wake up due to delayed frames once device
has just switched to ambient mode.

In DOZE_SUSPEND, screen displays a still image in a self-refresh mode,
so there is no need to keep aligned with HW vsync. At the opposite, DOZE
mode is used to refresh the screen in Ambient (i.e. watchface refresh,
nofications, app updates in ambi-active), hence resync SF to HW vsync.

Bug: 35998607
Bug: 36215242
Change-Id: I22cd8f84e9aca04b4f657fe07785751cf31a7c68

7 years agoatrace: Don't NPE if we can't access hal-related tracepoint files.
Carmen Jackson [Tue, 18 Apr 2017 22:37:57 +0000 (15:37 -0700)]
atrace: Don't NPE if we can't access hal-related tracepoint files.

This currently NPEs when Traceur attempts to start a trace.
Based on b/34242478, this is currently expected and we should fail
gracefully instead.

Bug: 37281960

Test: Starting a trace using Traceur on a userdebug build succeeds.

Change-Id: I082d5750625dec0e1db4a1dd341dc332d8dd752f

7 years agoMerge "Fix query management in GpuProfiler" into oc-dev
Steven Thomas [Tue, 18 Apr 2017 22:25:39 +0000 (22:25 +0000)]
Merge "Fix query management in GpuProfiler" into oc-dev

7 years agoMerge "[vr] Add DVR API to get native handle for buffers" into oc-dev
TreeHugger Robot [Tue, 18 Apr 2017 22:08:09 +0000 (22:08 +0000)]
Merge "[vr] Add DVR API to get native handle for buffers" into oc-dev