回复:Re: bo flags isn't passed through wayland-drm protocl, how weston respect these flags?
HalleyZhao
halleyzhao at sina.com
Fri Aug 9 09:32:49 UTC 2019
some buffer attributes may influence how weston use it, for example: tiling mode, Swizzling, compression.weston may depend on these attribute to decide to assign the buffer to a hw plane or composite it as texture.
--------------------------------
----- 原始邮件 -----
发件人:Pekka Paalanen <ppaalanen at gmail.com>
收件人:"HalleyZhao" <halleyzhao at sina.com>
抄送人:"wayland-devel" <wayland-devel at lists.freedesktop.org>
主题:Re: bo flags isn't passed through wayland-drm protocl, how weston respect these flags?
日期:2019年08月06日 15点57分
On Tue, 06 Aug 2019 09:03:51 +0800
"HalleyZhao" <halleyzhao at sina.com> 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>
> --------------------------------
>
Hi,
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.
Thanks,
pq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20190809/ea56841c/attachment.html>
More information about the wayland-devel
mailing list