History log of /frameworks/native/libs/vr/libpdx/service.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f0a7bd033941e26e380232a0515e903cf8e678e5 01-Apr-2017 Alex Vakulenko <avakulenko@google.com> pdx: Rework error reporting when transfering file and channel handles

There is a lot of confusion about reporting errors when passing file
and channel handles over PDX transport between client and service.

Methods like Message::PushFileHandle return an integer which means
both a file handle reference value (if positive) and a possible error
code (if negative). But file handles could contain negative values too
(when they are empty). This is used frequently when passing buffer
fences around (when a fence is not being used, its fd is set to -1).

This results in a special case of when PushFileHandle is called with
a file handle with value of -1, the return value is actually "-errno"
which becomes dependent on a global state (errno is not set by
PushFileHandle itself in case file handle value is negative) and results
in unpredicted behavior (sometimes errno is 0, sometimes its >0).

Cleaned this all up by using Status<T> everywhere we used an int to
pass value payload along with possible error code.

Now the semantics of the calls are more clear.

Bug: 36866492
Test: `m -j32` for sailfish-eng succeeds
Ran unit tests on device (pdx_tests, libpdx_uds_tests, bufferhub_tests,
buffer_hub_queue-test, buffer_hub_queue_producer-test), all pass
Ran CubeSea, NativeTreasureHunt and Ithaca on Sailfish with vrflinger
enabled, was able to use controller and screen rendered correctly.

Change-Id: I0f40c3f356fcba8bc217d5219a0ddf9685e57fd7
/frameworks/native/libs/vr/libpdx/service.cpp
f8955e51fc1f77b056ecc8d9a4a0c4e0776858cb 24-Mar-2017 Alex Vakulenko <avakulenko@google.com> Revert "Quick fix to correctly handle empty file/channel handles."

This reverts commit e71fb7d2ab1118d30c5bec8a85114ac610844dc6.

This CL broke PDX unit tests

Bug: 36587839
Change-Id: I5b3cb857aacff337cb9a268a0415f8398303abe8
/frameworks/native/libs/vr/libpdx/service.cpp
e71fb7d2ab1118d30c5bec8a85114ac610844dc6 22-Mar-2017 Corey Tabaka <eieio@google.com> Quick fix to correctly handle empty file/channel handles.

Empty file/channel handles (value < 0) should result in a negative
FileReference/ChannelReference value. The original code incorrectly
interpreted the negative reference value as an error, causing errno
to be returned. In most cases errno is 0, leading to confusion
across the wire when the deserialization logic attempts to lookup an
invalid, but non-empty reference.

Bug: None
Test: bufferhub_tests passes
Change-Id: I664daf3cdc178fe2c4ca0c44eef35a8bb9c7310d
/frameworks/native/libs/vr/libpdx/service.cpp
4fe60582f314e381098f8f3bc2e39c5880e9243a 02-Feb-2017 Alex Vakulenko <avakulenko@google.com> Remove references to libchrome

Removed dependencies on libchrome which was used mostly for logging
and switched over to standard Android log macros.

Bug: None
Test: `m -j32` still succeeds
Change-Id: I0a841c19c15c02f9a031af200e82837f9450d88a
/frameworks/native/libs/vr/libpdx/service.cpp
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/libpdx/service.cpp