st/dri: don't set queryDmaBufFormats/queryDmaBufModifiers if the driver does not...
authorMichal Srb <msrb@suse.com>
Thu, 15 Mar 2018 16:27:57 +0000 (17:27 +0100)
committerAdam Jackson <ajax@redhat.com>
Wed, 19 Sep 2018 19:20:04 +0000 (15:20 -0400)
This is equivalent to commit a65db0ad1c3, but for dri_kms_init_screen. Without
this gbm_dri_is_format_supported always returns false.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104926
Fixes: e14fe41e0bf ("st/dri: implement createImageFromRenderbuffer(2)")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Tested-by: Adam Williamson <adamwill@fedoraproject.org>
src/gallium/state_trackers/dri/dri2.c

index c8a484e3926125a4ad10129152c574eeafdd1bf9..2411a369c5d9c0eb3f42ceb71be14e12a9d9a67c 100644 (file)
@@ -2219,8 +2219,10 @@ dri_kms_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;
+      }
    }
 
    sPriv->extensions = dri_screen_extensions;