diff options
author | Austin Shafer <ashafer@nvidia.com> | 2024-02-02 16:15:25 -0500 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2024-02-06 16:11:30 +0000 |
commit | 4cd556ea20d4a598a36e4e2349acb45cc4246383 (patch) | |
tree | 66af0377a2ff2e4d5f1fa1564a4099203db860e8 /include | |
parent | 811ca199c444525dc4d846d38f76554f1a9b48b0 (diff) |
linux_dmabuf_v1: allow callbacks for checking dmabuf import
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_linux_dmabuf_v1.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_linux_dmabuf_v1.h b/include/wlr/types/wlr_linux_dmabuf_v1.h index d25da3af..cf967f95 100644 --- a/include/wlr/types/wlr_linux_dmabuf_v1.h +++ b/include/wlr/types/wlr_linux_dmabuf_v1.h @@ -64,6 +64,9 @@ struct wlr_linux_dmabuf_v1 { int main_device_fd; // to sanity check FDs sent by clients, -1 if unavailable struct wl_listener display_destroy; + + bool (*check_dmabuf_callback)(struct wlr_dmabuf_attributes *attribs, void *data); + void *check_dmabuf_callback_data; }; /** @@ -84,6 +87,15 @@ struct wlr_linux_dmabuf_v1 *wlr_linux_dmabuf_v1_create_with_renderer(struct wl_d uint32_t version, struct wlr_renderer *renderer); /** + * Set the dmabuf import check callback + * + * This can be used by consumers who want to implement specific dmabuf checks. Useful for + * users such as gamescope who do not use the rendering logic of wlroots. + */ +void wlr_linux_dmabuf_v1_set_check_dmabuf_callback(struct wlr_linux_dmabuf_v1 *linux_dmabuf, + bool (*callback)(struct wlr_dmabuf_attributes *attribs, void *data), void *data); + +/** * Set a surface's DMA-BUF feedback. * * Passing a NULL feedback resets it to the default feedback. |