forked from enlightenment/enlightenment
e - wl dmabuf - handle versioning for modifiers
this syncs with what weston does in handling versioning for modifiers.
This commit is contained in:
parent
f8bda510a7
commit
c7d0d6e6c9
|
@ -40,6 +40,10 @@
|
||||||
|
|
||||||
#include "linux-dmabuf-unstable-v1-server-protocol.h"
|
#include "linux-dmabuf-unstable-v1-server-protocol.h"
|
||||||
|
|
||||||
|
#ifndef DRM_FORMAT_MOD_LINEAR
|
||||||
|
# define DRM_FORMAT_MOD_LINEAR 0
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
linux_dmabuf_buffer_destroy(struct linux_dmabuf_buffer *buffer)
|
linux_dmabuf_buffer_destroy(struct linux_dmabuf_buffer *buffer)
|
||||||
{
|
{
|
||||||
|
@ -117,7 +121,10 @@ params_add(struct wl_client *client,
|
||||||
buffer->attributes.fd[plane_idx] = name_fd;
|
buffer->attributes.fd[plane_idx] = name_fd;
|
||||||
buffer->attributes.offset[plane_idx] = offset;
|
buffer->attributes.offset[plane_idx] = offset;
|
||||||
buffer->attributes.stride[plane_idx] = stride;
|
buffer->attributes.stride[plane_idx] = stride;
|
||||||
buffer->attributes.modifier[plane_idx] = ((uint64_t)modifier_hi << 32) |
|
if (wl_resource_get_version(params_resource) < ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION)
|
||||||
|
buffer->attributes.modifier[plane_idx] = DRM_FORMAT_MOD_INVALID;
|
||||||
|
else
|
||||||
|
buffer->attributes.modifier[plane_idx] = ((uint64_t)modifier_hi << 32) |
|
||||||
modifier_lo;
|
modifier_lo;
|
||||||
buffer->attributes.n_planes++;
|
buffer->attributes.n_planes++;
|
||||||
}
|
}
|
||||||
|
@ -512,11 +519,17 @@ bind_linux_dmabuf(struct wl_client *client,
|
||||||
modifiers = &modifier_invalid;
|
modifiers = &modifier_invalid;
|
||||||
}
|
}
|
||||||
for (j = 0; j < num_modifiers; j++) {
|
for (j = 0; j < num_modifiers; j++) {
|
||||||
uint32_t modifier_lo = modifiers[j] & 0xFFFFFFFF;
|
if (version >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) {
|
||||||
uint32_t modifier_hi = modifiers[j] >> 32;
|
uint32_t modifier_lo = modifiers[j] & 0xFFFFFFFF;
|
||||||
zwp_linux_dmabuf_v1_send_modifier(resource, formats[i],
|
uint32_t modifier_hi = modifiers[j] >> 32;
|
||||||
modifier_hi,
|
zwp_linux_dmabuf_v1_send_modifier(resource, formats[i],
|
||||||
modifier_lo);
|
modifier_hi,
|
||||||
|
modifier_lo);
|
||||||
|
} else if (modifiers[j] == DRM_FORMAT_MOD_LINEAR ||
|
||||||
|
modifiers == &modifier_invalid) {
|
||||||
|
zwp_linux_dmabuf_v1_send_format(resource,
|
||||||
|
formats[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (modifiers != &modifier_invalid)
|
if (modifiers != &modifier_invalid)
|
||||||
free(modifiers);
|
free(modifiers);
|
||||||
|
|
Loading…
Reference in New Issue