$linuxjunkies
>

wl_shm

also: wl_shm interface, Wayland shared memory protocol

wl_shm is a Wayland protocol interface that enables efficient sharing of memory buffers between clients and the compositor using shared memory segments.

wl_shm (Wayland shared memory) is a core Wayland protocol interface that allows graphical clients to allocate and share memory buffers with the display server without copying pixel data. Instead of sending rendered frames over a socket, clients map shared memory segments that both the client and compositor can access directly.

The interface handles buffer management through a pool of shared memory, where clients request pixel buffers of specific dimensions and formats. This approach is significantly faster than alternatives for simple 2D rendering and is commonly used by applications that don't have GPU acceleration available.

Example: A simple application without OpenGL support uses wl_shm to create a 1920×1080 ARGB buffer in shared memory, draws pixels directly into it, and signals to the compositor that the buffer is ready for display—all without copying the pixel data through the socket.

Related terms