Browser or renderer instances of GMBs cannot become invalid when the GPU process crashes for reliable usage.
Successful allocation of a native GMB must result in a GMB that can be used with any GPU process instance.
Ozone GMBs become invalid after GPU process crash as they are being tracked in the GBMFactory. Instead the GMBFactory needs to return a reference to the GMB in the GMBHandle that can be used to create a GLImage from the GMB with any GPU process instance.
Hmm, I was discussing this bug with Pawel today and then realized that it's a bit strange that anything could happening to a GpuMemoryBuffer in one process when another process dies. If I'm looking at the code properly, in our case, GpuMemoryBufferHandle (https://code.google.com/p/chromium/codesearch#chromium/src/ui/gfx/gpu_memory_buffer.h&l=40) contains a NativePixmapHandle, which in turn references a buffer using a file descriptor. It seems a bit strange for a file descriptor in one process to become invalid if another process is killed.
The problem is that we're not using file descriptors and what becomes invalid is the ability to refer to a buffer in the new instance of the GPU process. When this code was initially written a few years ago we didn't need to use FDs and reference the buffers that way. All we needed was to allocate the buffers and be able to refer to them using unique ids and we'd always recreate them when the GPU process crashes. That's no longer the case and this bug will be resolved by always passing buffer ownership using fds as then things just work. I have a patch to fix this somewhere. It just need a bit more work before it can land.
Aha, so I guess I misread some of the code, which misled me to believe that we are already using FDs. Using FDs for passing ownership sounds good to me.
Yes, we're not using that. We're just passing ownership using FDs now and that simplifies synchronization enormously. One major benefit is that sync points are not required when creating/destroying GLImages. I should be easy to get the same performance improvement for IOSurface GMBs as we already use mach_port_ts to pass ownership for there.
Comment 1 by reve...@chromium.org
, Mar 25 2016