Go to index / Go to protocols

weston_restricted_buffer ↗

weston_restricted_buffer
weston_restricted_buffer_v1

Version 1

weston restricted buffer

Weston extension to instruct the compositor that the dmabuf created by 'linux-dmabuf' protocol is in protected memory. Protected has hardware level access restrictions, and if used improperly will result in compositor crashes, hardware faults, or other manner of undefined behaviour.

Restricted buffers may only be imported to the GPU if the GPU is using a restricted context - otherwise if the buffer is to be rendered, it will be censored (displayed as a solid color).

Outside of GPU restrictions, the compositor's policy dictates when restricted buffers may be displayed.

This extension depends on the 'linux-dmabuf' protocol. After a 'zwp_linux_buffer_params_v1' object is created by 'zwp_linux_buffer_v1' and before it is used to create a buffer, this extension's 'enable' request may be used to indicate that the buffer is restricted.

weston_restricted_buffer_v1
enum error {
    params_already_used = 0,
    already_set = 1,
}
  • params_already_used — dmabuf params already used
  • already_set — restricted already set
weston_restricted_buffer_v1
request enable(
    dmabuf: object<zwp_linux_buffer_params_v1>,
)
  • dmabuf — enable restricted handling of dmabuf

Flag the buffer as restricted

This request tells the compositor that the buffer is restricted.

Even if the GPU is not using a restricted context and the dmabuf can't be scanned out directly, the compositor should censor it with a placeholder instead of refusing to create the wl_buffer.

Assumes that 'zwp_linux_buffer_params_v1' was already created by 'zwp_linux_dmabuf_v1_create_params', as stated in 'weston_restricted_buffer_v1' interface description.

weston_restricted_buffer_v1
request destroy()
Destructor

    destroy factory object

    Destroys the factory object, but does not affect any other objects.