linux-dmabuf: add wp_linux_dmabuf_feedback
On multi-GPU setups, multiple devices can be used for rendering. Clients need hints about the device in use by the compositor. For instance, if they render on another GPU, then they need to make sure the memory is accessible between devices and that their buffers are not placed in hidden memory.
This commit introduces a new wp_linux_dmabuf_hints object. This object advertises a preferred device via a file descriptor and a set of preferred formats/modifiers.
Each object is bound to a wl_surface and can dynamically update its hints. This enables fine-grained per-surface optimizations. For instance, when a surface is scanned out on a GPU the compositor isn't compositing with, the target device can be set to this GPU to avoid unnecessary roundtrips.
A hint object can also be standalone for clients that don't support per-surface hints.
Signed-off-by: Simon Ser contact@emersion.fr
- Docs: https://gitlab.freedesktop.org/emersion/wayland-protocols/-/blob/dmabuf-hints/unstable/linux-dmabuf/hints.rst
- wlroots patch: https://github.com/swaywm/wlroots/pull/1376
- Weston patch: weston!544 (merged)
- mutter patch: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1959
- Mesa patch: mesa/mesa!11248 (merged) (old patch:
mesa/mesa!4460 (closed)) (even older patch:https://lists.freedesktop.org/archives/mesa-dev/2018-November/209804.html) - Potential TODO: write Kodi patch: https://github.com/xbmc/xbmc/blob/7a3e5a31febdde35a887d992dcc03d3a05c841e2/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp#L267
- Potential TODO: write libva patch
Closes: wayland#59 (moved)