Mesa (18.2): st/dri: don't set queryDmaBufFormats/queryDmaBufModifiers if the driver does not implement it

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 3 12:42:50 UTC 2018


Module: Mesa
Branch: 18.2
Commit: 03ccb045b317925ab1c5ecec076ec029f358d90c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=03ccb045b317925ab1c5ecec076ec029f358d90c

Author: Michal Srb <msrb at suse.com>
Date:   Thu Mar 15 17:27:57 2018 +0100

st/dri: don't set queryDmaBufFormats/queryDmaBufModifiers if the driver does not implement it

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 at collabora.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Tested-by: Adam Williamson <adamwill at fedoraproject.org>
(cherry picked from commit 194bf0a2e01769f4b29df06febf27ce340c1cd68)

---

 src/gallium/state_trackers/dri/dri2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index c8a484e392..2411a369c5 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -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;




More information about the mesa-commit mailing list