linux-dmabuf: add wp_linux_dmabuf_hints
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 firstname.lastname@example.org
- wlroots patch: https://github.com/swaywm/wlroots/pull/1376
- Weston patch: weston!397
- Mesa patch: mesa/mesa!4460 (old patch: