anv: Performance issue with Vulkan on Wayland KWin
Starting with Mesa 22.3 there is another performance issue running Vulkan applications on KWin on Intel systems with an integrated GPU.
Annoyingly since 22.0 there is a separate bug causing such a performance regression #7019 (closed), which was fixed in 22.3, hence only a handful of commits during 22.3 development actually show expected performance.
I have bisected this to db42ed1e.
This commit introduces a check to verify that the compositor is using the same GPU as the client, using zwp_linux_dmabuf_feedback_v1::main_device
.
On my system KWin reports the major/minor numbers for /dev/dri/card0
(226, 0)
, whilst Mesa expects the ones for /dev/dri/renderD128
(226, 128)
.
This issue does not affect Sway or Weston, which report /dev/dri/renderD128
as the main_device
, only KWin.
I have reported this on the KWin side at https://bugs.kde.org/show_bug.cgi?id=464669 and they are of the opinion that this should be fixed in Mesa, e.g. using drmDevicesEqual
.
The issue seems to cause the buffer to use a linear layout, which causes a massive performance penalty on this system, with e.g. vkmark going from 5378 on Weston to 1382 on KWin.
System information
- OS: Arch Linux
- GPU: HD Graphics 620 (KBL GT2)
- Kernel version: 6.1.3-zen1-1-zen
- Mesa version: 22.3.3
- Desktop manager and compositor: KDE Plasma 5.26.5 (Wayland)