From c868e509b7f41dc308726e15551e02897946db70 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 30 Jun 2021 15:41:56 +0200 Subject: drm: add support for DMA-BUFs Mesa's Vulkan WSI still uses wl_drm when modifiers aren't supported. This has been fixed in [1] but will take some time to be propagated to users. In the meantime, add a fallback. [1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4942 --- include/wlr/types/wlr_drm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_drm.h b/include/wlr/types/wlr_drm.h index 51764928..efcf139f 100644 --- a/include/wlr/types/wlr_drm.h +++ b/include/wlr/types/wlr_drm.h @@ -13,6 +13,15 @@ struct wlr_renderer; +struct wlr_drm_buffer { + struct wlr_buffer base; + + struct wl_resource *resource; // can be NULL if the client destroyed it + struct wlr_dmabuf_attributes dmabuf; + + struct wl_listener release; +}; + /** * A stub implementation of Mesa's wl_drm protocol. * @@ -21,6 +30,7 @@ struct wlr_renderer; */ struct wlr_drm { struct wl_global *global; + struct wlr_renderer *renderer; char *node_name; struct { @@ -28,8 +38,14 @@ struct wlr_drm { } events; struct wl_listener display_destroy; + struct wl_listener renderer_destroy; }; +bool wlr_drm_buffer_is_resource(struct wl_resource *resource); + +struct wlr_drm_buffer *wlr_drm_buffer_from_resource( + struct wl_resource *resource); + struct wlr_drm *wlr_drm_create(struct wl_display *display, struct wlr_renderer *renderer); -- cgit v1.2.3