wayland::serv..._feedback_v1_t(3)

✨ NAME ✨

okay so bestie, this is the wayland::server::zwp_linux_dmabuf_feedback_v1_t(3) page from the Wayland++ manual β€” and it's literally all about dmabuf feedback πŸ’…


🌸 SYNOPSIS 🌸

#include <wayland-server-protocol-unstable.hpp>

πŸ’– Public Member Functions πŸ’–

  • std::function< void()> & on_destroy () β€” destroys the feedback object ✨
  • void done (bool post=true) β€” all the feedback has been sent, periodt
  • void format_table (int fd, uint32_t size, bool post=true) β€” the format and modifier table πŸŽ€
  • void main_device (array_t const &device, bool post=true) β€” the preferred main device πŸ‘‘
  • void tranche_done (bool post=true) β€” a preference tranche has been sent, slay
  • void tranche_target_device (array_t const &device, bool post=true) β€” the target device πŸ¦‹
  • void tranche_formats (array_t const &indices, bool post=true) β€” supported buffer format modifier 🌸
  • void tranche_flags (zwp_linux_dmabuf_feedback_v1_tranche_flags const &flags, bool post=true) β€” tranche flags ⭐
  • bool proxy_has_object () const β€” check whether this wrapper actually wraps an object πŸ‘€
  • void post_no_memory () const β€” no blurb on this one, it's just here 🫢
  • uint32_t get_id () const β€” same, no blurb in the source, just vibes πŸ’€
  • client_t get_client () const β€” also no blurb, it's giving mystery
  • unsigned int get_version () const β€” no blurb again, sorry bestie 😭
  • std::string get_class () β€” no blurb, but it's iconic

πŸ’œ Static Public Attributes πŸ’œ

  • static constexpr std::uint32_t done_since_version = 1 β€” minimum protocol version required for the done function ✨
  • static constexpr std::uint32_t format_table_since_version = 1 β€” minimum protocol version required for the format_table function πŸ’…
  • static constexpr std::uint32_t main_device_since_version = 1 β€” minimum protocol version required for the main_device function πŸŽ€
  • static constexpr std::uint32_t tranche_done_since_version = 1 β€” minimum protocol version required for the tranche_done function 🌸
  • static constexpr std::uint32_t tranche_target_device_since_version = 1 β€” minimum protocol version required for the tranche_target_device function πŸ¦‹
  • static constexpr std::uint32_t tranche_formats_since_version = 1 β€” minimum protocol version required for the tranche_formats function ⭐
  • static constexpr std::uint32_t tranche_flags_since_version = 1 β€” minimum protocol version required for the tranche_flags function πŸ”₯

πŸ’… Detailed Description πŸ’…

dmabuf feedback β€” that's the whole vibe πŸ’–

This object advertises dmabuf parameters feedback, bestie. That includes the preferred devices and the supported formats/modifiers πŸ‘‘

The parameters are sent once when this object is created, and again whenever they change. The done event is always sent once after all the parameters have been sent. And when a single parameter changes, all parameters are re-sent by the compositor. no cap, that's the rule 🌈

Compositors can re-send the parameters when the current client buffer allocations are sub-optimal. But β€” and this is important β€” compositors should not re-send the parameters if re-allocating the buffers would not result in a more optimal configuration. In particular, compositors should avoid sending the exact same parameters multiple times in a row. like, please don't spam the exact same thing, it's not cute πŸ™ˆ

The tranche_target_device and tranche_modifier events are grouped by tranches of preference. For each tranche, a tranche_target_device, one tranche_flags and one or more tranche_modifier events are sent, followed by a tranche_done event finishing the list. The tranches are sent in descending order of preference. All formats and modifiers in the same tranche have the same preference. iykyk πŸ’«

To send parameters, the compositor sends one main_device event, tranches (each consisting of one tranche_target_device event, one tranche_flags event, tranche_modifier events and then a tranche_done event), then one done event. slay, that's the whole sequence 🌟

Definition at line 2097 of file wayland-server-protocol-unstable.hpp.


πŸ’– Member Function Documentation πŸ’–

okay bestie, this is the good part β€” every single member function, in order, no skips, no cap ✨


done

void zwp_linux_dmabuf_feedback_v1_t::done (bool post = true)

all feedback has been sent β€” this event fires after all the parameters of a wp_linux_dmabuf_feedback object have been sent πŸŽ€

the whole point is atomicity: it lets changes to the wp_linux_dmabuf_feedback parameters be seen as atomic, even if those changes happen across multiple events. so like, the client gets one clean snapshot instead of a half-updated vibe πŸ’…

defined at line 5130 of file wayland-server-protocol-unstable.cpp

