gbm_bo_import from Wayland native applications for scanout fails with EINVAL
In KWin for direct scanout we import dma buffers using gbm_bo_import
with type=GBM_BO_IMPORT_FD
and usage=GBM_BO_USE_SCANOUT
, to then use the imported buffer for presentation. While this works well with Xwayland, I haven't found any native Wayland applications where it doesn't fail with EINVAL
. Importing without usage flags is sucessful but as expected scanout doesn't work completely, there are artifacts in the output.
Applications that I personally tested are Xonotic, mvp and a modified version of weston-simple-dmabuf-egl. On my hardware (rx 5700XT) the buffer format is AR24 without modifiers.
If it's useful, the relevant code in KWin is here under EglGbmBackend::scanout
.