[Mesa-dev] [PATCH 1/3] egl/wayland: Ignore invalid modifiers

Daniel Stone daniels at collabora.com
Fri Jul 21 13:34:12 UTC 2017


If the underlying driver does not support modifiers, dmabuf will still
advertise formats through the 'modifier' event, but send them with an
invalid modifier. Ignore them if this is the case, rather than passing
them through to the driver.

Signed-off-by: Daniel Stone <daniels at collabora.com>
Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers")
---
 src/egl/drivers/dri2/platform_wayland.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 211036f45f..7992717854 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -370,6 +370,9 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
       return -1;
    }
 
+   if (num_modifiers == 0)
+      modifiers = NULL;
+
    /* There might be a buffer release already queued that wasn't processed */
    wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_surf->wl_queue);
 
@@ -1069,6 +1072,10 @@ dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf,
    struct dri2_egl_display *dri2_dpy = data;
    uint64_t *mod = NULL;
 
+   if (modifier_hi == (DRM_FORMAT_MOD_INVALID >> 32) &&
+       modifier_lo == (DRM_FORMAT_MOD_INVALID & 0xffffffff))
+      return;
+
    switch (format) {
    case WL_DRM_FORMAT_ARGB8888:
       mod = u_vector_add(&dri2_dpy->wl_modifiers.argb8888);
-- 
2.13.2



More information about the mesa-dev mailing list