[Development] Using DMA instead of SHM in non OpenGL apps (Linux/Wayland)

Eduardo Hopperdietzel ehopperdietzel at gmail.com
Fri Aug 25 15:55:26 CEST 2023


Hi Giuseppe,

I initially believed there would be no distinction in performing R/W
operations on DMA or SHM maps. However, in a previous email, David
mentioned:




*> The relevant kwin expert, Xaver Hugl, stated in a chat:> "While the
overhead on the compositor side would be lower, rendering> into a dmabuf
with the CPU is pretty slow, especially on dedicated> GPUs and especially
with QPainter."*

Upon testing, I discovered that every R/W operation is not synchronized
with the backing storage or importers of the buffer, which would
potentially slow down QPainter operations. It appears there's a cache
memory where written data is temporarily stored for quick reading, and the
kernel subsystem schedules DMA transfers in a non-blocking manner. I
believe Xaver Hugl was referring to the performance being lower in terms of
transfers, as a fence mechanism is required to ensure the compositor
finishes importing the buffer into the GPU.

Best regards,
Eduardo Hopperdietzel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230825/da257178/attachment.htm>


More information about the Development mailing list