Skip to content

Commit aad8643

Browse files
committed
wayland/dma-buf: Don't advertise modifier support by default
Advertising support for modifiers means we will most likely not not be able to scan out client buffers directly, meaning it just as likely that we won't be able to scan out even fullscreen windows without atomic KMS. When we have atomic support, we should advertise support for modifiers if atomic is used to drive the CRTCs, as we by then can check whether we can scan out directly, place in an overlay plane, etc. Original Mutter commit: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/798/diffs?commit_id=cb05b164140dc6934ff5a00cb4354a5dbf4593ef
1 parent 49fe73a commit aad8643

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/wayland/meta-wayland-dma-buf.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,15 @@ static const struct zwp_linux_dmabuf_v1_interface dma_buf_implementation =
460460
dma_buf_handle_create_buffer_params,
461461
};
462462

463+
static gboolean
464+
should_send_modifiers (MetaBackend *backend)
465+
{
466+
MetaSettings *settings = meta_backend_get_settings (backend);
467+
468+
return meta_settings_is_experimental_feature_enabled (
469+
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS);
470+
}
471+
463472
static void
464473
send_modifiers (struct wl_resource *resource,
465474
uint32_t format)
@@ -482,6 +491,14 @@ send_modifiers (struct wl_resource *resource,
482491
if (wl_resource_get_version (resource) < ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION)
483492
return;
484493

494+
if (!should_send_modifiers (backend))
495+
{
496+
zwp_linux_dmabuf_v1_send_modifier (resource, format,
497+
DRM_FORMAT_MOD_INVALID >> 32,
498+
DRM_FORMAT_MOD_INVALID & 0xffffffff);
499+
return;
500+
}
501+
485502
/* First query the number of available modifiers, then allocate an array,
486503
* then fill the array. */
487504
ret = meta_egl_query_dma_buf_modifiers (egl, egl_display, format, 0, NULL,

0 commit comments

Comments
 (0)