diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-10 22:20:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-10 22:20:21 -0400 |
commit | 6569c2b62614384b268eb20feb7818f3c0cf606c (patch) | |
tree | 4be63a8f4e2edfcecd228f23e9846403ddf39281 /backend/drm | |
parent | fe2fbd0fad96624ab64a86b0b8eb8ead769908f2 (diff) | |
parent | c24351681f672a2ce561b9cb6d73172dfc36c45c (diff) |
Merge pull request #53 from nyorain/drm_buffer
Implement drm (egl) buffer attaching
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/backend.c | 12 | ||||
-rw-r--r-- | backend/drm/drm.c | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index e361358e..a7e6824c 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -12,6 +12,7 @@ #include <wlr/interfaces/wlr_output.h> #include <wlr/util/list.h> #include <wlr/util/log.h> +#include <wlr/egl.h> #include "backend/udev.h" #include "backend/drm.h" @@ -38,9 +39,14 @@ static void wlr_drm_backend_destroy(struct wlr_backend_state *drm) { free(drm); } +static struct wlr_egl *wlr_drm_backend_get_egl(struct wlr_backend_state *drm) { + return &drm->renderer.egl; +} + static struct wlr_backend_impl backend_impl = { .init = wlr_drm_backend_init, - .destroy = wlr_drm_backend_destroy + .destroy = wlr_drm_backend_destroy, + .get_egl = wlr_drm_backend_get_egl }; static void session_signal(struct wl_listener *listener, void *data) { @@ -149,6 +155,10 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, goto error_event; } + if (!wlr_egl_bind_display(&drm->renderer.egl, display)) { + wlr_log(L_INFO, "Failed to bind egl/wl display: %s", egl_error()); + } + return backend; error_event: diff --git a/backend/drm/drm.c b/backend/drm/drm.c index b5742eca..8062a478 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -579,7 +579,7 @@ static bool wlr_drm_output_set_cursor(struct wlr_output_state *output, wlr_matrix_texture(plane->matrix, plane->width, plane->height, output->base->transform ^ WL_OUTPUT_TRANSFORM_FLIPPED_180); - plane->wlr_rend = wlr_gles2_renderer_init(); + plane->wlr_rend = wlr_gles2_renderer_init(drm->base); if (!plane->wlr_rend) { return false; } |