diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c index 8a9e4c57..56666ed3 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -2164,7 +2164,7 @@ gl_renderer_import_dmabuf(struct weston_compositor *ec, for (i = 0; i < dmabuf->attributes.n_planes; i++) { /* return if EGL doesn't support import modifiers */ - if (dmabuf->attributes.modifier[i] != 0) + if (dmabuf->attributes.modifier[i] != DRM_FORMAT_MOD_INVALID) if (!gr->has_dmabuf_import_modifiers) return false; diff --git a/libweston/linux-dmabuf.c b/libweston/linux-dmabuf.c index d81b63d5..59705845 100644 --- a/libweston/linux-dmabuf.c +++ b/libweston/linux-dmabuf.c @@ -111,8 +111,13 @@ params_add(struct wl_client *client, buffer->attributes.fd[plane_idx] = name_fd; buffer->attributes.offset[plane_idx] = offset; buffer->attributes.stride[plane_idx] = stride; - buffer->attributes.modifier[plane_idx] = ((uint64_t)modifier_hi << 32) | - modifier_lo; + + 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; + buffer->attributes.n_planes++; }