wayland/dma-buf: Always advertise non-modifier fallback
This is done to explicitly tell clients that the compositor supports implicit modifier paths (i.e. using modifier unaware API). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1959>
This commit is contained in:
parent
7acecb1c72
commit
2a16a750c5
@ -868,12 +868,18 @@ should_send_modifiers (MetaBackend *backend)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
send_modifiers (struct wl_resource *resource,
|
send_modifiers (struct wl_resource *resource,
|
||||||
MetaWaylandDmaBufFormat *format)
|
MetaWaylandDmaBufFormat *format,
|
||||||
|
GHashTable *sent_formats)
|
||||||
{
|
{
|
||||||
g_assert (wl_resource_get_version (resource) <
|
g_assert (wl_resource_get_version (resource) <
|
||||||
ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION);
|
ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION);
|
||||||
|
|
||||||
zwp_linux_dmabuf_v1_send_format (resource, format->drm_format);
|
if (!g_hash_table_contains (sent_formats,
|
||||||
|
GUINT_TO_POINTER (format->drm_format)))
|
||||||
|
{
|
||||||
|
g_hash_table_add (sent_formats, GUINT_TO_POINTER (format->drm_format));
|
||||||
|
zwp_linux_dmabuf_v1_send_format (resource, format->drm_format);
|
||||||
|
}
|
||||||
|
|
||||||
if (wl_resource_get_version (resource) <
|
if (wl_resource_get_version (resource) <
|
||||||
ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION)
|
ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION)
|
||||||
@ -901,8 +907,11 @@ dma_buf_bind (struct wl_client *client,
|
|||||||
|
|
||||||
if (version < ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION)
|
if (version < ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION)
|
||||||
{
|
{
|
||||||
|
g_autoptr (GHashTable) sent_formats = NULL;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
sent_formats = g_hash_table_new (NULL, NULL);
|
||||||
|
|
||||||
for (i = 0; i < dma_buf_manager->formats->len; i++)
|
for (i = 0; i < dma_buf_manager->formats->len; i++)
|
||||||
{
|
{
|
||||||
MetaWaylandDmaBufFormat *format =
|
MetaWaylandDmaBufFormat *format =
|
||||||
@ -910,7 +919,7 @@ dma_buf_bind (struct wl_client *client,
|
|||||||
MetaWaylandDmaBufFormat,
|
MetaWaylandDmaBufFormat,
|
||||||
i);
|
i);
|
||||||
|
|
||||||
send_modifiers (resource, format);
|
send_modifiers (resource, format, sent_formats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -961,8 +970,6 @@ add_format (MetaWaylandDmaBufManager *dma_buf_manager,
|
|||||||
g_array_append_val (dma_buf_manager->formats, format);
|
g_array_append_val (dma_buf_manager->formats, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
add_fallback:
|
add_fallback:
|
||||||
format = (MetaWaylandDmaBufFormat) {
|
format = (MetaWaylandDmaBufFormat) {
|
||||||
.drm_format = drm_format,
|
.drm_format = drm_format,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user