Xwayland: Implement linux_dmabuf v4 feedback support
This change adds support for linux_dmabuf v4, which added per-surface dmabuf feedback. In the future this will allow scanout modifiers that a compositor advertises to be delivered to X11 apps.
Implementation overview
- clients will use the
DRI3SetDRMDeviceInUse
event to give Xwayland a hint about what device they want specific modifiers for on a particular window. - Xwayland will record tranches advertised with linux_dmabuf_feedback by the compositor, both default feedback and for each
xwl_window
. - When the client calls
GetSupportedModifiers
, Xwayland will return the default feedback's modifiers in the screen modifiers return parameter, and the per-xwl_window
feedback's modifiers in the window modifiers return parameter. - If Xwayland has received new feedback from the compositor, it will send the
PresentCompleteModeSuboptimalCopy
flag inPresentCompleteNotify
to tell the client to re-query modifiers.
I've tried to implement it in small chunks to make it easier to review, hence why there is a commit that adds a skeleton of the wayland event handling and later commits add implementations. If this is a problem I can squash it before merging.
Related MRs
- wayland-protocols: wayland/wayland-protocols!8 (merged)
- DRI3 proto update: xorg/proto/xorgproto!45 (merged)
- XCB proto update: xorg/proto/xcbproto!28 (merged)
This series is dependent on the DRI3 changes listed above.
Testing
Tested with wlroots+sway and weston, both on Nvidia. Using this sway MR I tested that glxgears was notified through PresentCompleteNotify
when per-surface feedback is updated while going fullscreen and could update it's modifiers.
Please let me know if there is anything I can do to improve this series, or if there are any potential problems I may not have anticipated.