Product SiteDocumentation Site

A.6. wl_shm - shared memory support

A global singleton object that provides support for shared memory.
Clients can create wl_shm_pool objects using the create_pool request.
At connection setup time, the wl_shm object emits one or more format events to inform clients about the valid pixel formats that can be used for buffers.

A.6.1. Requests provided by wl_shm

A.6.1.1. wl_shm::create_pool - create a shm pool

Create a new wl_shm_pool object.
The pool can be used to create shared memory based buffer objects. The server will mmap size bytes of the passed file descriptor, to use as backing memory for the pool.
wl_shm::create_pool arguments
id
Type: new_id
fd
Type: fd
size
Type: int

A.6.2. Events provided by wl_shm

A.6.2.1. wl_shm::format - pixel format description

Informs the client about a valid pixel format that can be used for buffers. Known formats include argb8888 and xrgb8888.
wl_shm::format arguments
format
Type: uint

A.6.3. Enums provided by wl_shm

A.6.3.1. wl_shm::error - wl_shm error values

These errors can be emitted in response to wl_shm requests.
wl_shm::error values
invalid_format
Value: 0
buffer format is not known
invalid_stride
Value: 1
invalid size or stride during pool or buffer creation
invalid_fd
Value: 2
mmapping the file descriptor failed

A.6.3.2. wl_shm::format - pixel formats

This describes the memory layout of an individual pixel.
All renderers should support argb8888 and xrgb8888 but any other formats are optional and may not be supported by the particular renderer in use.
wl_shm::format values
argb8888
Value: 0
32-bit ARGB format
xrgb8888
Value: 1
32-bit RGB format
c8
Value: 0x20203843
rgb332
Value: 0x38424752
bgr233
Value: 0x38524742
xrgb4444
Value: 0x32315258
xbgr4444
Value: 0x32314258
rgbx4444
Value: 0x32315852
bgrx4444
Value: 0x32315842
argb4444
Value: 0x32315241
abgr4444
Value: 0x32314241
rgba4444
Value: 0x32314152
bgra4444
Value: 0x32314142
xrgb1555
Value: 0x35315258
xbgr1555
Value: 0x35314258
rgbx5551
Value: 0x35315852
bgrx5551
Value: 0x35315842
argb1555
Value: 0x35315241
abgr1555
Value: 0x35314241
rgba5551
Value: 0x35314152
bgra5551
Value: 0x35314142
rgb565
Value: 0x36314752
bgr565
Value: 0x36314742
rgb888
Value: 0x34324752
bgr888
Value: 0x34324742
xbgr8888
Value: 0x34324258
rgbx8888
Value: 0x34325852
bgrx8888
Value: 0x34325842
abgr8888
Value: 0x34324241
rgba8888
Value: 0x34324152
bgra8888
Value: 0x34324142
xrgb2101010
Value: 0x30335258
xbgr2101010
Value: 0x30334258
rgbx1010102
Value: 0x30335852
bgrx1010102
Value: 0x30335842
argb2101010
Value: 0x30335241
abgr2101010
Value: 0x30334241
rgba1010102
Value: 0x30334152
bgra1010102
Value: 0x30334142
yuyv
Value: 0x56595559
yvyu
Value: 0x55595659
uyvy
Value: 0x59565955
vyuy
Value: 0x59555956
ayuv
Value: 0x56555941
nv12
Value: 0x3231564e
nv21
Value: 0x3132564e
nv16
Value: 0x3631564e
nv61
Value: 0x3136564e
yuv410
Value: 0x39565559
yvu410
Value: 0x39555659
yuv411
Value: 0x31315559
yvu411
Value: 0x31315659
yuv420
Value: 0x32315559
yvu420
Value: 0x32315659
yuv422
Value: 0x36315559
yvu422
Value: 0x36315659
yuv444
Value: 0x34325559
yvu444
Value: 0x34325659