aboutsummaryrefslogtreecommitdiff
path: root/render/wlr_renderer.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/wlr_renderer.c')
-rw-r--r--render/wlr_renderer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index cf307bd3..5818cd4a 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -4,6 +4,8 @@
#include <wlr/render/interface.h>
#include <wlr/render/pixman.h>
#include <wlr/render/wlr_renderer.h>
+#include <wlr/types/wlr_drm.h>
+#include <wlr/types/wlr_linux_dmabuf_v1.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
@@ -223,8 +225,16 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
}
assert(argb8888 && xrgb8888);
- if (r->impl->init_wl_display) {
- if (!r->impl->init_wl_display(r, wl_display)) {
+ if (wlr_renderer_get_dmabuf_texture_formats(r) != NULL) {
+ if (wlr_renderer_get_drm_fd(r) >= 0) {
+ if (wlr_drm_create(wl_display, r) == NULL) {
+ return false;
+ }
+ } else {
+ wlr_log(WLR_INFO, "Cannot get renderer DRM FD, disabling wl_drm");
+ }
+
+ if (wlr_linux_dmabuf_v1_create(wl_display, r) == NULL) {
return false;
}
}