From e8df7c367acad38ae7fd3ffcb7cbce1b6b3a3153 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 12 Apr 2021 11:49:57 +0200 Subject: linux-dmabuf-v1: split params and buffer Previously, the same struct was used for linux-dmabuf-v1 params and buffer. This made the whole logic a little bit awkward, because a wlr_dmabuf_v1_buffer could either be still being constructed, or be a complete buffer. Introduce a separate wlr_linux_buffer_params_v1 struct for buffer params still being constructed. Once the params are complete (ie. once the create request is sent), the params struct is destroyed and the buffer struct is created. This will help with [1] as well. [1]: https://github.com/swaywm/wlroots/issues/2664 --- include/wlr/types/wlr_linux_dmabuf_v1.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_linux_dmabuf_v1.h b/include/wlr/types/wlr_linux_dmabuf_v1.h index 1d1a00eb..17e897c3 100644 --- a/include/wlr/types/wlr_linux_dmabuf_v1.h +++ b/include/wlr/types/wlr_linux_dmabuf_v1.h @@ -14,11 +14,8 @@ #include struct wlr_dmabuf_v1_buffer { - struct wlr_renderer *renderer; - struct wl_resource *buffer_resource; - struct wl_resource *params_resource; + struct wl_resource *resource; struct wlr_dmabuf_attributes attributes; - bool has_modifier; }; /** @@ -34,6 +31,13 @@ bool wlr_dmabuf_v1_resource_is_buffer(struct wl_resource *buffer_resource); struct wlr_dmabuf_v1_buffer *wlr_dmabuf_v1_buffer_from_buffer_resource( struct wl_resource *buffer_resource); +struct wlr_linux_buffer_params_v1 { + struct wl_resource *resource; + struct wlr_linux_dmabuf_v1 *linux_dmabuf; + struct wlr_dmabuf_attributes attributes; + bool has_modifier; +}; + /* the protocol interface */ struct wlr_linux_dmabuf_v1 { struct wl_global *global; -- cgit v1.2.3