mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-01 19:38:34 +00:00
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>
This commit is contained in:
parent
dfceb60274
commit
f2d2313693
|
@ -1049,6 +1049,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;
|
||||
|
@ -1056,10 +1062,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue