[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH] glamor: sanitze handling of "Debug" Option for "dmabuf_capable"
From:       Tobias Klausmann <tobias.johannes.klausmann () mni ! thm ! de>
Date:       2018-03-30 20:31:46
Message-ID: 20180330203146.7009-1-tobias.johannes.klausmann () mni ! thm ! de
[Download RAW message or body]

With the appearance of the this new Option the X Server would crash if the
option is not set.

Default dmabuf_capable to off/FALSE for now - a user without knowledge about
this option does not want to enable it until its save.

Fixes: d11d5bb80 ("glamor: Hide new DRI behind Option "Debug" "dmabuf_capable")
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
---
 glamor/glamor_egl.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 4a550932a..f82fa519b 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -960,9 +960,13 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
     if (epoxy_has_egl_extension(glamor_egl->display,
                                 "EGL_EXT_image_dma_buf_import") &&
         epoxy_has_egl_extension(glamor_egl->display,
-                                "EGL_EXT_image_dma_buf_import_modifiers"))
-        glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug,
-                                              "dmabuf_capable");
+                                "EGL_EXT_image_dma_buf_import_modifiers")) {
+       if (xf86Info.debug != NULL)
+           glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug,
+                                                "dmabuf_capable");
+        else
+            glamor_egl->dmabuf_capable = FALSE;
+    }
 #endif
 
     glamor_egl->saved_free_screen = scrn->FreeScreen;
-- 
2.16.2

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic