bo flags isn't passed through wayland-drm protocl, how weston respect these flags?

Pekka Paalanen ppaalanen at
Tue Aug 6 07:56:53 UTC 2019

On Tue, 06 Aug 2019 09:03:51 +0800
"HalleyZhao" <halleyzhao at> wrote:

> Hi experts:when we create buffer object at wayland client side, there are some usage flags, for example gbm_bo_flags.but when we pass these buffer fd to weston through wayland-drm protocl, these flags are ignored.then, how weston respect these flags when using the buffer object?thanks.
>     <!-- Create a wayland buffer for the prime fd.  Use for regular and planar         buffers.  Pass 0 for offset and stride for unused planes. -->    <request name="create_prime_buffer" since="2">      <arg name="id" type="new_id" interface="wl_buffer"/>      <arg name="name" type="fd"/>      <arg name="width" type="int"/>      <arg name="height" type="int"/>      <arg name="format" type="uint"/>      <arg name="offset0" type="int"/>      <arg name="stride0" type="int"/>      <arg name="offset1" type="int"/>      <arg name="stride1" type="int"/>      <arg name="offset2" type="int"/>      <arg name="stride2" type="int"/>    </request>
> --------------------------------


why should the compositor care about usage flags at all?

What are you thinking about here?

The buffer has already been allocated by the client. The primary
purpose of the usage flags is to guide the allocation, so the
compositor has no use for them.

Compositor's usage of the buffer on the other hand is implied by the
Wayland protocol. If you attach the wl_buffer to a wl_surface, then the
buffer will be used as a texture, possibly as a KMS FB, and maybe more
if it turns out suitable (Weston implements only the texture and KMS FB
cases). If you use the wl_buffer in some other Wayland interface, then
that other interface implies how it will be used.

Scott is also right.

gbm_bo_flags predate DRM format modifiers. gbm_bo_flags guide the GBM
implementation in choosing the modifier, and the modifier will be sent
to the Wayland compositor to describe the data layout of the buffer in
zwp_linux_dmabuf extension.

As you can see, gbm_bo_create_with_modifiers() does not take
gbm_bo_flags at all.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the wayland-devel mailing list