format_table

void zwp_linux_dmabuf_feedback_v1_t::format_table (int fd, uint32_t size,
    bool post = true)

format and modifier table πŸ¦‹

parameters, iconically:

  • fd β€” table file descriptor
  • size β€” table size, in bytes

this event hands you a file descriptor which can be memory-mapped to access the format and modifier table, iykyk.

the table contains a tightly packed array of consecutive format + modifier pairs. each pair is 16 bytes wide. it contains a format as a 32-bit unsigned integer, followed by 4 bytes of unused padding, and a modifier as a 64-bit unsigned integer. the native endianness is used β€” don't come for me about byte order, that's just how it is ✨

the client must map the file descriptor in read-only private mode. periodt.

big warning energy: compositors are not allowed to mutate the table file contents once this event has been sent. instead, compositors must create a new, separate table file and re-send feedback parameters. (they are allowed to store duplicate format + modifier pairs in the table though, so duplicates are lowkey fine πŸ™ˆ)
defined at line 5135 of file wayland-server-protocol-unstable.cpp

get_class <small>[inherited]</small>

std::string wayland::server::resource_t::get_class ()

Retrieve the interface name (class) of a resource object. πŸ‘‘

returns: interface name of the resource object. that's it, that's the whole function, and honestly? slay.


get_client <small>[inherited]</small>

client_t wayland::server::resource_t::get_client () const

Get the associated client 🫢

returns: the client that owns the resource. main character identification, basically.


get_id <small>[inherited]</small>

uint32_t wayland::server::resource_t::get_id () const

Get the internal ID of the resource πŸŽ€

returns: the internal ID of the resource.


get_version <small>[inherited]</small>

unsigned int wayland::server::resource_t::get_version () const

Get interface version ⭐

returns: interface version this resource has been constructed with.


main_device

void zwp_linux_dmabuf_feedback_v1_t::main_device (array_t const & device,
    bool post = true)

preferred main device πŸ‘‘

parameter:

  • device β€” device dev_t value

okay so this event advertises the main device that the server prefers to use when direct scan-out to the target device isn't possible. the advertised main device may be different for each wp_linux_dmabuf_feedback object, and may change over time πŸ’«

there is exactly one main device. the compositor must send at least one preference tranche with tranche_target_device equal to main_device.

clients need to create buffers that the main device can import and read from, otherwise creating the dmabuf wl_buffer will fail (see the wp_linux_buffer_params.create and create_immed requests for details). the main device will also likely be kept active by the compositor, so clients can use it instead of waking up another device for power savings β€” efficiency, we love her πŸ”₯

in general the device is a DRM node. the DRM node type (primary vs. render) is unspecified. clients must not rely on the compositor sending a particular node type. clients cannot check two devices for equality by comparing the dev_t value β€” nope, do not try it πŸ’€

if explicit modifiers are not supported and the client performs buffer allocations on a different device than the main device, then the client must force the buffer to have a linear layout. non-negotiable.

defined at line 5140 of file wayland-server-protocol-unstable.cpp

on_destroy

std::function< void()> & zwp_linux_dmabuf_feedback_v1_t::on_destroy ()

destroy the feedback object 🌸 β€” using this request a client can tell the server that it is not going to use the wp_linux_dmabuf_feedback object anymore. it's giving closure.

defined at line 5124 of file wayland-server-protocol-unstable.cpp

post_no_memory <small>[inherited]</small>

void wayland::server::resource_t::post_no_memory () const

Post "not enough memory" error to the client 😭

if the compositor has not enough memory to fulfill a certain request of the client, this function can be called to notify the client of this circumstance. it's the "bestie i'm broke" of syscalls.


proxy_has_object <small>[inherited]</small>

bool wayland::server::resource_t::proxy_has_object () const

Check whether this wrapper actually wraps an object. πŸ¦‹

returns: true if there is an underlying object, false if this wrapper is empty. vibe check for wrappers.


tranche_done

void zwp_linux_dmabuf_feedback_v1_t::tranche_done (bool post = true)

a preference tranche has been sent ✨ β€” this event splits tranche_target_device and tranche_modifier events into preference tranches. it is sent after a set of tranche_target_device and tranche_modifier events; it represents the end of a tranche. the next tranche will have a lower preference. so like, ranking order, most-favoured first πŸ’…

defined at line 5145 of file wayland-server-protocol-unstable.cpp

tranche_flags

void zwp_linux_dmabuf_feedback_v1_t::tranche_flags
    (zwp_linux_dmabuf_feedback_v1_tranche_flags const & flags, bool post =
    true)

tranche flags πŸŽ€

