Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use the same display connection #40

Closed
wants to merge 11 commits into from

Conversation

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Dec 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).

// 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.

@pcwalton

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.

@larsbergstrom

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.

@pcwalton

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.

@pcwalton

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.

@larsbergstrom

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.

@larsbergstrom
Copy link
Contributor Author

larsbergstrom commented Jan 13, 2014

Well, I messed up this push -f...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.