summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2017-07-21 12:05:17 +0100
committerDaniel Stone <[email protected]>2017-07-24 16:42:28 +0100
commitdd072cf4b131c8aa9e8be0ff24b70856fe39285e (patch)
tree7f8f637ecb2542616a52ca57a250b04aa864df98 /src/egl/drivers
parent986f9e50ded299802fc0ad63e5643f6df62c31ec (diff)
egl/wayland: Ignore invalid modifiers
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 <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers")
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index f4c09ac0bc1..ff35507d255 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1083,6 +1083,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);