ValveSoftware / gamescope

SteamOS session compositing window manager
Other
2.83k stars 189 forks source link

Zero copy when nested #64

Open emersion opened 4 years ago

emersion commented 4 years ago

Avoid copying buffers when running nested: directly hand over the game's DMA-BUF to the parent compositor.

Plagman commented 4 years ago

Out of curiosity, are any current desktop Wayland compositors supporting that? Is there a standard protocol?

emersion commented 4 years ago

Yes, this is a standard protocol: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml

All Wayland compositors support it.

Plagman commented 3 years ago

I guess my questions was more whether any common compositors actually then proceeded to scan out the forwarded DMA-BUF, as opposed to compositing it. Mostly out of curiosity, as it seems to be a great thing to plumb regardless. We can probably have it as a 'wayland_can_avoid_composite' type thing that has a similar abstraction as the DRM one to short-circuit Vulkan. Ideally we'd grow that support for X11 hosts as well, was chatting with Keith about it a couple months ago but there's not really a firm plan for that yet.

emersion commented 3 years ago

Oh, I see. Some compositors will attempt direct scan-out: GNOME, Sway, Weston at least, I think KWin recently got support for that but I'm not 100% sure. I don't know about others.

emersion commented 3 years ago

It should be possible to add zero-copy support for our nested X11 window too via Present.