parameter:

  • flags β€” tranche flags

this event sets tranche-specific flags.

the scanout flag is a hint that direct scan-out may be attempted by the compositor on the target device if the client appropriately allocates a buffer. how to allocate a buffer that can be scanned out on the target device is implementation-defined β€” so no, there's no universal recipe, sorry babe πŸ™ˆ

this event is tied to a preference tranche, see the tranche_done event.

defined at line 5160 of file wayland-server-protocol-unstable.cpp

tranche_formats

void zwp_linux_dmabuf_feedback_v1_t::tranche_formats (array_t const &
    indices, bool post = true)

supported buffer format modifier 🌈

parameter:

  • indices β€” array of 16-bit indexes

this event advertises the format + modifier combinations that the compositor supports. ate.

it carries an array of indices, each referring to a format + modifier pair in the last received format table (see the format_table event). each index is a 16-bit unsigned integer in native endianness.

for legacy support, DRM_FORMAT_MOD_INVALID is an allowed modifier. it indicates that the server can support the format with an implicit modifier. when a buffer has DRM_FORMAT_MOD_INVALID as its modifier, it is as if no explicit modifier is specified. the effective modifier will be derived from the dmabuf.

a compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for a given format supports both explicit modifiers and implicit modifiers.

rule: compositors must not send duplicate format + modifier pairs within the same tranche or across two different tranches with the same target device and flags. just don't πŸ’€

this event is tied to a preference tranche, see the tranche_done event.

for the definition of the format and modifier codes, see the wp_linux_buffer_params.create request.

defined at line 5155 of file wayland-server-protocol-unstable.cpp

tranche_target_device

void zwp_linux_dmabuf_feedback_v1_t::tranche_target_device (array_t const &
    device, bool post = true)

target device πŸ¦‹

parameter:

  • device β€” device dev_t value

this event advertises the target device that the server prefers to use for a buffer created given this tranche. the advertised target device may be different for each preference tranche, and may change over time β€” she's fluid like that ✨

there is exactly one target device per tranche.

the target device may be a scan-out device, for example if the compositor prefers to directly scan-out a buffer created given this tranche. the target device may be a rendering device, for example if the compositor prefers to texture from said buffer.

the client can use this hint to allocate the buffer in a way that makes it accessible from the target device, ideally directly. the buffer must still be accessible from the main device, either through direct import or through a potentially more expensive fallback path. if the buffer can't be directly imported from the main device then clients must be prepared for the compositor changing the tranche priority or making wl_buffer creation fail (see the wp_linux_buffer_params.create and create_immed requests for details). so like, always have a plan b πŸ’…

if the device is a DRM node, the DRM node type (primary vs. render) is unspecified. clients must not rely on the compositor sending a particular node type. clients cannot check two devices for equality by comparing the dev_t value.

this event is tied to a preference tranche, see the tranche_done event.

defined at line 5150 of file wayland-server-protocol-unstable.cpp

πŸŽ€ Member Data Documentation πŸŽ€

all of these are std::uint32_t, all [static], all [constexpr], and every single one of them equals 1 β€” consistency is iconic πŸ‘‘

  • wayland::server::zwp_linux_dmabuf_feedback_v1_t::done_since_version = 1 β€” minimum protocol version required for the done function. defined at line 2144 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_linux_dmabuf_feedback_v1_t::format_table_since_version = 1 β€” minimum protocol version required for the format_table function. defined at line 2170 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_linux_dmabuf_feedback_v1_t::main_device_since_version = 1 β€” minimum protocol version required for the main_device function. defined at line 2204 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_linux_dmabuf_feedback_v1_t::tranche_done_since_version = 1 β€” minimum protocol version required for the tranche_done function. defined at line 2218 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_linux_dmabuf_feedback_v1_t::tranche_flags_since_version = 1 β€” minimum protocol version required for the tranche_flags function. defined at line 2309 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_linux_dmabuf_feedback_v1_t::tranche_formats_since_version = 1 β€” minimum protocol version required for the tranche_formats function. defined at line 2290 of file wayland-server-protocol-unstable.hpp.
  • wayland::server::zwp_linux_dmabuf_feedback_v1_t::tranche_target_device_since_version = 1 β€” minimum protocol version required for the tranche_target_device function. defined at line 2255 of file wayland-server-protocol-unstable.hpp.

🫢 Author 🫢

generated automatically by Doxygen for Wayland++ from the source code. not a human, not a vibe, just a robot doing its best 🧚


and that's the whole page bestie, you made it to the end πŸŽ‰ this was Version 1.0.1, dated Fri Mar 27 2026 β€” go forth and allocate those buffers responsibly, mwah πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from