From: Marek Olšák Date: Wed, 27 Sep 2017 14:53:26 +0000 (+0200) Subject: st/dri: don't expose modifiers in EGL if the driver doesn't implement them X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a65db0ad1c3ace58fbc81b6860e28c0a7645257c;p=mesa.git 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 --- 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; + } } }