History log of /frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b53da4fdf32337382175800ce89ca9ad0962a6e4 13-Apr-2018 Jiwen 'Steve' Cai <jwcai@google.com> dvr_read_buffer_queue: don't stop releasing buffer

We used to abort ReleaseBuffer logic if we cannot verify that the buffer
being released is in the target queue. However, in certain edge case,
this could be true and we still want to release the buffer. One example
is when a ProducerQueue closes and triggers its ConsumerQueue to remove
all its buffers. In this case, ConsumerQueue::ReleaseBuffer() should
still function properly.

Bug: 77982072
Test: dvr_buffer_queue-test
Change-Id: I6d8e2525470c8e3d78862d3f0753c8735d528b53
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
639d479b8a432771f7fa5ae4b93f677d2c8eb125 06-Apr-2018 Jiwen 'Steve' Cai <jwcai@google.com> BufferHubProducer: don't check user_metadata_size

Now we are using canonical metadata for all BufferHubQueue, it's
actually wrong to enforce user_metadata_size.

Bug: 75962234
Bug: 77655695
Test: buffer_hub_queue-test, buffer_hub_queue_producer-test,
SurfaceParcelable_test, dvr_buffer_queue-test, libgui_test
Change-Id: I6736ed277f7ac08d1f4a7288ce4a101bc89ca35b
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
9b44532d648d88732c6f17820cf6418c025aecae 22-Feb-2018 TianyuJiang <tianyuj@google.com> Create DvrApiTest to load libdvr.so at runtime and get Dvr API.

Bug: 69267804
Test: mma, manually push and run dvr_display-test and
dvr_buffer_queue-test in a rooted 8.1.0 phone
Visually check the screen display red color.

Change-Id: I00934d18e4c9fa8edef0a421c03124a65c98e260
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
ca93bab82bfcae8f919b8aafc09fe5e4fa616f1e 08-Feb-2018 Jiwen 'Steve' Cai <jwcai@google.com> Move dvr_buffer_queue-test to use Android.mk

It seems that Android.bp is having trouble building against NDK. Other
minor changes include:

1/ Removes the test's dependency on libbase.
2/ Uses libandroid for ANativeWindow symbols instead of using
libnativewindow.
3/ Set RTLD_NODELETE during dlopen, so that the test binary won't crash
on pre-Android P devices.

Bug: 64723700
Test: dvr_buffer_queue-test binary built on master runs on devices with
Android 8.0.0, 8.1.0, and master branch.
Change-Id: Id7a7e242ba3d35c352fa049ab1c5c50a77ede682
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
869c6d0e652fab846db377632f6f429290faf400 08-Feb-2018 TianyuJiang <tianyuj@google.com> Move log tag definition from Android.bp to cpp file.

Test: mma in tests directory
Bug: None

Change-Id: I72ced837614e84b80f111b41712a7f10b49dff3a
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
274d6182b0220e10a1e48e51159f4e20b24f8770 02-Feb-2018 TianyuJiang <tianyuj@google.com> Remove the dependency of libdvr_static and libbase from buffer queue tests

so that tests will run against the libdvr.so on device.
Note: Device must have Android 8.1.0 or above to pass the test.
Otherwise, tests fail upon setup.

Bug: None
Test: manually push the binaries to device and run them with shell
commands adb shell /data/dvr_buffer_queue-test
Tested on unlocked Pixel 2 XL and unlocked Pixel, all tests pass.

Change-Id: Ic02f2451a7e20e37b0adcf89eb6c738330649237
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
5b5d4e11949ae5fbd370927e721480f91c079857 30-Aug-2017 Jiwen 'Steve' Cai <jwcai@google.com> Rename WriteBufferQueueGetExternalSurface: Step 1

Add new API WriteBufferQueueGetANativeWindow and forward all calls to
the old one with a warning.

Bug: 65133502
Test: dvr_api-test
Change-Id: I6787bc5d341f7e36a8a35102a5ce651c3aa296f8
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
d741b3dfbb60eadaa2c1835e347825e18c19a802 15-Aug-2017 Jiwen 'Steve' Cai <jwcai@google.com> Add dvr API to create write queue locally

Currently, this API is mostly for testing purpose. But also note that
this API might eventually deemed useful if BufferHub-based ANativeWindow
becomes binder parseable.

Bug: 37517761, 64723700
Test: dvr_api-test --gtest_filter='DvrBufferQueueTest.*'
Change-Id: I9429079a4936d474fabb0026c38d3a1a4dcab92e
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
08fca7329e85dbfdcea927865bc768325c9da2ba 29-Jul-2017 Jiwen 'Steve' Cai <jwcai@google.com> Add TestStableBufferIdAndHardwareBuffer

Verifies a Dvr{Read,Write}BufferQueue contains the same set of
Dvr{Read,Write}Buffer(s) during their lifecycles. And for the same
buffer_id, the corresponding AHardwareBuffer handle stays the
same. User of DVR API need to make sure buffers from a queue can be
cached by buffer_id.

Bug: 64208560
Test: DvrApi-test
Change-Id: I1f89c49061b8727bb6a321201b1556b5ceffc9a9
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
97274870fc8229b507fc71566c0502eb322655cf 21-Jul-2017 Jiwen 'Steve' Cai <jwcai@google.com> 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
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
42c6f3adbc8473efb0d375e1d564d1522723c6be 01-Jul-2017 Jiwen 'Steve' Cai <jwcai@google.com> 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
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
656f406fcb0c45fd3c729a513bdd3f353cc6ec1f 22-May-2017 Jiwen 'Steve' Cai <jwcai@google.com> DvrWriteBufferQueue: support buffer resizing

Currently, the buffer resising is implemented at the C API's
implementation level, i.e. it's a pure client side logic out of the core
BufferHubQueue C++/PDX implementation. The logic is similar to
BufferHubQueueProducer's buffer resizing logic.

Other minor changes:
1/ Use ProducerQueueConfig in DisplaySurface as well, and plumb default
width, height, and format to bufferhubd when a BufferHubQueue is created
through a Display Surface.
2/ Added detailed dvr_buffer_queue comments.
3/ Since we now have more and more logic in dvr_buffer_queue, refactored
Dvr{Read,Write}BufferQueue to be C++-styled class.

Bug: 38324405
Test: buffer_hub_queue_producer-test, buffer_hub_queue-test, dvr_api-test
Change-Id: I7186fc04e84eafda46eca316a94739bb3b5c07ca
/frameworks/native/libs/vr/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp
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/libdvr/tests/dvr_buffer_queue-test.cpp