OSDN Git Service
TreeHugger Robot [Thu, 3 Aug 2017 19:33:53 +0000 (19:33 +0000)]
Merge "Fix missing check on buffer import." into oc-dr1-dev
TreeHugger Robot [Thu, 3 Aug 2017 12:45:02 +0000 (12:45 +0000)]
Merge "libsurfaceflinger: handle WINDOW_TYPE_DONT_SCREENSHOT" into oc-dr1-dev
TreeHugger Robot [Wed, 2 Aug 2017 21:40:32 +0000 (21:40 +0000)]
Merge "Remove constraint on touch location." into oc-dr1-dev
Chia-I Wu [Tue, 1 Aug 2017 18:29:00 +0000 (11:29 -0700)]
libsurfaceflinger: handle WINDOW_TYPE_DONT_SCREENSHOT
When a layer has type WINDOW_TYPE_DONT_SCREENSHOT, hide it from
everywhere but the primary display. This should be reverted when we
switch to use layer hierarchy properly.
Bug:
63311708
Test: screencap, screenrecord, android.view.cts.SurfaceViewSyncTest
Change-Id: I6a8d6b93399b0dc42832588f9a6c5e8879a8b754
Tarandeep Singh [Wed, 2 Aug 2017 20:32:58 +0000 (20:32 +0000)]
Merge changes from topic '
62033391' into oc-dr1-dev
* changes:
Add displayId in InputDispatcher, InputTransport
Enable InputMonitors for non-default display.
TreeHugger Robot [Wed, 2 Aug 2017 18:35:41 +0000 (18:35 +0000)]
Merge changes If4271719,I9c9b5de9,I46a26a67 into oc-dr1-dev
* changes:
Communicate composition buffer dataspace to HWC
Add VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT.
Check wide-color support before adding extensions
TreeHugger Robot [Wed, 2 Aug 2017 18:35:05 +0000 (18:35 +0000)]
Merge "EGL: Add EGL_GL_scrgb extension" into oc-dr1-dev
Tarandeep Singh [Mon, 31 Jul 2017 17:51:54 +0000 (10:51 -0700)]
Add displayId in InputDispatcher, InputTransport
Bug:
62033391
Test: make StructLayout_test
make libinput_tests_InputEvent_test
make libinput_tests_InputPublisherAndConsumer_test
Run tests under /data/nativetest64/libinput_tests/
Change-Id: Id02cab83924d399eae0c1c233dc545fbb64945c2
Courtney Goeltzenleuchter [Thu, 13 Jul 2017 23:54:01 +0000 (17:54 -0600)]
Communicate composition buffer dataspace to HWC
Test: adb shell dumpsys SurfaceFlinger
look for dataspace info in DisplayDevice section
Bug:
63146977
Change-Id: If427171994fbc91faacf5bad9cc736ddfbd35ec3
(cherry picked from commit
79d272442ce13418c3ea81c95d7fea0159b4b481)
Courtney Goeltzenleuchter [Sun, 9 Jul 2017 18:50:57 +0000 (12:50 -0600)]
Add VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT.
Bug:
63077212
Test: CTS basicExtensionTest
Change-Id: I9c9b5de99249a6fdd49df1995971c14915f6a7c8
(cherry picked from commit
edc88e78a30ca412a0a085a21f1fc1be7be5081f)
Courtney Goeltzenleuchter [Fri, 7 Jul 2017 20:55:40 +0000 (14:55 -0600)]
Check wide-color support before adding extensions
Don't want applications seeing the wide-color EGL extensions
if the device or display cannot support wide-color.
Bug:
63170158
Test: adb shell /data/nativetest/test-opengl-gl2_basic/test-opengl-gl2_basic
Verify that EGL_EXT_gl_colorspace_scrgb, EGL_EXT_gl_colorspace_scrgb_linear,
EGL_EXT_gl_colorspace_display_p3_linear and EGL_EXT_gl_colorspace_display_p3
are not present on devices that do not support wide-color, e.g. Nexus 6P
Change-Id: I46a26a67f2d6da9c5aad50d884ef02a62ccb6945
(cherry picked from commit
e5d6f994158d554c692afae0f547d89c75abde71)
Courtney Goeltzenleuchter [Fri, 23 Jun 2017 15:06:52 +0000 (09:06 -0600)]
EGL: Add EGL_GL_scrgb extension
Test: Android CTS
adb -d shell am start \
-n com.drawelements.deqp/android.app.NativeActivity \
-e cmdLine '"deqp --deqp-case=dEQP-EGL.functional.wide_color.* \
--deqp-log-filename=/sdcard/dEQP-Log.qpa"'
Bug:
62424735
Change-Id: I12a0bd64c01bcf314b4a73d8eb3151b09bf9f8ae
(cherry picked from commit
33e2b781a05f1caf274e95c143005a862223e9bf)
TreeHugger Robot [Tue, 1 Aug 2017 16:18:06 +0000 (16:18 +0000)]
Merge "sf: Defer DispSync initialization" into oc-dr1-dev
Tarandeep Singh [Mon, 17 Jul 2017 18:22:52 +0000 (11:22 -0700)]
Enable InputMonitors for non-default display.
InputFlinger today doesn't deliver InputMonitors for non-deafult
display. In order to support focussing windows on virtual-displays
(like the Vr2dDisplay), we need to be able to send motion events
to them for keyboard to gain focus.
Bug:
62033391
Test: Manual by launching
com.google.vr.vrcore/.daydream.MetaworldActivity & then
com.google.android.apps.nexuslauncher/.NexusLauncherActivity.
Exact steps are mentioned in the bug.
Change-Id: I5954e54cef8c0a29f05bc964debc95ea81f16758
Chris Forbes [Fri, 19 May 2017 21:47:29 +0000 (14:47 -0700)]
vulkan: Translate usage flags before passing to driver
Previously we just cast the 32bit flags and jammed them in the two
gralloc1 slots. Use the helper which does the correct translation.
(Yes, all these gralloc1isms are going away in favor of a single 64bit
flags field, but Vulkan HALs expect us to implement our side of
ANDROID_native_buffer correctly.)
(Cherry-picked from
4744291270cc6 in oc-dev)
Test: boot sailfish, run vulkan demo
Bug:
37686587
Change-Id: I806011986e8140d7f608d281798605bd9ca9a86b
Corey Tabaka [Sat, 29 Jul 2017 02:46:30 +0000 (19:46 -0700)]
Fix missing check on buffer import.
Fix a missing check on the success of importing buffers into the
ConsumerQueue. There is a race condition where the producer can
invalidate its buffers, for example by resizing, before the consumer
has a chance to import the previous buffers. The missing check
causes a crash in SurfaceFlinger and VrCore, which are both
consumers of application VR surface buffers.
Also fix a missing lock around the consumer queues in VR surfaces
found during the analysis of this bug.
Bug:
64042620
Test: Ran test.apk before and after the fix. Observe stable operation
after applying the fix.
Change-Id: I416df3ca47978404dcdb53599ddeec9b4bd6fb1a
Saurabh Shah [Thu, 13 Jul 2017 17:45:07 +0000 (10:45 -0700)]
sf: Defer DispSync initialization
Some DispSync members are initialized based on uninitialized static
members of sf, that are in turn initialized in sf constructor. Fix
the sequence by deferring DispSync initialization.
Current sequence:
sf constructor|-> DispSync constructor -> Access static sf members
|-> Initialize sf static members
New sequence:
sf constructor|-> DispSync constructor
|-> Initialize sf static members
|-> DispSync init -> Access static sf members
Bug:
63671437
Test: "present fences are ignored" not present in SF dumpsys
Change-Id: I618d2bbbbd4e39fc382e67f85dd8d637dd82cf38
(cherry picked from commit
f41745301d5ecfa680dcef3a1948a8a321f80509)
Michael Wright [Wed, 26 Jul 2017 15:19:11 +0000 (16:19 +0100)]
Prevent media keys from waking the device, even if they're external.
Bug:
38258736
Test: manual
Change-Id: I56deb9d99df17172ea063544334c1814a6f31509
Kevin Schoedel [Wed, 26 Jul 2017 14:40:19 +0000 (10:40 -0400)]
Remove constraint on touch location.
InputFlinger does accept and handle 'off-screen' touch input,
and it is sometimes useful, for instance for drag scrolling.
Bug:
64063111
Test: manual on device
Change-Id: I62baf4e01c583c10853518de4b87769aad29dab7
Peng Xu [Tue, 25 Jul 2017 00:50:53 +0000 (17:50 -0700)]
Initialize native Sensor object correctly
This CL gives default values for all fields in Sensor native
object.
Bug:
37640915
Test: added local logging to verify all native sensor objects are
initialized correctly.
Change-Id: I4076756249788f56960c74629cb800f1b2bae79f
TreeHugger Robot [Sat, 22 Jul 2017 01:22:30 +0000 (01:22 +0000)]
Merge "Add dvrReadBufferQueueGetEventFd" into oc-dr1-dev
Jiwen 'Steve' Cai [Fri, 21 Jul 2017 20:33:55 +0000 (13:33 -0700)]
Add dvrReadBufferQueueGetEventFd
We need to expose the read queue's event fd, so that a caller can epoll
on a set of queues' fd for efficient buffer acquisition.
Bug:
62359843
Test: dvrapi-test
Change-Id: I1b9271afed9ee6c6675551402cd3f5a66e98ebe2
Romain Guy [Fri, 21 Jul 2017 01:49:46 +0000 (18:49 -0700)]
Postpone color mode change until after boot animation
sRGB is only set by SurfaceFlinger when the default display is
wide color capable. Since we compute the best color mode on
every frame anyway for wide color capable displays, we can
simply move the sRGB set to the end of the boot animation.
Bug:
63823274
Test: Manual
Change-Id: I11bb6095acb63e66bcf7dff9e3f7b36588e371c1
Chia-I Wu [Fri, 21 Jul 2017 15:28:01 +0000 (15:28 +0000)]
Merge "surfaceflinger: fix initial crop computation" into oc-dr1-dev
TreeHugger Robot [Fri, 21 Jul 2017 06:42:49 +0000 (06:42 +0000)]
Merge "Properly applies the selected saturation boost (vivid mode)" into oc-dr1-dev
Romain Guy [Thu, 20 Jul 2017 19:47:14 +0000 (12:47 -0700)]
Properly applies the selected saturation boost (vivid mode)
The saturation boost setting is read by SurfaceFlinger as a
persistent system property. Unfortunately, persistent props
are only available after Vold is up and /data is decrypted,
which may happen before or after SF attempts to read the
property.
This CL moves the propery lookup to the end of the boot
animation. This solves two issues:
- The saturation boost will not be applied to the boot animation
- The vivid colors user setting is now reliably applied
Bug:
63823274
Test: Manual
Change-Id: Icb8e30c799c30cf674f0fc0bab0369f4c99367ed
Wei Wang [Thu, 20 Jul 2017 03:59:39 +0000 (20:59 -0700)]
SurfaceFlinger: Set property in StartPropertySetThread during init
This is similar to ag/
1849505/ (see b/
34499826), which by setting
property in a separate thread, that CL aims to avoid slow initialization
in SurfaceFlinger::init where SurfaceFlinger is waiting on
property_service.
There is new property_set() call added, and this CL is to move it to the
StartPropertySetThread.
Bug:
63844978
Test: on taimen with simulated delay ag/
2562492/
Change-Id: I31547cb5e75f44eac635386b3cf345a44931c78f
Chia-I Wu [Thu, 20 Jul 2017 21:24:37 +0000 (14:24 -0700)]
surfaceflinger: fix initial crop computation
This function computes the crop of the layer, that is, the region of
the layer to be drawn. We must consider the size of the layer when
applying s.active.crop.
Bug:
63786936
Test: manual
Change-Id: I8000413beba54a054db8d7ad28e868d23b0167ab
Ashutosh Joshi [Wed, 19 Jul 2017 16:52:57 +0000 (09:52 -0700)]
Use appendFormat instead of append when passing arguments
Using append crashes the system.
Bug:
63804323
Test: On a contrived build with no sensors, dumpsys does not crash the
sensorservice.
Change-Id: I4ee942d58af8347388f4f5f71c48da339c1cf7e7
Hsin-Yi Chen [Wed, 19 Jul 2017 03:54:27 +0000 (03:54 +0000)]
Merge "Add target binderDriverInterfaceTest_IPC_32" into oc-dev
am:
72cce2f70a
Change-Id: I7c81227c25df80581ef40b40da84915abcb3b7e9
Hsin-Yi Chen [Wed, 19 Jul 2017 03:54:05 +0000 (03:54 +0000)]
Add binderLibTest_IPC_32
am:
75be4a1000
Change-Id: I1ad068367e6e3c0ddbf44825bbe4e1aadee1948a
Hsin-Yi Chen [Wed, 19 Jul 2017 03:51:43 +0000 (03:51 +0000)]
Merge "Add target binderDriverInterfaceTest_IPC_32" into oc-dev
Chia-I Wu [Tue, 18 Jul 2017 18:30:05 +0000 (11:30 -0700)]
surfaceflinger: fix a nullptr dereference
When the child layer latched a buffer but the fixed-size parent
layer never did (for reasons such as no buffer queued or buffer got
rejected), we could end up with p->mActiveBuffer being nullptr.
Bug:
62996512
Test: manual (I could never repro anyway)
Change-Id: Id7e4c7037633b8a37039baa6e8a306e55170b894
Steven Thomas [Tue, 18 Jul 2017 00:19:04 +0000 (00:19 +0000)]
Merge "Fix concurrent writes to the hardware composer" into oc-dr1-dev
Steven Thomas [Mon, 17 Jul 2017 20:59:23 +0000 (13:59 -0700)]
Fix concurrent writes to the hardware composer
Stale hardware composer layers were causing concurrent writes to the
Composer object from the surface flinger and vr flinger threads, a big
no-no. The concurrent writes would sometimes stomp on each other,
causing the hardware composer service to fail to read the command buffer
containing surface flinger's composer commands, leading to all sorts of
issues.
Bug:
62925812
Test: Locally added logs to surface flinger to catch the concurrent
writes, and confirmed the logs are no longer present with this patch
applied. Went through a bunch of sleep/wake cycles and confirmed the
device continues to function normally.
Change-Id: I70929c4a3c71142f5e9083cac294c122d127aa27
TreeHugger Robot [Mon, 17 Jul 2017 21:35:38 +0000 (21:35 +0000)]
Merge "Fix memory leak." into oc-dr1-dev
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
(cherry picked from commit
6929575affc7d0037c79a45b2cb0ef7c6020581a)
Hsin-Yi Chen [Thu, 6 Jul 2017 03:40:20 +0000 (11:40 +0800)]
Add binderLibTest_IPC_32
1) Add product_variables to binderLibTest because the test case
CheckHandleZeroBinderHighBitsZeroCookie uses binder data structure.
2) Add binderLibTest_IPC_32 which always compiles the test program for
32-bit binder.
Bug:
63307240
Bug:
62366937
Test: vts-tradefed run commandAndExit vts -m VtsKernelBinderTest
Change-Id: I40c738a039459fbfece9689012249ae7ea93df9d
(cherry picked from commit
f6edfc1b096cba544227d85b0ea3f38a4dd11af5)
Dan Stoza [Fri, 14 Jul 2017 20:38:46 +0000 (20:38 +0000)]
Merge changes I23e6f088,I800208e8,I55123a7a into oc-dr1-dev
* changes:
SF: Move screenshot Surface ops off main thread
SF: Add ImageHolder for screenshot code
SF: Add WindowDisconnector for screenshot code
TreeHugger Robot [Fri, 14 Jul 2017 19:33:18 +0000 (19:33 +0000)]
Merge "Add GraphicBufferMapper::preloadHal" into oc-dr1-dev
Corey Tabaka [Fri, 14 Jul 2017 18:43:49 +0000 (11:43 -0700)]
Fix memory leak.
A missing destructor caused a memory leak in the UDS backend for PDX.
Add the destructor and use std namespace for realloc/malloc/free.
Bug:
63026993
Test: Ran pdx_benchmarks for 400M iterations before and after fix.
Confirmed that heap grows before fix and is stable after fix.
Confirmed that VR service reported in the bug now have stable
memory use.
Change-Id: If870a5db50dfaf5f212285824a1803f34acdabc7
Dan Stoza [Thu, 1 Jun 2017 23:40:30 +0000 (16:40 -0700)]
SF: Move screenshot Surface ops off main thread
This change rearranges the various operations that correspond to
capturing a screenshot such that all of the Surface-related ones
(connect, dequeue, queue, disconnect) are performed on the incoming
Binder thread rather than on SurfaceFlinger's main thread. This has two
major benefits:
1) It reduces the amount of time that the SurfaceFlinger main thread
is blocked while performing a screenshot, often by a considerable
amount. This should reduce the risk of jank when screenshots are
taken, such as for task snapshots during window transitions.
2) It means that the SurfaceFlinger main thread is not susceptible to
being blocked by a badly-performing BufferQueue consumer. This
also enables us to remove the GraphicProducerWrapper class, which
was previously performing a similar role.
Finally, this change also adds a mechanism that detects if the
screenshot would have been performed between the two phases of normal
SurfaceFlinger operation (invalidate and refresh), and defers it if
this condition is detected. This should further reduce the risk of jank
as a screenshot will only occur between frames rather than in the
middle of a frame.
Bug:
62257775
Test: SurfaceFlinger_test and manual verification that screenshots
still work
Change-Id: I23e6f088b4d6e477472dfc2a6c36ef3dd930c047
TreeHugger Robot [Fri, 14 Jul 2017 01:53:23 +0000 (01:53 +0000)]
Merge "Fix ALOGE_IF log in bufferhubqueue" into oc-dr1-dev
TreeHugger Robot [Thu, 13 Jul 2017 23:01:06 +0000 (23:01 +0000)]
Merge "Add sensor HAL process into dump list" into oc-dr1-dev
Jiwen 'Steve' Cai [Wed, 12 Jul 2017 22:08:59 +0000 (15:08 -0700)]
Fix ALOGE_IF log in bufferhubqueue
Bug:
63636350
Test: system builds when with TRACE=1 override
Change-Id: Icc1245191b90aafbb553a1d2b0bce3bae4d0a05a
Dan Stoza [Thu, 1 Jun 2017 21:37:39 +0000 (14:37 -0700)]
SF: Add ImageHolder for screenshot code
Adds a simple ImageHolder class, which holds an EGLImage and destroys
it either when an explicit destroy() method is called or when the class
is destructed (whichever occurs first). This allows us to reduce the
nesting of, and otherwise simplify, the captureScreenImplLocked method
of SurfaceFlinger.
Bug:
62257775
Test: SurfaceFlinger_test and manually verified that screenshots still
work
Change-Id: I800208e8f6bedd2ce66827268ecc64968dbe616d
Dan Stoza [Thu, 1 Jun 2017 21:16:23 +0000 (14:16 -0700)]
SF: Add WindowDisconnector for screenshot code
Adds a simple WindowDisconnector class that holds an ANativeWindow* and
disconnects from it when it goes out of scope. This allows us to
drastically reduce the nesting of the captureScreenImplLocked method
of SurfaceFlinger.
Bug:
62257775
Test: SurfaceFlinger_test and manually verified that screenshots still
work
Change-Id: I55123a7a6b2036158d0959328b0e6f8b206cce5d
Peng Xu [Wed, 12 Jul 2017 04:14:42 +0000 (21:14 -0700)]
Add sensor HAL process into dump list
Test: adb bugreport contains native stack trace for
/vendor/bin/hw/android.hardware.sensors@1.0-service
Bug:
63096400
Change-Id: I2c24d4fd2fab7ed52dbd12b5324ae03aeaec3cda
Jesse Hall [Thu, 6 Jul 2017 21:02:29 +0000 (14:02 -0700)]
Add GraphicBufferMapper::preloadHal
Plumbing to allow Zygote to explicitly preload the a.h.graphics.mapper
HAL. An earlier attempt did this implicitly with a static initializer in
libui.so, but the library is also used by non-Zygote processes that
don't have access to HALs. This way, the HIDL libraries and HAL are only
loaded in Zygote and its children, not random other processes.
Bug:
62353585
Test: check that a.h.graphics.mapper is in /proc/`pid zygote64`/maps
Change-Id: I4989c8089e3a4cfd627f8940f5552950c1c617fc
(cherry picked from commit
5dac7819ac9461c14f0b7c208597579c5c3fb814)
Peng Xu [Tue, 11 Jul 2017 21:49:59 +0000 (21:49 +0000)]
Merge "Synchronous resource recover mechanism for ISensorEventConnection" into oc-dr1-dev
Wei Wang [Tue, 11 Jul 2017 19:49:01 +0000 (19:49 +0000)]
Merge changes from topic 'svcmgr_shutdown_critical' into oc-dr1-dev
* changes:
servicemanager: Mark servicemanager as shutdown critical
servicemanager: Mark vndservicemanager as shutdown critical
Wei Wang [Tue, 11 Jul 2017 17:01:09 +0000 (10:01 -0700)]
servicemanager: Mark servicemanager as shutdown critical
Bug:
62951929,
63514363,
62845700
Test: Build
Change-Id: Ib1b7aec4b6d3c590eb469daeed40b954d37efa18
Roopesh Rajashekharaiah Nataraja [Mon, 10 Jul 2017 23:22:27 +0000 (16:22 -0700)]
servicemanager: Mark vndservicemanager as shutdown critical
vndservicemanager needs to be alive during shutdown to allow vndk
components which may run during shutdown to communicate. The system
ndk servicemanager keeps running throughout shutdown, so this brings
the vndservicemanager on par with that behavior.
Bug:
62951929,
63514363,
62845700
Test: Build
Change-Id: Iba154820ef69c6491a5cb05747b6b905763a825d
TreeHugger Robot [Tue, 11 Jul 2017 16:50:17 +0000 (16:50 +0000)]
Merge "Fix BufferHub state machine to return errors on invalid transitions." into oc-dr1-dev
Peng Xu [Mon, 10 Jul 2017 23:41:08 +0000 (16:41 -0700)]
Synchronous resource recover mechanism for ISensorEventConnection
Add synchronous destroy() function to recover resource used by
remote ISensorEventConnection object.
Bug:
63542033
Test: SensorDirectReportTest pass
Change-Id: If98782ee12c7b1a733eb15a2fd8d7c5dacde243b
TreeHugger Robot [Mon, 10 Jul 2017 20:39:01 +0000 (20:39 +0000)]
Merge "Make default permission checks in performance service more restrictive." into oc-dr1-dev
TreeHugger Robot [Mon, 10 Jul 2017 20:33:44 +0000 (20:33 +0000)]
Merge "Fix concurrent access bug in VrFlinger." into oc-dr1-dev
TreeHugger Robot [Mon, 10 Jul 2017 19:24:27 +0000 (19:24 +0000)]
Merge "Clear callbacks when destroying DvrHwcClient" into oc-dr1-dev
Calin Juravle [Mon, 10 Jul 2017 19:07:15 +0000 (19:07 +0000)]
Merge "Validate the size of all dex paths eagerly" into oc-dr1-dev
TreeHugger Robot [Mon, 10 Jul 2017 19:04:32 +0000 (19:04 +0000)]
Merge "dvrReadBufferQueueDequeue: allow empty metadata" into oc-dr1-dev
TreeHugger Robot [Mon, 10 Jul 2017 18:56:20 +0000 (18:56 +0000)]
Merge "Include tracking state bits to DvrPose." into oc-dr1-dev
Calin Juravle [Thu, 6 Jul 2017 23:29:11 +0000 (16:29 -0700)]
Validate the size of all dex paths eagerly
Also, increase the PKG_PATH_MAX which is used as the max path length to
1024. This should accommodate reasonably long dex path (to cover for
longer secondary dex files paths).
If a dex path exceeds 1024 characters the dex file will not be compiled.
Bug:
63285397
Test: manual
1) create an artifical long paths under gmscore:
2) update /data/system/package-dex-usage.list to simulate the use of those
dex file
3) run `adb shell cmd package compile -r bg-dexopt --secondary-dex
com.google.android.gms`
4) observe that a 256+ characters dex path is ok while a 1024+ long one
fails.
5) run `adb shell cmd package reconcile-secondary-dex-files
com.google.android.gms` and check no errors are present.
Change-Id: I23b34013e32c5c64ca9c1381cc4d8d67e7121cc8
Corey Tabaka [Fri, 7 Jul 2017 01:04:27 +0000 (18:04 -0700)]
Fix BufferHub state machine to return errors on invalid transitions.
The consumer side of the BufferHub flow did not have an adequate
state machine to track transitions and return errors when Acquire
or Release are requested from the wrong state. This bug allowed
other buggy usage to go unnoticed.
- Fix the consumer state machine to correctly validate all requests.
- Add tests to verify correctness of the fix.
Tested BufferHub with the new test before and after the fix and
verified that the test catches the problem and that the fix solves
the problem.
Bug:
62886596
Bug:
63149525
Test: bufferhub_tests passes.
Change-Id: I802679ed74c7f505b9243ba4048824350d4e37be
Corey Tabaka [Wed, 31 May 2017 23:37:40 +0000 (16:37 -0700)]
Restore PDX support to atrace.
Restore PDX service tracing in atrace. This time only enable poking PDX services
when the "pdx" trace category is included.
Bug:
62882199
Test: Run systrace with/without pdx category and observe correct poke behavior.
Change-Id: I478332a661c3b8bc6061fda43f64b75d8113b305
Corey Tabaka [Thu, 6 Jul 2017 22:39:49 +0000 (15:39 -0700)]
Fix concurrent access bug in VrFlinger.
VR surface queues have erroneous concurrent access from two threads
because of misplaced lock guards. Move the locking to cover the
queue accesses.
Bug:
62886596
Bug:
63149525
Test: Extensive logging shows that buffers are accessed in the
correct order and that the consistency of the queues is now
maintained.
Change-Id: I649e3d75a2230cf3aff50886df9958917d3aa4bf
Pat Plunkett [Thu, 29 Jun 2017 22:40:41 +0000 (15:40 -0700)]
Clear callbacks when destroying DvrHwcClient
When a DvrHwcClient is destroyed, the VrComposer retains a reference to its
observer. Because registerObserver returns a non-OK status if an observer
is already registered, this was causing subsequent DvrHwcClients to not be
created.
This was an issue with the CompatibilityUiOverlay app on standalone
headsets. CompatibilityUiOverlay was destroying its DvrHwcClient when turning
the screen off, but upon turning the screen back on, CompatibilityUiOverlay
was unable to create another DvrHwcClient.
Bug:
63139142
Test: Turn the screen off/on for a standalone headset, observe
CompatibilityUiOverlay running.
Change-Id: Ie45e961d2bf977ab9a661e23c558354d3a96ae20
Jiwen 'Steve' Cai [Sat, 1 Jul 2017 00:04:28 +0000 (17:04 -0700)]
dvrReadBufferQueueDequeue: allow empty metadata
Currently, when there is no metadata on the read buffer queue, we have
to pass in dummy out_metadata; otherwise the API always return
-EINVAL. This CL allows (nullptr, 0) as legit input and add test to
cover that.
Bug:
62958474
Test: Ran the updated DvrBufferQueueTest
Change-Id: I0ad666006a5d93b67a48b9c34f27e325dfa9a419
Chia-I Wu [Fri, 30 Jun 2017 19:51:05 +0000 (12:51 -0700)]
surfaceflinger: refresh after latching any buffer
We should not skip refresh when a latched buffer happens to have an
empty dirty region. Also, we should signal a layer update when we
skip refresh.
Bug:
62752640
Test: manual
Change-Id: Ia603e7eeb37491c6ece7ea08d5d1e3b7ba93e6fa
Corey Tabaka [Fri, 30 Jun 2017 18:27:57 +0000 (11:27 -0700)]
Make default permission checks in performance service more restrictive.
- Check sending process in unrestricted policies.
- Allow IsTrustedUid() to cache results for better runtime efficiency.
- Update tests to verify unrestricted policy behavior.
Bug:
62468109
Test: performance_service_tests passes.
Change-Id: I0614879c8bde35ffeda2f673a3da68092433dc1a
TreeHugger Robot [Fri, 30 Jun 2017 15:36:48 +0000 (15:36 +0000)]
Merge "Fix potential access to invalid memory during shutdown" into oc-dr1-dev
Luke Song [Fri, 30 Jun 2017 02:14:54 +0000 (02:14 +0000)]
Merge "Add dvr api entries for sensor enable/disable" into oc-dr1-dev
Phil Weaver [Fri, 30 Jun 2017 01:57:31 +0000 (01:57 +0000)]
Merge "Trust navbar panel and accessibility overlays" into oc-dr1-dev
Okan Arikan [Mon, 26 Jun 2017 17:57:24 +0000 (10:57 -0700)]
Include tracking state bits to DvrPose.
These will be used internally for debugging so VrCore
has an idea about what's going on with Tango.
Bug:
62917278
Test: No functional change.
Change-Id: I7f5f7a2ccad4f0259ee5219726bf0e6890f34187
Luke Song [Tue, 27 Jun 2017 21:03:45 +0000 (14:03 -0700)]
Add dvr api entries for sensor enable/disable
Follow-up to ag/
2263549 because we want to use it in VrCore now.
Bug:
63070540
Test: Api call in VrCore
Change-Id: Ic3b2c68ade31008ada8078a74ebe2945748143ae
Daniel Nicoara [Fri, 23 Jun 2017 16:48:01 +0000 (12:48 -0400)]
Fix potential access to invalid memory during shutdown
Since binder threads have a reference to the callback, need to make sure
it is properly reset before deleting the DvrHwcClient object.
Bug:
63139142
Test: Ran on device to ensure VrCore restart don't result in crashes in
DvrHwcClient
Change-Id: I559844a70d4483fee3148526f704d234994a96d4
TreeHugger Robot [Thu, 29 Jun 2017 18:44:52 +0000 (18:44 +0000)]
Merge changes Id4647e54,I66b6edbd into oc-dr1-dev
* changes:
Fix VR surface attributes.
DVR API: Implement support for deleting surface attributes.
TreeHugger Robot [Thu, 29 Jun 2017 18:44:35 +0000 (18:44 +0000)]
Merge changes I9047b298,Id9554d6b into oc-dr1-dev
* changes:
libdvr: Add performance API to platform library.
libpdx_uds: Fix uninitialized variable bug.
TreeHugger Robot [Thu, 29 Jun 2017 04:21:05 +0000 (04:21 +0000)]
Merge "Add VrFlinger dumpsys to SurfaceFlinger" into oc-dr1-dev
Corey Tabaka [Fri, 23 Jun 2017 03:39:42 +0000 (20:39 -0700)]
Fix VR surface attributes.
VR surface attributes had two issues that prevented the full extent
of their use:
1. The older clang version missed that templated copy constructor
and assignment operators do not override the default ones in
the Variant class. This caused issues with certain types when
copy constructing / assigning from another Variant of the same
type. This was noticed by running tests with a newer version of
clang which provided warnings.
2. C++ rules about implicit conversion to bool from types that
decay to pointers causes subtle issues with Variants that have
bool elements.
For example this assignment compiles but produces the wrong
result:
const int array[3] = { 1, 2, 3};
Variant<int, bool, std::array<int, 3>> variant = array;
EXPECT_FALSE(variant.is<bool>()); // Actually true.
Here the programmer might accidentally think that the std::array
element of the variant can be assigned from the regular array.
This doesn't work, but instead the compiler decays the array to
a pointer and assigns the bool element to true.
The first issue is addressed by defining copy/move constructors /
assignment operators on Variant and deleting the default ones from
the internal Union type for extra safety.
The second issue is addressed by making a more restrictive version
of the std::is_constructible trait that rejects bool construction
from types that decay to pointers. Once this was put in place the
erroneous use cases no longer compiled and is fixed as part of
this CL.
Tests are updated to verify the fixes to these issues.
Bug:
62557221
Test: pdx_tests and dvr_api-test passes.
Change-Id: Id4647e54e0a7b1753217fe7fe351462fe5bcfd83
Corey Tabaka [Fri, 23 Jun 2017 23:20:07 +0000 (16:20 -0700)]
libdvr: Add performance API to platform library.
- Add dvrPerformanceSetSchedulerPolicy API. Only this API is exposed
through the DVR platform library, the older API will be deprecated.
- Add permission checks to all performanced APIs.
- Allow services with android.permission.RESTRICTED_VR_ACCESS to change
scheduler policy for VR apps.
- Minor updates to use the updated PDX service API. The older API will
be deprecated soon.
- Add tests for permission checks and policy API.
Most of the tests are automatic however, there is one manual step for
testing the android.permission.RESTRICTED_VR_ACCESS (e.g. trusted uid)
check. Because there is no reliable way to determine the UID of VrCore
from the gtest, instead the gtest looks for an env var named
GTEST_TRUSTED_UID; if this is set the value is used as a uid and the
trusted uid tests are enabled.
Bug:
62468109
Test: 'GTEST_TRUSTED_UID=<VrCore UID> performance_service_tests' passes.
Change-Id: I9047b298a015a69535b655a299ca26c179e2d57d
Corey Tabaka [Thu, 8 Jun 2017 21:29:58 +0000 (14:29 -0700)]
DVR API: Implement support for deleting surface attributes.
- Implement support for deleting surface attributes using the "NONE"
attribute type.
- Add tests for attribute events and attribute deletion.
Bug:
62456002
Test: dvr_api-test passes.
Change-Id: I66b6edbd35077596d89e85829bcbe7c52829ef5b
Karthik Ravi Shankar [Wed, 28 Jun 2017 22:40:24 +0000 (15:40 -0700)]
Add VrFlinger dumpsys to SurfaceFlinger
When we do dumpsys SurfaceFlinger, we get no information about the
layers/what is composed when the device is in VR mode.
Bug:
63113212
Test:
VrFlinger state:
Application Surfaces:
Surface 0: surface_id=11 process_id=5550 user_id=10104 visible=1
z_order=0 queue_ids=29,37
Surface 1: surface_id=13 process_id=5035 user_id=10130 visible=1
z_order=0 queue_ids=53,65
Direct Surfaces:
Surface 0: surface_id=8 process_id=5563 user_id=10104 visible=1
z_order=0 queue_ids=17
Display metrics: 1440x2880 537.882x537.882 dpi @ 60 Hz
Post thread resumed: 1
Active layers: 1
Layer 0: type=Device surface_id=8 buffer_id=19
Hardware Composer Debug Info:
-------------------------------
HWC2 display_id: 0
layer: 30 z: 0 compositon: Device/Device alpha: 255 format:
RGBA_8888_UBWC dataspace:0x00000000 transform: 0/0/0 buffer_id:
0x70b4877500
color modes supported: 0 7 9 current mode: 7
current transform:
1.08 -0.02 -0.02 0.00
-0.07 1.03 -0.07 0.00
-0.01 -0.01 1.09 0.00
0.00 0.00 0.00 1.00
-------------------------------
This section doesn't appear when the device is not in VR mode.
Change-Id: I2961a05fc3ea303e070be08de355fb6e56c3d0db
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
TreeHugger Robot [Wed, 28 Jun 2017 19:01:17 +0000 (19:01 +0000)]
Merge "Add telephony related dumpsys in the telephony monitor bugreports" into oc-dr1-dev
Corey Tabaka [Mon, 26 Jun 2017 23:51:43 +0000 (16:51 -0700)]
libpdx_uds: Fix uninitialized variable bug.
In this code path epoll_wait() returns 0 when the operation times
out, but there is no condition to catch this and return the
approptiate status. This allows the event value to be used
uninitialized, which returns a junk pending event mask.
This bug results in BufferHub queues sometimes thinking that the
producer side of the buffer hung up, when the junk value happens
to have the EPOLLHUP bit set.
Bug:
62886596
Test: Observe VR app switching stability.
Change-Id: Id9554d6bf224fd27815ff042ac145f59041d0aae
Jayachandran C [Sat, 10 Jun 2017 22:08:12 +0000 (15:08 -0700)]
Add telephony related dumpsys in the telephony monitor bugreports
Collect dumpsys for the following in telephony monitor auto
generated bugreports for better debugging
1) TelephonyDebugService
2) CarrierConfig
3) Connectivity
Test: Verified telephony monintor auto generated bugreport
Bug:
62504502
Change-Id: Ia2a9e1ff5b289dec7a4d0bb4e8ef85fb413df87a
Robert Carr [Wed, 28 Jun 2017 00:06:38 +0000 (00:06 +0000)]
Merge "SurfaceFlinger: Last minute log removal." into oc-dev
am:
56cca289cc
Change-Id: Ib4448b62b985fac82c24fb81aef550ba7d0280a9
TreeHugger Robot [Tue, 27 Jun 2017 23:59:16 +0000 (23:59 +0000)]
Merge "SurfaceFlinger: Last minute log removal." into oc-dev
Dan Stoza [Tue, 27 Jun 2017 23:01:03 +0000 (23:01 +0000)]
Merge "libgui: New mutex for ConsumerBase frame callbacks" into oc-dev
am:
fb672ba37b
Change-Id: I90f2ebe102c40c70620ca12bda5000b455109d26
TreeHugger Robot [Tue, 27 Jun 2017 22:54:05 +0000 (22:54 +0000)]
Merge "libgui: New mutex for ConsumerBase frame callbacks" into oc-dev
Robert Carr [Tue, 27 Jun 2017 20:51:07 +0000 (13:51 -0700)]
SurfaceFlinger: Last minute log removal.
Whoops.
Test: Log removed!
Change-Id: I4593352cf565603a4507c6ef13504b167d882eec
TreeHugger Robot [Tue, 27 Jun 2017 04:43:20 +0000 (04:43 +0000)]
Merge "Fix hidl_ssvc_poll thread issues" into oc-dr1-dev
Phil Weaver [Mon, 26 Jun 2017 23:22:26 +0000 (16:22 -0700)]
Trust navbar panel and accessibility overlays
Fixes:
62048165
Fixes:
62341768
Test: Enable maximum screen display and font size, enable TalkBack.
Enable Select to Speak with FAB, enable TalkBack.
Change-Id: Ia96373200adf9c5d306e9c61da9c65ba412c9430
Peng Xu [Sun, 25 Jun 2017 23:43:02 +0000 (16:43 -0700)]
Fix hidl_ssvc_poll thread issues
1) Patch poll wake up handling logic so that thread no longer quits
on spurious wake up.
2) Patch(simplify) thread initialization, so that it will not hang
on waiting for conditional variable.
Test: 1) send signal 3 to system_server, does not observe thread quit.
Test: 2) adb shell "stop;start" many times, every time thread starts.
Bug:
62933449
Bug:
62933799
Merged-In: Icb7477e9d75338b9742e144fc2687d5ced91e89e
Change-Id: Icb7477e9d75338b9742e144fc2687d5ced91e89e
Dan Stoza [Mon, 26 Jun 2017 21:27:18 +0000 (14:27 -0700)]
libgui: New mutex for ConsumerBase frame callbacks
Adds a new mutex to protect ConsumerBase's mFrameAvailableListener
separately from the main mMutex. This prevents deadlocks when trying
to perform callbacks in response to other calls that come through
ConsumerBase.
Bug:
62915791
Test: EncodeVirtualDisplayWithCompositionTest#
testRenderingMaxResolutionRemotely
Change-Id: I244dc2d83488e452d9690c0d7847c9ff15a95dbb
TreeHugger Robot [Mon, 26 Jun 2017 17:54:11 +0000 (17:54 +0000)]
Merge "libgui: export EGL headers." into oc-dr1-dev
TreeHugger Robot [Sat, 24 Jun 2017 00:04:43 +0000 (00:04 +0000)]
Merge "Revert "libui: Load a.h.graphics.mapper passthrough service on library load"" into oc-dr1-dev
Jeff Vander Stoep [Fri, 23 Jun 2017 18:41:04 +0000 (11:41 -0700)]
Revert "libui: Load a.h.graphics.mapper passthrough service on library load"
This reverts commit
75ca86f072f82d38b21e0a13234ecbc2c24cb6ab.
avc: denied { read } name="hw" scontext=u:r:cameraserver:s0
tcontext=u:object_r:system_file:s0 tclass=dir
avc: denied { read } name="hw" scontext=u:r:folio_daemon:s0
tcontext=u:object_r:system_file:s0 tclass=dir
avc: denied { read } name="hw" scontext=u:r:hal_imsrtp:s0
tcontext=u:object_r:system_file:s0 tclass=dir
avc: denied { read } name="hw" scontext=u:r:idmap:s0
tcontext=u:object_r:system_file:s0 tclass=dir
avc: denied { read } name="hw" scontext=u:r:mediaextractor:s0
tcontext=u:object_r:system_file:s0 tclass=dir
avc: denied { read } name="hw" scontext=u:r:mediametrics:s0
tcontext=u:object_r:system_file:s0 tclass=dir
avc: denied { read } name="hw" scontext=u:r:webview_zygote:s0
tcontext=u:object_r:system_file:s0 tclass=dir
Bug:
62353585
Bug:
62912747
Bug:
35197529
Test: build and boot device. Launch camera, take pictures.
Change-Id: Ic6884f7235edb9191034a285414eb93aa44ac23c
TreeHugger Robot [Fri, 23 Jun 2017 20:39:03 +0000 (20:39 +0000)]
Merge "Make VR HWC DPI a configurable property" into oc-dr1-dev
John Reck [Fri, 23 Jun 2017 19:00:44 +0000 (19:00 +0000)]
Disable setting saved_cmdline_size
am:
ba54d5baf4
Change-Id: I447ad42ad4c245013e488701a61d8ce2348a368d
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