Skip to content

xwayland: Use linear buffers when dmabuf_feedback requires it

When dmabuf_feedback version 4 or later is used do not fall back to implicit buffers if the xwayland's device differs from the main_device.

kwin_wayland 6.1.4 (and earlier) s using different DRM devices for wl_drm and zwp_linux_dmabuf_feedback_v1 on kmsro devices like the Raspberry Pi 4. In wl_drm's device event the GPU's render node is announce but dmabuf_feedback's main_device and the target_device in every tranche references the the display/KMS DRM device. xwayland falls in this case back to implicit modifiers. This results on the Raspberry Pi 4 in a corrupt screen due to a mismatch of implicit
modifiers in each device as reported in https://bugzilla.redhat.com/show_bug.cgi?id=2270430

While this behavior is in my view nonsensical there is still an issue in xwayland. dmabuf_feedback's main_device documentation explicitly mentions this situation:

| If explicit modifiers are not supported and the client performs buffer | allocations on a different device than the main device, then the client | must force the buffer to have a linear layout.

The suggestion from kwin's side for handling their dmabuf_feedback with primary node only DRM devices was to open render devices until one with compatible modifiers was found. This is not a good match for xwayland's design of relying on the compositor for devices, formats and modifiers.

Signed-off-by: Janne Grunau j@jannau.net

Merge request reports