NVIDIA / egl-wayland

The EGLStream-based Wayland external platform
MIT License
293 stars 47 forks source link

egl-wayland: Read compositor device from zwp_linux_dmabuf_v1 #100

Closed Molytho closed 8 months ago

Molytho commented 8 months ago

Compositors start dropping support for wl_drm because it is replaced by linux-dmabuf. See https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/2f2a55ebd3c5a950f1bf8c280edf0838721363da. Try reading compositors main device from linux-dmabuf v4 if supported and otherwise fallback to wl_drm.

erik-kz commented 8 months ago

Thanks for the patch! Note, however, that we already bind the zwp_linux_dmabuf_v1 protocol and retrieve the default feedback during wlEglInitializeHook. So we shouldn't need to do it a second time.

I do think it's a good idea to use zwp_linux_dmabuf_v1 to determine the compositor device instead of wl_drm when possible. If you could modify the patch to keep that part but use the existing WlEglDisplay::defaultFeedback I would be happy to merge it.

Molytho commented 8 months ago

I changed the code to bind to zwp_linux_dmabuf_v1 only once. I also added some error handling to getServerProtocolsInfo. Sadly this made it more ugly

erik-kz commented 8 months ago

Thanks. This looks good to me. I just need to get a +1 from another NVIDIA engineer and then I will merge it.