summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel van Vugt <daniel.van.vugt@canonical.com>2021-03-23 11:59:59 +0800
committerMarge Bot <marge-bot@gnome.org>2021-03-23 16:40:40 +0000
commit3555f65b75b5fb5b948e9f92b0238827ae26d487 (patch)
treeed6cecd2d33e228059525ae6b80165ccf770df6c
parentdc74d4d429acb951e1074e44777a5fe353dc7f40 (diff)
downloadmutter-3555f65b75b5fb5b948e9f92b0238827ae26d487.tar.gz
wayland-dma-buf: Add support for DRM_FORMAT_ABGR2101010
It seems to be the preferred format of the Mesa V3D driver on Raspberry Pi 4. If the compositor doesn't advertise it then Mesa will fallback from `zwp_linux_dmabuf_v1` to `wl_drm`, incorrectly. Meaning it will keep using a buffer with modifiers on an interface that does not have modifiers. Add support for `DRM_FORMAT_ABGR2101010`. It works, and prevents Mesa from taking its broken fallback path. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1520 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1798>
-rw-r--r--src/wayland/meta-wayland-dma-buf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 5b00a5f66..ce8983741 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -124,6 +124,9 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
case DRM_FORMAT_ARGB2101010:
cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010_PRE;
break;
+ case DRM_FORMAT_ABGR2101010:
+ cogl_format = COGL_PIXEL_FORMAT_ABGR_2101010_PRE;
+ break;
case DRM_FORMAT_RGB565:
cogl_format = COGL_PIXEL_FORMAT_RGB_565;
break;
@@ -701,6 +704,7 @@ dma_buf_bind (struct wl_client *client,
send_modifiers (resource, DRM_FORMAT_ARGB8888);
send_modifiers (resource, DRM_FORMAT_XRGB8888);
send_modifiers (resource, DRM_FORMAT_ARGB2101010);
+ send_modifiers (resource, DRM_FORMAT_ABGR2101010);
send_modifiers (resource, DRM_FORMAT_XRGB2101010);
send_modifiers (resource, DRM_FORMAT_RGB565);
send_modifiers (resource, DRM_FORMAT_ABGR16161616F);