| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Violation: variables should be lowerCaseCamel in the following directories:
frameworks/native/libs/ui and frameworks/native/services/bufferhub
Test: m, mma
Bug: 68273829
Change-Id: I7dc56ec17089456f98b018032f04f779b12632b2
|
| |
|
|
|
|
|
|
|
| |
Android Framework C++ Code Style Guidelines says that function names
should be camelCase: http://go/droidcppstyle
Test: m, mma in frameworks/native
Bug: 68273829
Change-Id: I2f661c06b31b2e72cd0eee3d91b95531b60ec939
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
User should be using GraphicBuffer/AHardwareBuffer::Lock/Unlock to lock/unlock
for CPU access to the data in the buffer.
BufferHubBase::Lock/Unlock exist were because this legacy class has IonBuffer,
which wraps a GraphicBuffer. The dependency will be reverted in the future, where
BufferHubBuffer backs GraphicBuffer.
Bug: None
Test: m, mma, vrflinger_test
Change-Id: I3e3287529326dce3ae57e344c5c738b898c3d44d
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This method is not used in DVR buffering system. BufferHubBuffer may
consider having it later when it meets an use case when the buffer
contains multiple fds in buffer handle, and directly have it implemented
in BufferHubBuffer class.
Test: build
Bug: None
Change-Id: I95cd71d936695eeb77bd049f43fe350fb60d9154
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
because the eventfd should not be polled directly after
Consumer/ProducerBuffer are backed by BufferHubBuffer.
The only current instances of BufferHubBase::Poll being used are in
buffer_hub-test
Bug: None
Test: m, mma, buffer_hub-test
Change-Id: Iac586086aed54510c1a8bae020e5ca24d8fd065e
|
| |
|
|
|
|
|
|
|
|
| |
IsReleased() or is_released().
Fix: 122854791
Test: BufferHub_test BufferHubServer_test VtsHalBufferHubV1_0TargetTest
buffer_hub-test buffer_hub_queue-test dvr_buffer_queue-test
on walleye_xr
Change-Id: I2431a4ddd78cb2eef9bdeafc0d9048571f7a0c61
|
| |
|
|
|
|
|
|
|
| |
Both of them used to be the PDX backend of DetachedBuffer (now
BufferHubBuffer) and now not needed as we have the hwbinder backend.
Test: buffer_hub-test, BufferHub_test
Bug: 118891412
Change-Id: I000042ee6f23f98fabcdd60eb2aedda928769314
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, producer only post to all current clients of the buffer
except for the producer itself. In this change, producer post to all
existing and non-existing clients of the buffer except for the producer
itself.
Fix: 120869419
Test: Vega is able to recover itself during DON after killing vrcore
or compositor process.
Test: on vega_xr and blueline_xr with the following tests
buffer_hub-test buffer_hub_queue-test dvr_buffer_queue-test
dvr_api-test libdvrtracking-test(vega only) buffer_hub_queue_producer-test
Change-Id: I29f24268b7704fbeb06a4302b11dcd89dd13c133
|
| |
|
|
|
|
| |
Bug: 116855254
Test: Build
Change-Id: Ief03795d2093f817f135d33eb252e1e040e150f7
|
| |
|
|
|
|
| |
Test: build
Bug: 116855254
Change-Id: I1a736a9d64f51bec7baa85e0c35c39b153bbb354
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix: 117849512
Test: Blueline: atest AHardwareBufferTest BufferHub_test
buffer_hub_queue_producer-test libgui_test
libsensor_test vrflinger_test buffer_hub-test buffer_hub_queue-test
dvr_buffer_queue-test dvr_api-test dvr_display-test
Test: in libui_test InputSurfacesTest are segfault on top of master already.
Test: Vega: AHardwareBufferTest BufferHubBuffer_test
BufferHubMetadata_test buffer_hub_queue_producer-test buffer_hub-test
dvr_buffer_queue-test buffer_hub_queue-test dvr_api-test
libdvrtracking-test
Change-Id: I55f91c21f7ac07615b5451b5413521d7938cf591
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New libraries in libui and bufferhub shall be using
android::BufferHubDefs instead of android::dvr::BufferHubDefs.
Bug: None
Test: atest AHardwareBufferTest BufferHubBuffer_test
BufferHubMetadata_test buffer_hub_queue_producer-test libgui_test
libsensor_test vrflinger_test buffer_hub-test buffer_hub_queue-test
dvr_buffer_queue-test dvr_api-test dvr_display-test
Test: in libui_test InputSurfacesTest are segfault on top of master already.
tested on Blueline and Vega
Change-Id: Ia755022c96147969a401ed32544082a8c76936a0
|
| |
|
|
|
|
|
|
|
|
|
| |
And move libbufferhubservice off libbufferhub_headers and libpdx_headers
dependency.
Test: build passed, including all the tests under libui and
libbufferhubservice
Bug: 118893702
Change-Id: I8163a7524c6078f9fbb264cf5253d8cbe05dd1c4
|
| |
|
|
|
|
|
|
|
|
|
| |
To remove BufferHubMetadata off pdx dependency.
Note that the __attribute__(packed) is removed as part of this CL, as
it's not really needed and is triggering clang warnings.
Test: build passed. Not test needed as no behavior changes.
Bug: 118893702
Change-Id: Ifae94a143a2bedef68a653c57f089b95d166e6d7
|
| |
|
|
|
|
|
|
|
| |
As we decided the new bufferhub service should be hwbinder instead of
binder, these binder codes no longer make sense.
Test: build passed
Bug: 118891412
Change-Id: I5eae2516d279ea85c156d49a2ab31e8e319baae2
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Please refer to go/bufferhub-buffer-state-redesign for more information.
In this change:
1. Every clients takes up two bits in the buffer_state.
One from the higher 32 bits, one from the lower 32 bits. For details:
go/bufferhub-buffer-state-redesign
2. Upon the creation of a new buffer, the buffer is in released state.
Previously, only producer creates buffer, and upon creation, the buffer
was in gained state. Now, producer needs to specifically gain the buffer
before trying to produce and post it.
3. If there is no other clients when a client post a buffer, the buffer
will actually be in released state instead of posted state. This is
because the posted buffer does not have readers and can be reused
immediately.
4. If a new client is added to the buffer when the buffer is in acquired
or posted state, the buffer state of the new client will be set to posted
state and able to acquire the same buffer content as posted.
In the next change:
variables of type std::atomic<uint64_t> in metadata header in shared memory
will be replaced by std::atomic<uint32_t>
Test: marlin-eng passing AHardwareBufferTest BufferHubBuffer_test
BufferHubMetadata_test buffer_hub_binder_service-test
buffer_hub_queue_producer-test dvr_api-test libgui_test
libsensor_test vrflinger_test buffer_hub-test
dvr_buffer_queue-test dvr_display-test buffer_hub_queue-test
Test: smartphone VR works on blueline-eng
Test: vega_xr passing AHardwareBufferTest BufferHubBuffer_test
BufferHubMetadata_test buffer_hub_queue_producer-test buffer_hub-test
buffer_hub_queue-test dvr_buffer_queue-test dvr_api-test
Cherrypicking this changelist to oc-dr1-daydream-dev branch requires
ag/5514563 to be merged at the same time to make Vega actually work.
Bug: 112007999
Change-Id: I86393818ad922a91c709fe22f8e99b0667d2e9ef
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in bufferhub related directories
Bug: 118696702
Fixes: 118696702
Test: all tests pass.
AHardwareBufferTest BufferHubBuffer_test BufferHubMetadata_test
buffer_hub_binder_service-test buffer_hub_queue_producer-test
libgui_test libsensor_test vrflinger_test buffer_hub-test
buffer_hub_queue-test dvr_buffer_queue-test dvr_api-test
dvr_display-test
Change-Id: Iee198ddbec035856185fcab34b0d631bd3726b77
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
kProducerStateBit covers the MSB of the buffer/fence state.
kFirstClientBitMask covers the LSB of the buffer/fence state.
This change replaces the kProducerStateBit with kFirstClientBitMask, and
update the kConsumerStateBit to be the inverse of kFirstClientBitMask.
Test: AHardwareBufferTest BufferHubBuffer_test BufferHubMetadata_test
buffer_hub-test buffer_hub_binder_service-test buffer_hub_queue-test
buffer_hub_queue_producer-test buffer_node-test dvr_api-test
dvr_buffer_queue-test dvr_display-test libgui_test libdvrcommon_test
pdx_tests GraphicBuffer_test
Bug: 118718713
Change-Id: I647f36ee3fb2eb5dc996b781ed0ff71f7f72c112
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
std::atomic::load operation is with std::memory_order_seq_cst by
default. However, load operation in bufferhubd and buffer hub client
does not need sequentially-consistent ordering which is provided by
std::memory_order_seq_cst. This change changes our load operation with
std::memory_order_acquire so that no reads or writes in the current
thread can be reordered before this load, all writes in other threads
that release the same atomic variable are visible in the current thread.
Test: all tests are still passing.
Test: vega still working.
Bug: 112007999
Bug: 118718713
Change-Id: I2ac75cc306c3de35bf3d953b353f9a9442bdebbc
|
| |\ \
| |/
|/|
| |
| |
| | |
* changes:
Add importBuffer to BufferHubBinderService
Add duplicate to BufferClient
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Calling BufferClient::duplicate() will now return you an uint64_t token
stands for a specific BufferNode. In later CLs users could pass this
IPC-friendly token everywhere and use it to create a IBufferClient
linked to that BufferNode.
The token is derived from the mt19936_64 random algorithm. No same
tokens will be generated at the same time by checking the token_map_.
The map holds a weak_ptr so that if the BufferNode goes away by some
reason the map will not keep it, preventing from memory leak.
Add test case to test on the function.
Test: "atest buffer_hub_binder_service-test" passed.
Bug: 116681016
Change-Id: I54c34d9fabe882326faa141a6f0691419b740694
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Test: all tests are still passing.
Bug: None
Change-Id: I931d299525f03f06693ebbcb1a74a027a92808c2
|
| |\ \ \
| |/ /
|/| | |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add kMaxNumberOfClients to BufferHubDef. This variable will also be
needed when buffer state is changed according to
go/bufferhub-buffer-state-redesign
Test: BufferHubBuffer_test buffer_hub-test buffer_node-test
Bug: 112007999
Change-Id: I453438f3e2defa1fc93d1e74a282a38360f27694
|
| |/
|
|
|
|
|
|
|
|
|
| |
ProducerBuffer.Detach is disabled during migration. Therefore, related
pdx rpc code is no longer needed and could be removed. This is also
required to move BufferNode off IonBuffer, as one of the constructor of
BufferNode is called inside these code.
Test: "atest buffer_hub-test" passed.
Bug: 112338294
Change-Id: I950a2d0f59362f217636da9310f7bfff23127092
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reasons:
1. This variable is not refering to a property of the buffer. It refers
to a client of the buffer.
2. The original "buffer_state_bit" of a producer/consumer is actually
the client state bit mask for both buffer_state and fence_state in
shared memory. Thus, "buffer_state_bit" does not make sense for the
fence state.
3. In the future, Every clients takes up two bits in the buffer_state.
For simpler bit manipulation, there will be a future change making the
client_state_bits two bits as well. Please refer to ag/5236978 for an
early look at the future bit manipulation. Thus, this change replaces
"bit" with "mask".
Test: build
Bug: 112007999
Change-Id: I72f59ab9491bd2f135da068f578195fbf5e6c2b6
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Say there are 3 buffers allocated in buffer queue or some sort of
containers of the buffers, and all of the three buffers are in
posted state. Consumers are taking their time to do other things.
In this case, the producer who is using the buffers from this buffer
container would not be able to produce image because there is no buffer
available (unless the container of the buffer decide to allocate new
buffers). This change allows the container of the buffer decide whether
to reuse an old posted buffer, or to allocate new buffer, for the
producer side of the buffer container to produce image into.
Bug: 80164475
Test: buffer_hub-test on Taimen and Vega
Change-Id: I8c3d10a3b32ffa4bbf24da176a694b12c4dc3a5d
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function is useless for now and in foreseeable future because user
metadata will be in ashmen, and there won't be custom metadata on the
Acquire() interface.
Test: buffer_hub-test buffer_hub_queue-test
buffer_hub_queue_producer-test dvr_api-test dvr_buffer_queue-test
Test: master branch with Marlin
Test: oc-dr1-daydream-dev branch with Vega
Bug: 70048475
Change-Id: I5222ea1034d1fc011055d75a4b814a005913bbd1
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When calling createBuffer, bufferhubd will now alloc the buffer via
creating a BufferNode in the server side, and return you a
BpBufferClient object for communication. A BpBufferClient is binded with
one specific buffer.
Currently you could only call isValid() on the client. More APIs will be
added in future CL.
Test: "atest buffer_hub_binder_service-test". Passed
Bug: 116681016
Change-Id: I05ec627474303af46a792b0b6c2eaa904724d1f2
|
| |
|
|
|
|
|
|
| |
Test: buffer_hub-test buffer_hub_queue-test dvr_api-test
dvr_buffer_queue-test on marlin-eng
Bug: 77153033
Change-Id: I155fa5c5740243d84207f37e6a2fe37d6331628f
|
| |
|
|
|
|
|
|
|
|
| |
DuplicateHandle() and TakeHandle() are returning the native_handle_t*
as passing ownership out of the wrapper. Thus the returned pointer
shouldn't be in const.
Bug: 111976433
Test: buffer_hub-test
Change-Id: Ie353046f5b59beab674a81f4490d5de1d4beaa2e
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the active_consumer_bit_mask_ was a private member of producer
channel for creating new consumer buffers with unique buffer_state_bit_
so that newly added consumer can be uniquely identified amoung its
siblings. It was a union of all consumer's buffer_state_bit_.
In the re-design of buffer state, every consumer/producer/client buffers need
to know the location of every other consumer/producer/client in
buffer_state in order to post a buffer: when a client posts a buffer, it
changes its own buffer_state to 00 and others' buffer_state to 10. Thus, it
need to know where the other siblings locates in buffer_state atomic uint64_t.
active_consumer_bit_mask_ suffices this need.
This change moves the active_consumer_bit_mask_ from producer channel to an
uint64_t atomic variable in shared memory, and rename it as
active_clients_bit_mask_ (because it contain both consumers and
producers buffer_state_bit).
Test: marlin-eng on master branch
Test: vega_xr-eng on oc-dr1-daydream-dev branch
Test: buffer_hub-test buffer_hub_queue-test buffer_hub_queue_producer-test
Bug: 112007999
Change-Id: I1ae562701545c7504fd9367c8c8c63a2fd609264
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Move it into libui early so that new modifications towards it can be
coded in the libui style
This CL only moves the file and updates Android.bp with proper
dependencies. Will re-format the coding style in a follow up CL. The
reason behind this is to keep this CL small enough so that the "git
mv" operation will be considered as an renaming rather than a complete
rewrite.
Note that DetachedBuffer is not exposed to VNDK, so that we won't
need to worry about ABI compatibility. Also, it temporarily introduces
some clang warning exceptions, we should be able to remove them very
soon once pdx to binder refactor is done for detached buffer.
Bug: 112010261
Test: atest BufferHubMetadata_test
Change-Id: I63659b9a9b7cb56f30fc2ae8cc5b87977d79b59c
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This function is useless for now and in foreseeable future because user
metadata will be in ashmen, and there won't be custom metadata on the
Post() interface.
Tested on master branch with Marlin
and oc-dr1-daydream-dev branch with Vega
Test: buffer_hub-test buffer_hub_queue-test
buffer_hub_queue_producer-test dvr_api-test dvr_buffer_queue-test
Bug: 70048475
Change-Id: I58590e4a1358afdf784968bac65a48b98fd0f4fc
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
It is actually the same as GetBlobReadWritePointer. It is better not to
make the user of this function think that this function provide immutable
contents, and accidentally do something unexpected.
Tested on master branch with Marlin
and oc-dr1-daydream-dev branch with Vega
Test: buffer_hub_queue-test buffer_hub_queue_producer-test dvr_api-test
dvr_buffer_queue-test buffer_hub-test
Bug: None.
Change-Id: I1e6fd4ed1d7a1bbb611db910d35dc022bb4067a5
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1/ Migration DetachedBuffer's metadata to use ashmem-based
BufferHubMetadata.
2/ Avoid import the actual gralloc buffer into the IonBuffer. Instead,
just store the native_handle_t of the gralloc buffer in DetachedBuffer.
3/ Replace the usage of BufferDescription/NativeBufferHandle with
BufferTraits/NativeHandleWrapper, as they both depend on
IonBuffer. Currently dvr::ProdcuerBuffer and dvr::ConsumerBuffer
are still using BufferDescription/NativeBufferHandle so that we are
reimplementing them for DetachedBuffer to avoid chaning
dvr::ProdcuerBuffer and dvr::ConsumerBuffer at this point.
Bug: 112940221
Bug: 112011098
Bug: 70048475
Test: atest buffer_hub-test
Change-Id: I435180ba80a27b0ff35f0d95fcdbc23412978e22
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
buffer_hub_client.h used to contain BufferHubBuffer, BufferProducer
and BufferConsumer. Now those classes are all renamed and moved into
their own headers. Time to deprecate buffer_hub_client.h and move
BufferHubClient, which is only used by DetachedBuffer into
detached_buffer.h
Bug: 116855254
Test: atest buffer_hub-test
Change-Id: Id0bfb32165f955c060d982f1410ab11bfcf76bec
|
| |/
|
|
|
|
|
|
|
|
| |
Removed everything around ignored consumer because it is not used
anywhere in the code base, or in foreseeable future.
Test: build in frameworks/native directory
Bug: 117225895
Fixes: 117225895
Change-Id: I9bc3d868110408a0ebb8c96215d7d4588f9cfd2e
|
| |\
| |
| |
| |
| |
| |
| |
| | |
a45f6e6c2f am: d9f469b005
am: 11bc273c39
Change-Id: Id02b5052bb0d20367fad5c9b75b6eba934223787
|
| | |
| |
| |
| |
| |
| | |
Bug: 116614593
Test: build with WITH_TIDY=1
Change-Id: I47101c362198665194f8b3248751caaa7da32505
|
| | |
| |
| |
| |
| |
| | |
Bug: 111976433
Test: atest buffer_hub_metadata-test
Change-Id: I27365ad5efd06a800438cd8c751471c1e40b0f80
|
| | |
| |
| |
| |
| |
| | |
Test: None
Bug: 112007999
Change-Id: Ibc01cc879e638af9712495317260aabcb515781d
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Code in buffer_hub_cilent.{h,cpp} was the main client side
implementation of bufferhub. With years of developements, the content
of it was complicated enough to deserved separated files. Also rename
stuff for clarification.
old names:
+-------------------+
| BufferHubBuffer |
+---------^---------+
|
+------------------+ | +------------------+
| BufferProducer +----+-----+ BufferConsumer |
+------------------+ +------------------+
new names:
+-----------------+
| BufferHubBase |
+--------^--------+
|
+------------------+ | +------------------+
| ProducerBuffer +----+-----+ ConsumerBuffer |
+------------------+ +------------------+
Rename rationale:
1/ BufferProducer was originally poorly named and gets easily confused
with IGraphicBufferProducer. Actually, BufferProducer is a single
buffer that can produce (i.e. write) data into a buffer, but it
doesn't produce buffer. On the other hand, IGraphicBufferProducer
is the producer end of a BufferQueue and it is used to produce buffers.
2/ BufferConsumer was originally poorly named and gets easily confused
with IGraphicBufferConsumer. Actually, BufferConsumer is a single
buffer that can consume (i.e. read) data from a buffer, but it
doesn't consume buffer. On the other hand, IGraphicBufferConsumer
is the consumer end of a BufferQueue and it is used to consume
buffers.
3/ BufferHubBuffer is a pure base class and cannot be used
standalone. The old name suggests that it's a buffer object backed
by BufferHub, which might leads to confusion. Also, this rename is
in preparation of rename DetachedBuffer to BufferHubBuffer.
Bug: 116855254
Test: Build system
Change-Id: Id545648f5bdc7660e58f7bb49722651ae3bcca70
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Those accessor are not used outside of buffer_hub-test. Moreover, in
the new design, GraphicBuffer will depend on DetachedBuffer rather
than DetachedBuffer depending on GraphicBuffer.
Bug: 112010261
Bug: 112940221
Test: atest buffer_hub-test
Change-Id: I78b5ea8b195b8502fc8bdcda48ca600f6408897a
|