From 1db976cecb6968b2d989840c6f16aa00bb83d026 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 24 Jun 2021 13:11:21 +0200 Subject: render/egl: replace wlr_egl_create with wlr_egl_create_with_drm_fd We never create an EGL context with the platform set to something other than EGL_PLATFORM_GBM_KHR. Let's simplify wlr_egl_create by taking a DRM FD instead of a (platform, remote_display) tuple. This hides the internal details of creating an EGL context for a specific device. This will allow us to transparently use the device platform [1] when the time comes. [1]: https://github.com/swaywm/wlroots/pull/2671 --- render/gles2/renderer.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'render/gles2') diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index e0534749..9bfaebd7 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -733,21 +733,12 @@ extern const GLchar tex_fragment_src_rgbx[]; extern const GLchar tex_fragment_src_external[]; struct wlr_renderer *wlr_gles2_renderer_create_with_drm_fd(int 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); + struct wlr_egl *egl = wlr_egl_create_with_drm_fd(drm_fd); 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"); -- cgit v1.2.3