From 3ef9f9128306cac549a99a3e844b3e55f9381279 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Mon, 20 Feb 2023 16:54:52 -0500 Subject: wlr_scene: Add dmabuf_feedback helper --- include/wlr/types/wlr_scene.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 19924090..b6f0d217 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -38,6 +38,7 @@ struct wlr_scene_node; struct wlr_scene_buffer; struct wlr_presentation; +struct wlr_linux_dmabuf_v1; typedef bool (*wlr_scene_buffer_point_accepts_input_func_t)( struct wlr_scene_buffer *buffer, int sx, int sy); @@ -95,10 +96,12 @@ struct wlr_scene { // May be NULL struct wlr_presentation *presentation; + struct wlr_linux_dmabuf_v1 *linux_dmabuf_v1; // private state struct wl_listener presentation_destroy; + struct wl_listener linux_dmabuf_v1_destroy; enum wlr_scene_debug_damage_option debug_damage_option; bool direct_scanout; @@ -169,6 +172,7 @@ struct wlr_scene_buffer { int dst_width, dst_height; enum wl_output_transform transform; pixman_region32_t opaque_region; + struct wlr_linux_dmabuf_feedback_v1_init_options prev_feedback_options; }; /** A viewport for an output in the scene-graph */ @@ -287,6 +291,15 @@ struct wlr_scene *wlr_scene_create(void); void wlr_scene_set_presentation(struct wlr_scene *scene, struct wlr_presentation *presentation); +/** + * Handles linux_dmabuf_v1 feedback for all surfaces in the scene. + * + * Asserts that a struct wlr_linux_dmabuf_v1 hasn't already been set for the scene. + */ +void wlr_scene_set_linux_dmabuf_v1(struct wlr_scene *scene, + struct wlr_linux_dmabuf_v1 *linux_dmabuf_v1); + + /** * Add a node displaying nothing but its children. */ -- cgit v1.2.3