diff options
Diffstat (limited to 'render/wlr_renderer.c')
-rw-r--r-- | render/wlr_renderer.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 7ce86695..4a565b1d 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -251,12 +251,22 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r, } struct wlr_renderer *wlr_renderer_autocreate_with_drm_fd(int drm_fd) { - struct wlr_egl *egl = wlr_egl_create_from_drm_fd(drm_fd); + struct gbm_device *gbm_device = gbm_create_device(drm_fd); + if (!gbm_device) { + wlr_log(WLR_ERROR, "Failed to create GBM device"); + return NULL; + } + + struct wlr_egl *egl = wlr_egl_create(EGL_PLATFORM_GBM_KHR, gbm_device, + NULL); if (egl == NULL) { wlr_log(WLR_ERROR, "Could not initialize EGL"); + gbm_device_destroy(gbm_device); return NULL; } + egl->gbm_device = gbm_device; + struct wlr_renderer *renderer = wlr_gles2_renderer_create(egl); if (!renderer) { wlr_log(WLR_ERROR, "Failed to create GLES2 renderer"); |