aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/gbm_allocator.c7
-rw-r--r--render/gles2/renderer.c5
2 files changed, 12 insertions, 0 deletions
diff --git a/render/gbm_allocator.c b/render/gbm_allocator.c
index e01be091..da71cbaf 100644
--- a/render/gbm_allocator.c
+++ b/render/gbm_allocator.c
@@ -160,6 +160,13 @@ static struct wlr_gbm_allocator *get_gbm_alloc_from_alloc(
}
struct wlr_gbm_allocator *wlr_gbm_allocator_create(int fd) {
+ uint64_t cap;
+ if (drmGetCap(fd, DRM_CAP_PRIME, &cap) ||
+ !(cap & DRM_PRIME_CAP_EXPORT)) {
+ wlr_log(WLR_ERROR, "PRIME export not supported");
+ return NULL;
+ }
+
struct wlr_gbm_allocator *alloc = calloc(1, sizeof(*alloc));
if (alloc == NULL) {
return NULL;
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 25cdcf56..ed7ed8c4 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -746,6 +746,11 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
wlr_log(WLR_INFO, "GL renderer: %s", glGetString(GL_RENDERER));
wlr_log(WLR_INFO, "Supported GLES2 extensions: %s", exts_str);
+ if (!renderer->egl->exts.image_dmabuf_import_ext) {
+ wlr_log(WLR_ERROR, "EGL_EXT_image_dma_buf_import not supported");
+ free(renderer);
+ return NULL;
+ }
if (!check_gl_ext(exts_str, "GL_EXT_texture_format_BGRA8888")) {
wlr_log(WLR_ERROR, "BGRA8888 format not supported by GLES2");
free(renderer);