summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-10-11Add missing transitive dependency to pdx_tool.oreo-mr1-devCorey Tabaka
Bug: 65455724 Test: make -j30 Change-Id: I03a22e10d92ea53bb2e1631e4203a186e42fa265
2017-10-11Revert "Revert PDX tracing."Corey Tabaka
This reverts commit 05cd77c494aa7042fca7978e1b934855598b765e. Bug: 65455724 Test: make -j30 Change-Id: Id531101cc35b661f02291eed0c044e96f5a91a12
2017-10-11Add missing transitive dependency to atrace.Corey Tabaka
This is the proper fix for the revert in ag/3048738. Bug: 65455724 Test: lunch full-eng && make -j30 Change-Id: I88d37fca2d1f71a46595dd74b5fd6749fa4b477d
2017-10-11Revert PDX tracing.Michael Wright
This broke full-eng / docs / m_e_arm-eng builds. Test: lunch full-eng && m-j8 Change-Id: I79b0176738e4de35cca25e9618e64aa2bd4c4316
2017-10-10Add shared memory based buffer metadataCorey Tabaka
This CLs reduces BufferHub CPU consumption by adding asynchronous state transition so that out-of-process VR composition can run on 2016 pixel devices smoothly. In addition, this CL addresses a couple corner cases in the existing bufferhub logic, which fixes various blackscreen issues. 1/ Tracks buffer transition states (gained, posted, acquired, released) from the client side via atomic shared memory and adds PostAsync/AcquireAsync/ReleaseAsync/GainAsync with metadata and fence support. 2/ Adds dequeue order guarantee for buffers enqueued with dvrWriteBufferQueuePostBuffer. 3/ Synchronous BuffeHub operations are still supported. 4/ Bump up the bufferhubd's soft limit of open file descriptor. 5/ Handle orphaned consumer in acquired state. This is a corner case that consumer process goes aways (most likely due to a crash) leaving buffer stuck in acquired state with inconsistent buffer state. 6/ Fixes a race condition for released buffer to be Gain'ed and Acquire'd when a new consumer is created in released state. 7/ Improve silent consumer queue efficiency: Silent queues no longer import buffers or receive signals about new buffers and they are limited to only spawning other consumers and notifications about producers hanging up. 8/ Modify PDX/UDS channel event signaling to work around epoll behavior. PDX UDS uses a combination of an eventfd and an epoll set to simulate the original PDX transport channel events. An odd behavior discovered in the kernel implementation of epoll was found that causes the epoll fd to "unsignal" itself whenever epoll_wait() is called on it, regardless of whether it should still be pending. This breaks the edge triggerd behavior in nested epoll sets that channel events depend on. Since this is unlikely to ever be fixed in the kernel we work around the behavior by using the epoll set only as a logical OR of two eventfds and never calling epoll_wait() on it. When polling is required we use regluar poll() with the eventfds and data fd to avoid the bad behavior in epoll_wait(). 9/ Keep reading data after PDX hangup signal. UDS will signal hangup when the other end of the socket closes. However, data could still be in the kerenl buffer and should be consumed. Fix an issue where the service misses an impulse sent right before the socket is closed. Bug: 65455724 Bug: 65458354 Bug: 65458312 Bug: 64027135 Bug: 67424527 Test: libpdx_uds_tests bufferhub_tests buffer_hub_queue-test buffer_hub_queue_producer-test dvr_api-test Change-Id: Id07db1f206ccf4e06f7ee3c671193334408971ca
2017-10-03Solve the composer service NULL pointer crashRandy Xu
The callback functions are set nullptr in ComposerClient::~ComposerClient() ./composer/2.1/default/ComposerClient.cpp:160: mHal.enableCallback(false) However, the callbacks are still used in hwc2on1adaptor, it will cause segment fault. Bug: 64650599 Test: adb shell stop Change-Id: I92e6a6b42418e987a7ead041f2d95c194b6a16e8 Signed-off-by: Randy Xu <randy.xu@intel.com> Signed-off-by: Qiming Shi <qiming.shi@intel.com> Signed-off-by: Yong Yao <yong.yao@intel.com> Signed-off-by: Gaurav Sarode <sgaurav@google.com>
2017-10-02Merge "Limit Display-P3 surface formats to 8888" into oc-mr1-devCourtney Goeltzenleuchter
2017-09-30Merge "Fix deadlock when transitioning to vr flinger" into oc-mr1-devSteven Thomas
2017-09-29Merge "Use the HWC caching mechanism to avoid stalls in the ion driver." ↵TreeHugger Robot
into oc-mr1-dev
2017-09-29Fix deadlock when transitioning to vr flingerSteven Thomas
If we were unlucky with the timing when switching to vr flinger we would sometimes deadlock. The vr dispatch thread would request the display from surface flinger, locking mStateLock in the process. mStateLock was being held by the surface flinger main thread, which was processing a previous request to switch to vr flinger. The main thread was trying to connect to the vr hardware composer service, which sent a request to the vr dispatch thread as part of its initialization, leading to the deadlock. The deadlock is easily fixed by posting a message to request the vr flinger switch to the surface flinger main thread, instead of doing it on the vr dispatch thread. Bug: 66916578 Test: Confirmed I can still get into/out of vr flinger on Marlin. There's no longer code to acquire mStateLock in the vr dispatch thread, so the deadlock is no longer possible. Change-Id: I3de5476f698ed798f6b9afe927cc733f0f38c56e
2017-09-28Use the HWC caching mechanism to avoid stalls in the ion driver.Corey Tabaka
HWC supports caching buffers for layers using "slot" assignments. Use this in VrFlinger to avoid importing a buffer handle every frame. The avoids periodic stalls we observe in the ion driver when mapping a buffer into the HWC address space. Bug: 66459419 Test: Observe systraces no longer have MapBuffer in HWC in steady state; system does not drop frames. Change-Id: Iba4161b33561322bfbccbfafe600b432a6fa7c44
2017-09-28Limit Display-P3 surface formats to 8888Courtney Goeltzenleuchter
Discovered that FP16 and 1010102 may not be supported for Swapchain. Since we don't have a query mechanism defined, limit P3 to 8888 which must be supported. Bug: 66706404 Test: adb -d shell am start -n com.drawelements.deqp/android.app.NativeActivity \ -e cmdLine '"deqp --deqp-case=dEQP-VK.wsi.android.colorspace \ --deqp-log-filename=/sdcard/dEQP-Log.qpa"' Change-Id: If537c631cd40610f6a62c437f8a7aff70f742fff
2017-09-26Support picture_in_picture only if device is not low ramNg Zhi An
Can verify using this command: adb shell dumpsys package | grep picture_in_picture Bug: 65602088 Test: manual Change-Id: I0e91cb63ce9d4b3ae059afc91d76a36ffc6a0a53
2017-09-21Merge "libhwc2on1adapter: avoid marking changes if visible regions ↵TreeHugger Robot
unchanged" into oc-mr1-dev
2017-09-20Merge "Deal with unreliable VSYNC signals due to scheduler." into oc-mr1-devTreeHugger Robot
2017-09-20libhwc2on1adapter: avoid marking changes if visible regions unchangedAdrian Salido
The function setVisibleRegions is always called as part of composition, shouldn't mark geometry changed if there are no changes in the visible regions. Bug: 65019874 Test: run cts -m CtsViewTestCases -t android.view.cts.DisplayRefreshRateTest#testRefreshRate Change-Id: I3f93431002fc4b691c799f4ae91aa1488849e4a6
2017-09-20Merge "packagemanager_native access to package installer, version" into ↵Ray Essick
oc-mr1-dev
2017-09-19Add TYPE_INPUT_CONSUMER to the trusted overlay list.Michael Wright
Without this, PIP will break a bunch of apps since its frame fills the whole screen, even though the application is restricted to its stackbounds (which are the size of the touch region, not the frame region). Bug: 65606046 Test: None Change-Id: Id7035dace30db37c5a58c66339d0749550a362e5
2017-09-19packagemanager_native access to package installer, versionRay Essick
add getInstallerForPackage() and getVersionCodeForPackage() to support native media.metrics needs. Bug: 65027506 Test: watch logs for various package combinations Change-Id: I6f3c551e8f547ab4151ef2400db4e100a6f53abf
2017-09-18Deal with unreliable VSYNC signals due to scheduler.Corey Tabaka
We see two sources of scheduler jank when waiting for VSYNC: - A kernfs issue that wakes up threads using a normal priority work queue that may be delayed or have other work on it. - The VSYNC callback from HWC is handled by a normal priority HwBinder thread that may be delayed by other work. Change the VrFlinger frame post thread to use an absolute timer- based dead reckoning loop. VSYNC timestamps from the display driver are reliable, even if the delivery of the value takes time. Predict the VSYNC time into the future based on the last known VSYNC time. If we see that VSYNC has not been signaled by the time we need to post a frame to HWC we assume that the driver and/or HWC was delayed so much that the previous frame is still pending and skip the upcoming frame to avoid double stuffing the driver. Bug: 65064949 Test: Extensive system tests and systraces. See bug for details. Change-Id: Iae6c4173b8eac1d179adc3fc8004d3d475b3f156
2017-09-14Merge "Revert "Add runpath to lshal_test"" into oc-mr1-devTreeHugger Robot
2017-09-14Revert "Add runpath to lshal_test"Steven Moreland
This reverts commit 864c07077b0283ecf9bd36a0381951a19ec8c3df. No special behavior for tests. Reason for revert: b/65603915 Bug: 64776708 Change-Id: Ib64d4f6ef5ea59afa1d3c408c792685a3d025c0a
2017-09-13Merge "Add runpath to lshal_test" into oc-mr1-devYifan Hong
2017-09-13Merge "Reduce the number of Send requests over UDS per IPC invocation" into ↵TreeHugger Robot
oc-mr1-dev
2017-09-13Merge "Adjust the validation code for secondary dex paths" into oc-mr1-devCalin Juravle
2017-09-13Reduce the number of Send requests over UDS per IPC invocationAlex Vakulenko
We sent up to 3 separate send requests over a socket. Now combine then into one sendmgs() to improve performance and thread scheduling. This improves PDX/UDS performance by up to 2x in some cases. Bug: 65379030 Test: Sailfish works normally. Was able to run VR apps. Change-Id: I00734d2c3f06d7d42b089569a8cc11c2273a1b7f
2017-09-13Adjust the validation code for secondary dex pathsCalin Juravle
Do not validate the package path when reconciling secondary dex files. If the file does not exist we cannot resolve the system sym links (e.g. /data/user/0 -> /data/data) and the validation will fail leaving oat files behind. Bug: 64460009 Test: adb shell cmd package reconcile-secondary-dex-files com.google.android.googlequicksearchbox (after removing some files) adb shell cmd package compile -m speed --secondary-dex com.google.android.googlequicksearchbox adb shell /data/nativetest64/installd_utils_test/installd_utils_test Change-Id: I9734ad18a579d44088180326661d8cf8288e90be
2017-09-13Add runpath to lshal_testJiyong Park
android.hardware.test.baz@1.0.so is installed to /data/nativetest(64), and no longer to /system/lib(64) or /system/lib(64)/vndk, because the interface library is only for testing. Set runpath so that lshal_test can find the interface library in the non-standard directory. Bug: 65603915 Test: m -j lshal_test adb push out/target/product/<name>/data/nativetest* /data adb shell /data/nativetest/lshal_test/lshal_test Change-Id: I854b08acb6442990ed369bfbc517ad1a93c94584
2017-09-13Merge "Overhual DvrBuffer and DvrBufferQueue API: Step 1" into oc-mr1-devTreeHugger Robot
2017-09-12Merge "Keep standalone devices in VrFlinger mode." into oc-mr1-devTreeHugger Robot
2017-09-12Overhual DvrBuffer and DvrBufferQueue API: Step 1Jiwen 'Steve' Cai
Adding new APIs: dvrWriteBufferQueueGainBuffer dvrWriteBufferQueuePostBuffer dvrReadBufferQueueAcquireBuffer dvrReadBufferQueueReleaseBuffer Those new APIs streamlines DVR buffer operations: 1/ It allows static Dvr{Read,Write}Buffer objects to be statically allocated with the queue. 2/ Symentric Gain/Post on WriteBufferQueue and Acquire/Release on ReadBufferQueue. 3/ Use fixed buffer metadata. 4/ This is also a prerequisite to using shared memory based metadata and async buffer IPC. More details and discussion at: go/gvr-async-bufferhub Special note regarding DVR API order in this CL: The new buffer queue API entries are inserted before new PoseClient API as the PoseClient is still blocked from being released and the new BufferQueue APIs are expected to be released sooner than that. Bug: 65455724 Bug: 65468551 Bug: 65458332 Bug: 65165821 Test: dvr_api-test Change-Id: Iae8e7787d696d72ebf7457df9f98f4467cd20932
2017-09-11Keep standalone devices in VrFlinger mode.Corey Tabaka
Avoid unnecessary tear-down and bring up of HWC client in standalone devices. This saves time during screen-on because standalone devices only use VrFlinger mode. Remove dead code that used to check the panel driver for missed frames. No drivers expose the sysfs node that provided this function anymore. Test: Manual testing. Observe stable DON/DOFF behavior. Bug: 65248224 Change-Id: Id9ebb76982621848d97792496a09b6da8c4e5928
2017-09-08Merge "Fix stack use-after-scope in InputReader" into oc-mr1-devTreeHugger Robot
2017-09-08Merge "surfaceflinger: handle executeCommands transaction errors" into ↵Chia-I Wu
oc-mr1-dev
2017-09-08surfaceflinger: handle executeCommands transaction errorsChia-I Wu
Unlike other functions, executeCommands both sends and receives handles. It can fail for reasons such as out-of-fd. We want to protect SurfaceFlinger against out-of-fd. Bug: 65449888 Test: manual Change-Id: Id9420dbd6d0a943737c90bd3a1ae0df3805a4cb0
2017-09-08Set the layer composition type in HWCPat Plunkett
Setting up the VR hardware composer was causing a call to setLayerCompositionType with an invalid composition type. This removes the call, since setting the layer composition type is already handled in Layer::Prepare(). Bug: 63633934 Test: Start VR mode, check that the logcat errors are no longer present. Change-Id: I94f9a253bce9c5c25be7927d0003adbb9409ab36
2017-09-08Merge "Set enum to fixed size type" into oc-mr1-devTreeHugger Robot
2017-09-07Set enum to fixed size typeMarie White
Bug: 63683612 Test: Manual. Ran O2 on Marlin, tested image streaming manually. Since DvrPoseRawDataType enum will be part of the public DVR API, explicitly define the size of the enum. Change-Id: I3900470ccb3ca7a2c4e7ed8e7f5586c60486d9e6
2017-09-08Merge "Clean up handling of VR surface updates." into oc-mr1-devCorey Tabaka
2017-09-07Merge "Add a new keycode for TV (ALL_APPS)" into oc-dev am: 6afce442eaSujith Ramakrishnan
am: 047fcbf671 Change-Id: I17bac0d425207b1edc0ffbe997953502aae324e0
2017-09-07Merge "Add a new keycode for TV (ALL_APPS)" into oc-devSujith Ramakrishnan
am: 6afce442ea Change-Id: I7933009ee4c64025245373ee6b5ad1b0d77291e9
2017-09-07Merge "Add a new keycode for TV (ALL_APPS)" into oc-devSujith Ramakrishnan
2017-09-06Fix race conditions when using mHwc off the main threadSteven Thomas
In a few cases we were accessing mHwc off the main thread without acquiring mStateLock, resulting in crashes and other incorrect behavior. This CL adds the missing locks. Since the locking semantics are somewhat hard to understand, also add a clarifying comment to the mHwc member declaration in SurfaceFlinger.h. Bug: 64586546 Test: I manually tested normal surface flinger operation and vr behavior on different devices, and confirmed everything looks fine. The crashes we saw that were caused by these mHwc race conditions are hard to reproduce, so I couldn't empirically verify this fixes the crash. I'm relying on manual code inspection to confirm the issue is in fact fixed. Regarding performance, I added profiling code (not part of this CL) to check for lock contention and hold times with the newly added locks. I confirmed that contention is low, so these calls shouldn't be significantly slower as a result of adding the locks. The time spent holding these new locks is also low, except for getDisplayColorModes(), which makes a call to hardware composer service and can in some cases take over a millisecond. That function is called so rarely though, only once at boot, or twice at boot after a fresh flash, that it's not worth optimizing. Change-Id: I3854779c12a61983aaaecddb9f6316f218e519e3
2017-09-06Merge "Remove unbundled IME feature from automotive confg" into oc-mr1-devTreeHugger Robot
2017-09-05Fix stack use-after-scope in InputReaderMichael Spang
READ of size 4 at 0x0079b1ac3a20 thread T121 (InputReader) Viewport [1] to add: virtual:android:277f1a09-b88d-4d1e-8716-796f114d080b #0 0x79b8820d53 in android::InputReaderConfiguration::getDisplayViewport(android::ViewportType, android::String8 const*, android::DisplayViewport*) const frameworks/native/services/inputflinger/InputReader.cpp:246:39 #1 0x79b8843fab in android::TouchInputMapper::configureSurface(long, bool*) frameworks/native/services/inputflinger/InputReader.cpp:3472:22 #2 0x79b88411b3 in android::TouchInputMapper::configure(long, android::InputReaderConfiguration const*, unsigned int) frameworks/native/services/inputflinger/InputReader.cpp:3248:9 #3 0x79b8825ff3 in android::InputDevice::configure(long, android::InputReaderConfiguration const*, unsigned int) frameworks/native/services/inputflinger/InputReader.cpp:1126:21 #4 0x79b8822653 in android::InputReader::refreshConfigurationLocked(unsigned int) frameworks/native/services/inputflinger/InputReader.cpp:612:25 #5 0x79b88239fb in android::InputReader::loopOnce() frameworks/native/services/inputflinger/InputReader.cpp:343:13 #6 0x79b882d507 in android::InputReaderThread::threadLoop() frameworks/native/services/inputflinger/InputReader.cpp:1004:14 #7 0x79d79e6113 in android::Thread::_threadLoop(void*) system/core/libutils/Threads.cpp:747:28 #8 0x79da914bbb in android::AndroidRuntime::javaThreadShell(void*) frameworks/base/core/jni/AndroidRuntime.cpp:1199:14 #9 0x79da20f31b in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:214:18 #10 0x79da1c6dff in __start_thread bionic/libc/bionic/clone.cpp:47:16 Bug: 65378805 Test: asan build Change-Id: I5a65cb007fe4879ce9635572014a568583a2ef4a
2017-09-05Merge "Add api's to dvr_pose to retrieve data from sensord" into oc-mr1-devTreeHugger Robot
2017-09-03Merge "Fixed dumpstate_test_fixture so it runs on 64 bits as well." into ↵TreeHugger Robot
oc-mr1-dev
2017-09-03Merge "Drop capabilities in reconcileSecondaryDexFiles" into oc-mr1-devShubham Ajmera
2017-09-01Add api's to dvr_pose to retrieve data from sensordMarie White
Bug: 63683612 Test: Manually tested through VrCore cl/164799996. To retrieve raw data from Tango, added below api's to dvr_api: - dvrPoseClientGetDataReader - dvrPoseClientDataCapture - dvrPoseClientDataReaderDestroy Note: These changes have already been reviewed in branch oc-dr1-daydream-dev branch. See change 2729572. Changes tested on Pixel XL with and without 02 rendering path. Daydream Home rendering in VR Mode correctly. Pixel functioning as normal. Change-Id: Ia934d6a1a0b89edfd4408dde19d38e757d44f785
2017-09-02Merge "Temporary fix for memory leak on DumpRunningServiceTimeout." into ↵TreeHugger Robot
oc-mr1-dev