From d10f8a98ec171791cd81de807e1c400af25b1e2b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 8 Apr 2020 14:57:20 +0200 Subject: [PATCH] render: only expose linux-dmabuf if EGL extension is supported Only expose linux-dmabuf extension if EGL_EXT_image_dmabuf_import_ext is supported. Closes: https://github.com/swaywm/wlroots/issues/2076 --- render/gles2/renderer.c | 10 ++++++++++ render/wlr_renderer.c | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index 523c5bd5..cba338a1 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "render/gles2.h" @@ -364,6 +365,15 @@ static bool gles2_init_wl_display(struct wlr_renderer *wlr_renderer, } else { wlr_log(WLR_INFO, "EGL_WL_bind_wayland_display is not supported"); } + + if (renderer->egl->exts.image_dmabuf_import_ext) { + if (wlr_linux_dmabuf_v1_create(wl_display, wlr_renderer) == NULL) { + return false; + } + } else { + wlr_log(WLR_INFO, "EGL_EXT_image_dma_buf_import is not supported"); + } + return true; } diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index b12f4b3a..9a126706 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include "util/signal.h" @@ -182,12 +181,6 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r, } } - if (r->impl->texture_from_dmabuf) { - if (wlr_linux_dmabuf_v1_create(wl_display, r) == NULL) { - return false; - } - } - if (r->impl->init_wl_display) { if (!r->impl->init_wl_display(r, wl_display)) { return false;