Skip to content
Snippets Groups Projects
Commit 8b38e8b0 authored by Weilun Du's avatar Weilun Du
Browse files

[GL] Gralloc Refcount Pipe


RefCount Pipe is a different approach to simplify the Color Buffer
management on host. In guest, the handle returned by gralloc
allocator can be passed around between processes through Binder.
Android system ensures that the handle on both calling and receiving
end willl be properly closed. Thus, when gralloc allocates buffer for
the first time, we establish a Refcount pipe between guest and host,
and assign its fd to the handle. when cloned handle is closed, the
duplicated fd will also be closed. Guest kernel will decide when to
really close the fd and to trigger the pipe's closing on host.
On the host side, we only need to destroy the color buffer immediately
and not execute any reference counting code path.

This approach will not only simplify the logic between guest and host
but also reduce memory leaks.

BUG: 116349069

Signed-off-by: default avatarWeilun Du <wdu@google.com>
Change-Id: Iab9fe76f5947b914b11fcdccdb61018957e20e50
parent 8d4f3444
Branches
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment