52ea25cf06cef250ec73052611b48556b3fce4d5 |
|
14-Sep-2017 |
Corey Tabaka <eieio@google.com> |
Add shared memory based buffer metadata 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
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
638b7f747df50374d1e91c2496da41f293394e19 |
|
08-Sep-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
Overhual DvrBuffer and DvrBufferQueue API: Step 1 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
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
005f45d7bb059c0ef8d69f1cac81bca4f70852af |
|
05-Aug-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
BufferHubQueueProducer reset buffers on disconnect When Surface.cpp disconnects a IGraphicBufferProducer, it clears up all the buffer cache it holds. Thus our implementation should do the same. New tests: 1/ BufferHubQueueProducerTest.ConnectDisconnectReconnect: tests IGraphicBufferProducer to behave proper after disconnect and re-connect. 2/ BufferHubQueueTest.TestFreeAllBuffers: tests BufferHubQueue handles FreeAllBuffers() properly under different producer/consumer state. Bug: 64402829 Test: Pause and resume GVR video player demo and observer no more fails around IGraphicBufferProducer::requestBuffer and Surface::dequeueBuffer. Change-Id: Ia61e3f991248135cecf22039045f6960226bda42
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
8fa4e107ab6cbc24c0e54d44db3341f006fe939a |
|
25-May-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
buffer_hub_queue_client: Batch allocate buffers Bug: 36147743 Test: buffer_hub_queue-test, buffer_hub_queue_producer-test, dvr_api-test Change-Id: I40a9babfa8d28d4496e27a7ccecb7ae1b9bc7bd5
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
0b80155bf5c27b47c160d1904ad442842dc8f0c5 |
|
24-May-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
DvrBufferQueue: Add basic event callbacks Currently, there is no guarantee of thread safty and on which thread those callbacks are going to be fired. Three new DVR APIs introduced: 1/ dvrReadBufferQueueSetBufferAvailableCallback 2/ dvrReadBufferQueueSetBufferRemovedCallback 3/ dvrReadBufferQueueHandleEvents Bug: 36748012 Test: buffer_hub_queue-test, dvr_api-test Change-Id: I79900c9d205f1808b02400b379c79adb366a1104
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
bb701dbac7c9c9eb2a7d0ec48c5e020f1272de13 |
|
23-May-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
BufferHubQueue rename DetachBuffer to RemoveBuffer Test: buffer_hub_queue_producer-test, buffer_hub_queue-test, dvr_api-test Bug: 37164481 Change-Id: I05ba0f9f96cf60b64cb8b76482301440d40aa82a
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
6bffc67cec8bd8ad086d5a6265dedb737073bdea |
|
19-May-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
Add more attribute when creating ProducerQueue Add `is_async`, `default_width`, `default_height` and `default_format`. Note that these attributes are currently treated as immutable after queue gets created. Bug: 38324405 Bug: 38430974 Bug: 36724099 Test: buffer_hub_queue_producer-test, buffer_hub_queue-test, dvr_api-test Change-Id: Id242a15388a1f1457ad89d11336f5643685e8361
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
cbd32bfd3a8dbac30228acbaee1daaf2466d643f |
|
19-May-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
Simplify ProducerQueue::Create This is a preparation CL that simplifies ProducerQueue's constructor, Create(), and bufferhub_rpc::CreateProducerQueue prior to introducing more queue attributes (is_async, width, height, max_capacity, etc) on creation. 1/ Consolidate and/or remove unnecessary ProducerQueue::Create's overloading (we had way too many overloads of the create function and I figured it's awfully painful to introduce new attributes). 2/ Use UsagePolicy in ProducerQueue::Create. Also added default values for UsagePolicy, so that empty uniform initialization gives us a default policy. This helps us removing all ProducerQueue::Create overloading on whether default usage policy is needed. 3/ Move |meta_size_bytes| into ProducerQueueConfig. Bug: 38430974 Test: buffer_hub_queue_producer-test, buffer_hub_queue-test, dvr_api-test Change-Id: Ieba9f4d1bce2162bd1e6063989985afc8d014dc7
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
b7ca5dee2045d9426e68f863b244012a2b223ea8 |
|
09-May-2017 |
Corey Tabaka <eieio@google.com> |
Clean up BufferHubQueue API and internal bookkeeping. - Simplify buffer hangup accounting. - Add extra checks to gracefully handle the epoll set and slots array being out of sync. - Add tests for detaching buffers. - Switch to using Status<T> for all return/error values. - Fix minor bug in BufferHubQueueProducer from earlier Status<T> return value change. Bug: 36401174 Test: buffer_hub_queue-test passes. Change-Id: If7f86a45cc048dc77daa2ede56585d3f882dd24f
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
108e84f7e6a9117b66dba000dcf16c6d8c862e16 |
|
08-May-2017 |
Hendrik Wagenaar <hendrikw@google.com> |
dvrapi: Pass layer_count down * We were missing layer count, which would prevent multiview from working Bug: 37245304 Test: MultiLayerBufferQueue Change-Id: I88b41f1aa7665df01e89a7386cbc23b15c9a79b0
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
4d3590f3fd0fd65f4e8758d3228de9f55cf135d0 |
|
07-May-2017 |
Hendrik Wagenaar <hendrikw@google.com> |
Remove slices from buffers * code no longer required, as it will be handled in vrcore Bug: 38076195 Test: Manually ran testing Change-Id: Id28918a3bf73b99cbb57aad4c21251b7a9623074
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
2251d822dac2a96aad4184a6fdc2690f0a58af7c |
|
21-Apr-2017 |
Corey Tabaka <eieio@google.com> |
Remove the VR compositor from the framework. Remove the VR compositor framework and enable out-of-process VR composition in VrCore. This CL seems large due to the ripple effect of changing the VrFlinger API and protocol types. There are three major modules that require concurrent changes: 1. Protocol definitions and low-level VrFlinger API in libdisplay. * Additional changes needed to keep old interfaces working for a short time while replacing the dependent code (dvrGraphics*). 2. VrFlinger service implementation changes to support VrCore compositor and the removal of the internal compositor. 3. Changes to libdvr platform library API due to changes in #1 and #2. Because of the nature of the interdependence of types and other defs it is difficult to break this CL into smaller chunks. However, review of the three major modules (libdisplay, libdvr, and libvrflinger) may be done separately to ease the mental burden on reviewers. Change Summary: - Remove obsolete screenshot service. VR screenshots will be implemented by VrCore. - Update display protocol definitions for changes in VrFlinger service requirements. The majority of the changes in libdisplay are a consequence of these protocol and service changes. - Update VrFlinger to support two kinds of surfaces: 1. Application - use by VR apps. 2. Direct - used by VrCore (protected by permission check). - Remove VrFlinger internal compositor and GL context. - Remove obsolete debug console. - Update VrFlinger hardware composer interface to handle direct surfaces only, removing the concept of GPU (compositor) layers. - Update display manager to expose access to application surface info to VrCore (protected by permission check). - Update libdvr platform library interfaces for changes to VrFlinger API / protocol. - Clean up libdvr API struct setup using a common include. - Add C++ header-only helpers for DVR platform library opaque types. Bug: 36401174 Test: Build; run VrFlinger display test tool. Change-Id: I15abfde5f72dbb3725a3f58621486afba6b64902
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
2b99ee560ba14b617ebb4c1997e8b8004f2de22f |
|
04-May-2017 |
Corey Tabaka <eieio@google.com> |
Support multiple consumer queues. - Add support for importing posted buffers when spawing a new consumer queue. - Correctly handle adding signaled buffers to epoll with edge triggered mode set. - Add test for multi-consumer behavior. Bug: 36401174 Test: buffer_hub_queue-test passes. Change-Id: Id09f01502a1b18bf80a0ae465c2941b548cde2e4
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
9d8bd09569322f452fddf91e581904f1e8f6849c |
|
26-Apr-2017 |
Corey Tabaka <eieio@google.com> |
Return pdx::Status<T> from BufferHubQueue::Dequeue. Switch to using Status<T> to return buffers or meaningful errors from BufferHubQueue::Dequeue. This enables determining whether an error is normal (e.g. timeout) or abnormal (e.g. disconnect). Bug: 36401174 Test: buffer_hub_queue-test passes. Change-Id: Ifef5f737a5e737b70d19bdbffd7544a993438e1c
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
8a4e6a90e6b7edf73fa0d79dd5b439f8e52eb9f0 |
|
20-Apr-2017 |
Corey Tabaka <eieio@google.com> |
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
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
0057fddc71d1c3c3de8f9d0bd45a51bb293bfa3c |
|
02-May-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
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
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
cb4751c52a5625a22b6a11b4de537ff026d9bfe3 |
|
15-Apr-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
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
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
cd52dd9f1b301854b4e1734e3741d9cef8f784b1 |
|
08-Apr-2017 |
Corey Tabaka <eieio@google.com> |
Update BufferHub service/client with support for gralloc1 usage. - Add support for gralloc1 usage flags. - Mimic how GraphicBuffer supports gralloc0 usage flags: (usage, usage). - Move to using pdx::Status<T> since we're touching signatures everywhere. Bug: 36401174 Test: bufferhub_tests; buffer_hub_queue-test Change-Id: I0e5184197b21eda9806bbea44f63b546b030692a
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
5bbb45e038b42dba3550738ad6445527776e0861 |
|
07-Apr-2017 |
TreeHugger Robot <treehugger-gerrit@google.com> |
Merge changes from topic 'vrflinger-prep' into oc-dev * changes: libpdx: Decay variant types to correctly handle cv-reference types. libpdx: Fix forward declarations using default template args. Add additional accessors to IonBuffer and BufferHubBuffer. Update BufferHubQueue in preparation for VrFlinger refactor.
|
1db8a5d7e3b0565b976e77859e28d77f6a451a2b |
|
22-Mar-2017 |
Corey Tabaka <eieio@google.com> |
Update BufferHubQueue in preparation for VrFlinger refactor. - Expose buffer hub queue id to the client. This helpful as an id in queue enumeration in the DisplayManager API. - Address log convention deviations. - Clean up BufferHub service error paths. - Clean up queue importing logic to query the service for queue parameters to avoid accidental abuse. - Make spawning consumer queues more efficient in RPC only cases. - Clean up ConsumerQueue constructor logic; move to pdx::Client base class (through BufferHubQueue) instead of pdx::ClientBase. ConsumerQueue::Create doesn't make sense as a ConsumerQueue can only be created from another queue. Bug: 36401174 Test: build; run buffer_hub_queue-test Change-Id: I0530f64ecb514d0f37bb13f9ce201b6ff51502b6
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
960bcfffefa76d535c5aecd303d755be3fbc59f1 |
|
05-Apr-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
dvr_api GetExternalSurface returns ANativeWindow Now that we have a public NDK API to convert an ANativeWindow to a Java Surface, we no longer need to mess with Jni and libandroid_runtime in libdvr. See more information at: http://ag/#/q/topic:ANativeWindow_toSurface+(status:open+OR+status:merged) Also, as a side effect, we are now free to convert this library to use Android.bp (though we probably want to hold off for a while). Bug: 36266201 Test: Built and ran dvr_buffer_queue-test Change-Id: Ia0f6a8735c7d508195c30e3c7d040791e13a6ce3
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
1601bcfa9cdc07cea8f5980349608e1526690db5 |
|
24-Mar-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
Harden BufferHubQueueProducerTest This is a test that covers our implementation of bufferhubqueue-based IGraphicBufferProducer, which eventually enables VrCore/VrFlinger to access buffers produced from other Android compontents. Note that the gtest itself is a (slightly) modified version of IGraphicBufferProducer_test.cpp. This also improves BufferHubQueue in the following way to support more features of android::BufferQueue. 1/ Supports more buffer queue parameters that we query. 2/ BufferHubQueue (the PDX client) now supports default width, height, and format configuration. 3/ Change default max_dequeue_buffer_count to 1 (which is the same behavior current android::BufferQueue adopts). 4/ Fill in |QueueBufferOutput| during |enqueueBuffer|. Bug: 34197998 Bug: 36266201 Test: build and run buffer_hub_queue_producer-test Change-Id: I9d3e8bb66dbfb66e67ab7b0e5093e49a3f374e9c
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
2d82ceb8dc1bc9066bd5ad98ee0926289cb0b7cc |
|
23-Mar-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
Add dvr_buffer_queue C API Bug: 36401767 Bug: 32213274 Bug: 36266201 Test: build and ran dvr_buffer_queue-test Change-Id: Icd8d063bd8b7adb15bf67f7e543b87dad1c32a68
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
ed6543224138fd753eeea909918bb8d1d2efb1e6 |
|
14-Mar-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
Expose acquire_fence though ConsumerQueue::Dequeue The current compositor implementation will be refactored to use BufferHubQueue instead of ad-hoc BufferHub operations. We need this to expose release_fence to compositor so that it can wait for buffers to become avaiable by checking fence properly. Bug: 36033302 Bug: 36148608 Test: Built and ran buffer_hub_queue-test Change-Id: I75cfcb02e06a4b9e7e89b89690ca2d92ee09a678
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
dc14e5bf86b6999a290b64deb44418a8f205296c |
|
25-Jan-2017 |
Jiwen 'Steve' Cai <jwcai@google.com> |
BufferHubQueue: ClearAvailable on consumer import This fixes the issue that ConsumerQueue keeps receiving |OnBufferAllocated| events when using UDS based libpdx. It also hardens error handling during consumer imports. Bug: 34690159 Test: Build, flash, buffer_hub_queue-test pases Change-Id: I4f739a2869df851ed836f39122b3eba95697f3f6
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|
e4eec20f6263f4a42ae462456f60ea6c4518bb0a |
|
27-Jan-2017 |
Alex Vakulenko <avakulenko@google.com> |
Add DaydreamVR native libraries and services Upstreaming the main VR system components from master-dreamos-dev into goog/master. Bug: None Test: `m -j32` succeeds. Sailfish boots and basic_vr sample app works Change-Id: I853015872afc443aecee10411ef2d6b79184d051
/frameworks/native/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
|