aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-06-30 15:41:56 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-07-05 11:13:41 -0400
commitc868e509b7f41dc308726e15551e02897946db70 (patch)
tree33b8f84c1e52d326fa4f4e064035a205fe020582 /include
parentf7e3d325fe3d99b8f3930718257c849943dbe34b (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_drm.h16
1 files changed, 16 insertions, 0 deletions
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);