Skip to main content

Module control

Module control 

Source
Expand description

Messages on the control channel between an app and its render service.

The channel is small and ordered: frames themselves travel through the ring (shm), and the control channel says where (“frame N is at offset O”) and what became of them (“frame N is in buffer B”, “frame N was dropped, because …”, “frame N was presented at T”). Descriptors ride along where a message names one: the ring with the hello, an image’s memfd with its registration, the render buffers with their announcement.

Messages are postcard-encoded; one message is one SOCK_SEQPACKET packet.

Structs§

DmabufFormat
A buffer format both the compositor and the app’s surface take: a DRM fourcc and modifier, as the compositor advertised them to the app.
Plane
One buffer of a surface: the layout of its single plane.
Renderer
The device a render service draws on, in wgpu’s words (AdapterInfo’s name, device type, backend and driver, as Debug prints the enums).

Enums§

AlphaType
How an uploaded image’s alpha is encoded.
AppMessage
What an app sends.
BufferKind
Where a buffer’s pixels live.
ImageFormat
Pixel layout of an uploaded image.
Refusal
Why a frame or a request was not served.
ServiceMessage
What the service sends.

Constants§

MAX_FONT_PATH
Longest font path an app may name.
MAX_MESSAGE_BYTES
Largest encoded message either side sends or accepts.
MAX_MESSAGE_FDS
Most descriptors one message carries.

Functions§

decode
Decode a message from the channel.
encode