From a65db0ad1c3ace58fbc81b6860e28c0a7645257c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 27 Sep 2017 16:53:26 +0200 Subject: [PATCH] st/dri: don't expose modifiers in EGL if the driver doesn't implement them This unbreaks waffle/gbm (piglit/gbm) which fails initialization. v2: also don't set queryDmaBufFormats Reviewed-by: Daniel Stone --- src/gallium/state_trackers/dri/dri2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index 1e8bb481044..86721747878 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -1996,9 +1996,11 @@ dri2_init_screen(__DRIscreen * sPriv) dri2ImageExtension.createImageFromFds = dri2_from_fds; dri2ImageExtension.createImageFromDmaBufs = dri2_from_dma_bufs; dri2ImageExtension.createImageFromDmaBufs2 = dri2_from_dma_bufs2; - dri2ImageExtension.queryDmaBufFormats = dri2_query_dma_buf_formats; - dri2ImageExtension.queryDmaBufModifiers = - dri2_query_dma_buf_modifiers; + if (pscreen->query_dmabuf_modifiers) { + dri2ImageExtension.queryDmaBufFormats = dri2_query_dma_buf_formats; + dri2ImageExtension.queryDmaBufModifiers = + dri2_query_dma_buf_modifiers; + } } } -- 2.30.2