[mutter] wayland/dma-buf: Handle zero modifiers from eglQueryDmaBufModifiersEXT
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/dma-buf: Handle zero modifiers from eglQueryDmaBufModifiersEXT
- Date: Fri, 20 Sep 2019 12:32:35 +0000 (UTC)
commit 031003a5dc8b7f42588196735820028e3cdf2158
Author: Adam Jackson <ajax redhat com>
Date: Fri Sep 6 14:45:55 2019 -0400
wayland/dma-buf: Handle zero modifiers from eglQueryDmaBufModifiersEXT
Some drivers expose EGL_EXT_image_dma_buf_import_modifiers so you can
query supported formats, but don't support any modifiers. Handle this by
treating it like DRM_FORMAT_MOD_INVALID.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/782
src/wayland/meta-wayland-dma-buf.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index e672749e4..914e03a2f 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -461,9 +461,17 @@ send_modifiers (struct wl_resource *resource,
* then fill the array. */
ret = meta_egl_query_dma_buf_modifiers (egl, egl_display, format, 0, NULL,
NULL, &num_modifiers, NULL);
- if (!ret || num_modifiers == 0)
+ if (!ret)
return;
+ if (num_modifiers == 0)
+ {
+ zwp_linux_dmabuf_v1_send_modifier (resource, format,
+ DRM_FORMAT_MOD_INVALID >> 32,
+ DRM_FORMAT_MOD_INVALID & 0xffffffff);
+ return;
+ }
+
modifiers = g_new0 (uint64_t, num_modifiers);
ret = meta_egl_query_dma_buf_modifiers (egl, egl_display, format,
num_modifiers, modifiers, NULL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]