Mesa EGL X11/Wayland Code Receives Optimization For Multi-GPU/PRIME Systems


Code merged last week to Mesa 23.1 by AMD ensures that a linear copy buffer is made on the display/scanout GPU when dealing with EGL contexts under Wayland or X11. This follows an optimization made last year to Mesa’s GLX code within X.Org environments for enhancing the PRIME/multi-GPU support.

Last year saw a Mesa GLX change to ensure that a linear buffer is allocated on the display/scanout GPU rather than of the render GPU in PRIME/multi-GPU configurations. This is for optimizing peer-to-peer DMA usage between multiple GPUs. In non-optimal configurations where the linear buffer for scanout is allocated by the render GPU, it can’t be moved to the video memory of the scanout GPU without an extra copy. With the prior change to GLX and now in place for EGL, it’s ensured that the linear buffer is allocated on the scanout GPU and then accessed by the render GPU to avoid the overhead/cost of the extra kernel copy.

This merge request by AMD engineer Yogesh Mohan Marmithu had been opened last year for this change to ensure the allocation happens on the scanout GPU. Finally last week it crossed the finish line with entering Mesa 23.1. The change affects Mesa’s common platform/EGL code and thus not tied to one particular (AMD) GPU driver in this case.