Compare commits

...

2 Commits

Author SHA1 Message Date
Alexandros Frantzis
7c0ae37453 Merge branch 'linux-dmabuf-v3-format-events' into 'main'
linux-dmabuf: Send format events for protocol version 3

See merge request wayland/weston!893
2024-06-22 15:30:14 +00:00
Alexandros Frantzis
f2d2313693 linux-dmabuf: Send format events for protocol version 3
The linux-dmabuf-unstable-v1 specification does not deprecate "format"
events in version 3 of the protocol. Therefore the compositor must send
both "format" and "modifier" events if version 3 is bound.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2022-06-03 11:51:41 +03:00

View File

@ -1064,6 +1064,12 @@ bind_linux_dmabuf(struct wl_client *client,
wl_array_for_each(fmt, &supported_formats->arr) {
modifiers = weston_drm_format_get_modifiers(fmt, &num_modifiers);
for (i = 0; i < num_modifiers; i++) {
if (modifiers[i] == DRM_FORMAT_MOD_LINEAR ||
modifiers[i] == DRM_FORMAT_MOD_INVALID) {
zwp_linux_dmabuf_v1_send_format(resource,
fmt->format);
}
if (version >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) {
uint32_t modifier_lo = modifiers[i] & 0xFFFFFFFF;
uint32_t modifier_hi = modifiers[i] >> 32;
@ -1071,10 +1077,6 @@ bind_linux_dmabuf(struct wl_client *client,
fmt->format,
modifier_hi,
modifier_lo);
} else if (modifiers[i] == DRM_FORMAT_MOD_LINEAR ||
modifiers[i] == DRM_FORMAT_MOD_INVALID) {
zwp_linux_dmabuf_v1_send_format(resource,
fmt->format);
}
}
}