
Xaver published a blog post to outline the issues with the slow performance of CPU rendering and the usage of Wayland shared memory buffers leading to excess copies before hitting the GPU and scanning out. While the KWin compositor is seeing a Vulkan back-end developed and extensions there to help with dealing with shared memory from the host, ultimately the best solution was found using Linux's UDMABUF for wrapping MEMFD-allocated memory into a DMA-BUF for consumption by the GPU.
With code for Plasma 6.7, KWin will attempt to create a UDMABUF for each wl_shm buffer and import that into the GPU driver as the more optimal path than the existing buffer upload code. Xaver explained of the impact:
"On my laptop with a still relatively new and high end Ryzen 7840U, I could see the cursor sometimes skip frames when quickly moving it over project files in KDevelop, since KWin’s main thread was being blocked by these texture uploads. Normally that’s not really noticeable, but with the power profile set to “power save”, it felt really sluggish.
...
With the same example of KDevelop I mentioned before, the cursor is now always completely smooth. In terms of concrete numbers, KWin’s CPU usage while scrolling in KDevelop went from 80-90% on one core down to 20%!
These improvements will be in Plasma 6.7 and Qt 6.11.2. I would recommend other toolkits and applications that use shm buffers to make the same changes as I did in Qt, it can make a really noticeable difference."
More details for those interested via Xaver's blog .