| Summary: | Mesa commit 83916ae0, "egl/wayland: add initial dma-buf feedback support" interacts badly with kwin_wayland's dma-buf feedback code, causing Mesa to fallback to llvmpipe | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | Kyle Devir <kyle.devir> |
| Component: | egl | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jason098, kyle.devir, nate, xaver.hugl |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 5.24 | |
| Sentry Crash Report: | |||
| Attachments: | kwin_wayland log with kwin_*.debug=true | ||
|
Description
Kyle Devir
2022-01-11 22:07:24 UTC
To be frank, I have absolutely on clue what's happening - map shouldn't fail, and it doesn't on my end. Could you add some debug prints in Mesas surface_dmabuf_feedback_format_table? Of interest would be the fd, and errno after mmap. Since I'm affected by this issue as well, I've added debug prints to default_dmabuf_feedback_format_table for fd and errno after mmap. The fd I got is 19 and the errno is 22 (EINVAL). The reason why mmap fails with EINVAL appears to be because the 2nd argument (size_t len) is 0, as hardcoding a non-zero value makes it succeed. A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1875 The only way I see that the size can be 0 is when querying the available formats fails. I added some logging in the MR, maybe you can check out what it says for you? Created attachment 145426 [details]
kwin_wayland log with kwin_*.debug=true
With that MR I get the following new line:
kwin_scene_opengl: EGL driver advertises 29 supported dmabuf formats with modifiers
None of the qCCritical messages triggered.
Git commit 4b8b8b765262822ccc6599a9767bed587f751950 by Xaver Hugl. Committed on 13/01/2022 at 23:43. Pushed by zamundaaa into branch 'master'. egldmabuf: add some logging about supported formats May help diagnose some bugs M +4 -0 src/platformsupport/scenes/opengl/egl_dmabuf.cpp https://invent.kde.org/plasma/kwin/commit/4b8b8b765262822ccc6599a9767bed587f751950 A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1876 @jason
> Since I'm affected by this issue as well, I've added debug prints to default_dmabuf_feedback_format_table for fd and errno after mmap.
Thanks for the testing, as I don't know how to do that.
Git commit aae86f73e140afd526efad8a9308ff811299de04 by Xaver Hugl. Committed on 14/01/2022 at 09:32. Pushed by zamundaaa into branch 'Plasma/5.24'. egldmabuf: add some logging about supported formats May help diagnose some bugs (cherry picked from commit 4b8b8b765262822ccc6599a9767bed587f751950) M +4 -0 src/platformsupport/scenes/opengl/egl_dmabuf.cpp https://invent.kde.org/plasma/kwin/commit/aae86f73e140afd526efad8a9308ff811299de04 With MR 1876, the wayland-egl format table warnings are gone and nothing falls back to llvmpipe anymore. Thanks! Git commit 031bb305e3868b85f1b08145953f021f9b8a938e by Xaver Hugl. Committed on 14/01/2022 at 09:27. Pushed by zamundaaa into branch 'master'. egldmabuf: if modifiers are not supported, send DRM_FORMAT_MOD_INVALID An empty modifier list will get ignored and does not mean implicit modifiers are allowed M +1 -1 src/platformsupport/scenes/opengl/egl_dmabuf.cpp https://invent.kde.org/plasma/kwin/commit/031bb305e3868b85f1b08145953f021f9b8a938e Git commit a5bca1f1a92bc256c3df538bab7716817872b800 by Xaver Hugl. Committed on 14/01/2022 at 10:28. Pushed by zamundaaa into branch 'Plasma/5.24'. egldmabuf: if modifiers are not supported, send DRM_FORMAT_MOD_INVALID An empty modifier list will get ignored and does not mean implicit modifiers are allowed (cherry picked from commit 031bb305e3868b85f1b08145953f021f9b8a938e) M +1 -1 src/platformsupport/scenes/opengl/egl_dmabuf.cpp https://invent.kde.org/plasma/kwin/commit/a5bca1f1a92bc256c3df538bab7716817872b800 Ah, Polaris doesn't really have modifier support, the extension is supported but doesn't expose any modifiers. That explains it Can confirm there is no fallback to llvmpipe now. Thanks for the hard work, as usual. :) |