Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAlways use the same display connection #40
Conversation
| // WARNING: We currently rely on the X display connection being the | ||
| // same in both the Painting and Compositing contexts, as otherwise | ||
| // the X Pixmap will not be sharable across them. Using this | ||
| // method breaks that assumption. |
This comment has been minimized.
This comment has been minimized.
pcwalton
Dec 16, 2013
Contributor
Will this work in multiprocess (i.e. when renderer and compositor are different processes altogether)?
This comment has been minimized.
This comment has been minimized.
larsbergstrom
Dec 16, 2013
Author
Contributor
I suspect that it will not. I am hoping to unblock our use on NVidia and then to get in touch with some of the gfx team to hear more about the details of how they think we should architect this (I've been unable to figure out their plans from some casual IRC conversations or the source/wiki pages, though I'm pretty new to this space). They did tell me that if you share an X pixmap, it's tied to the X display connection it was created on, so I suspect we would either need to dup() the X display socket or be sharing something else.
This comment has been minimized.
This comment has been minimized.
pcwalton
Dec 16, 2013
Contributor
Bummer. Duping the FD makes me sad because eventually I'd like to use XSECURITY to lock down the renderer's access some.
I wonder if EGLImage works on NVIDIA? It's an alternate method to share GL textures between processes. From conversations with jgilbert and vlad it sounds like that's what they want to do.
This comment has been minimized.
This comment has been minimized.
pcwalton
Dec 16, 2013
Contributor
If there is no way to share pixmaps between display connections then I think we have no choice but to use Unix shared memory and perform texture upload on the compositor side. This will close off Skia-GL, BTW, until we can hack it to remote all GL commands to the other process.
But I'm confused—if you can't share pixmaps between display connections, then how does Compiz work on the NVIDIA driver? I thought you could transform the output of glxgears, for example.
This comment has been minimized.
This comment has been minimized.
larsbergstrom
Dec 16, 2013
Author
Contributor
I'm still trying to learn more about this myself. Possibly this would work if we were also passing along a "global" context index and then making sure that all other contexts mark that global context as having permission, but that only works for a shared address space (so presumably not cross-process).
The gecko implementation appears to be incomplete on X at this point and subject to change - at the gfx workweek this week, they are planning on talking about their new plan for sharing surfaces between threads/processes:
https://wiki.mozilla.org/Platform/GFX/Surfaces
Which seems to revolve around EGL streams:
http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_stream.txt
I'd love to get more info.
|
Well, I messed up this push -f... |
larsbergstrom commentedDec 16, 2013
Needs some discussion with @metajack
This set of changes fixes Linux NVidia (and properly uses the same X11 display connection for X pixmaps).