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
This commit is contained in:
Simon Ser 2020-04-08 14:57:20 +02:00 committed by Scott Anderson
parent 4a1015faff
commit d10f8a98ec
2 changed files with 10 additions and 7 deletions

View File

@ -10,6 +10,7 @@
#include <wlr/render/interface.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_linux_dmabuf_v1.h>
#include <wlr/util/log.h>
#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;
}

View File

@ -4,7 +4,6 @@
#include <wlr/render/gles2.h>
#include <wlr/render/interface.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_linux_dmabuf_v1.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/util/log.h>
#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;