New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 774523 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add GMB to TransferableResource

Project Member Reported by reve...@chromium.org, Oct 13 2017

Issue description

TransferableResource carries either a shared bitmap or a texture today. By extending it to also support GpuMemoryBuffer we can avoid the need for client side logic required to bind the GMB to a texture. This would provide performance improvements, avoid race-conditions during tear-down as GMB ownership can be passed with IPC and reduce with complexity significantly on the client side.

Note that some complexity would be moved to the display compositor instead. For example, we would have to manage the GLImage and binding to a texture on that side instead.
 

Comment 1 by fsamuel@google.com, Oct 13 2017

Cc: rjkroege@chromium.org weiliangc@chromium.org sadrul@chromium.org danakj@chromium.org gklassen@chromium.org
Adding some more viz people to cc so they're aware of this proposal. Thanks!

Comment 2 by danakj@chromium.org, Oct 13 2017

What concrete type would be in the structure? Hopefully not gfx::GpuMemoryBuffer - it should be some simple-ipc type.

Comment 3 by danakj@chromium.org, Oct 13 2017

Also there were thoughts in the past about replacing the shared bitmaps for compositor transport with GMB. Does that still make sense? Could this be part of that?
I'd like to see unique_ptr<gfx::GpuMemoryBuffer> in the structure as that makes ownership simple. Would that be a problem? 

I think we should be able to replace shared bitmaps with shared memory backed GMBs after adding this.

Comment 5 by danakj@chromium.org, Oct 13 2017

We can't IPC a pointer, so no pointers please. That would have to be translated into some other type over IPC so it'd be nicer to just put that other thing in the structure. What would that be?
gfx::GpuMemoryBuffer can be transferred over IPC just like base::SharedMemory can. It's an important part of the design of GMBs. GMBs are passed over IPC by acquiring a handle through GMB::GetHandle() on the sender side and then instantiated on the receiving side using GMBF::CreateFromHandle().

Comment 7 by danakj@chromium.org, Oct 13 2017

I mean, I get that they are transferring, but the pointer is not what we send, there's some more wire-formaty type. That's what should be in TransferableResource, otherwise it contrains how we transport TransferableResource (we cant just send the array as a block of memory for example).
We probably want the GMB handles here in that case but not completely sure what you mean by wire-formaty. FDs can't just sent as a block of memory but I guess they are considered wire-formaty?

GMB instances are not copyable but the handles are so if that's a requirement for TransferableResource then handles are appropriate. Handles leak implementation details and it's much easier to leak memory by mistake when using them. That's why real GMB instances should be preferred whenever possible.

Comment 9 by danakj@chromium.org, Oct 17 2017

> FDs can't just sent as a block of memory but I guess they are considered wire-formaty?

FDs are integers, which can be memcpy'd, unless I am misunderstanding what you mean by FD?

> GMB instances are not copyable but the handles are so if that's a requirement for TransferableResource then handles are appropriate. Handles leak implementation details and it's much easier to leak memory by mistake when using them. That's why real GMB instances should be preferred whenever possible.

Ok thanks it sounds like handle is what we'd want here.
Project Member

Comment 10 by sheriffbot@chromium.org, Oct 18

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment