From eb8360bda39bf48e2126e354fe6125c2e487c6b5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 10 Jun 2020 14:47:12 +0200 Subject: render: introduce wlr_renderer_get_drm_fd --- include/render/gles2.h | 1 + include/wlr/render/interface.h | 1 + include/wlr/render/wlr_renderer.h | 7 +++++++ 3 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/render/gles2.h b/include/render/gles2.h index 2eff0aa5..a2173fbb 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -35,6 +35,7 @@ struct wlr_gles2_renderer { struct wlr_renderer wlr_renderer; struct wlr_egl *egl; + int drm_fd; const char *exts_str; struct { diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index 1b57c660..70e954f8 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -72,6 +72,7 @@ struct wlr_renderer_impl { bool (*blit_dmabuf)(struct wlr_renderer *renderer, struct wlr_dmabuf_attributes *dst, struct wlr_dmabuf_attributes *src); + int (*get_drm_fd)(struct wlr_renderer *renderer); }; void wlr_renderer_init(struct wlr_renderer *renderer, diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h index 8908d3ce..915ec915 100644 --- a/include/wlr/render/wlr_renderer.h +++ b/include/wlr/render/wlr_renderer.h @@ -131,6 +131,13 @@ bool wlr_renderer_format_supported(struct wlr_renderer *r, bool wlr_renderer_init_wl_display(struct wlr_renderer *r, struct wl_display *wl_display); +/** + * Obtains the FD of the DRM device used for rendering, or -1 if unavailable. + * + * The caller doesn't have ownership of the FD, it must not close it. + */ +int wlr_renderer_get_drm_fd(struct wlr_renderer *r); + /** * Destroys this wlr_renderer. Textures must be destroyed separately. */ -- cgit v1.2.3