From 697a1cd0f59f9a64f02e47b0f62a7184d04ad794 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 30 Nov 2021 20:26:11 +0100 Subject: output: add wlr_output_get_primary_formats This allows compositors to get primary formats without manually calling wlr_output_impl.get_primary_formats. For example, the Sway patch for linux-dmabuf feedback [1] needs this. [1]: https://github.com/swaywm/sway/pull/6313 --- include/wlr/types/wlr_output.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 7d7fbaad..9e18a216 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -460,6 +460,16 @@ void wlr_output_lock_software_cursors(struct wlr_output *output, bool lock); */ void wlr_output_render_software_cursors(struct wlr_output *output, pixman_region32_t *damage); +/** + * Get the set of DRM formats suitable for the primary buffer, assuming a + * buffer with the specified capabilities. + * + * NULL is returned if the backend doesn't have any format constraint, ie. all + * formats are supported. An empty set is returned if the backend doesn't + * support any format. + */ +const struct wlr_drm_format_set *wlr_output_get_primary_formats( + struct wlr_output *output, uint32_t buffer_caps); struct wlr_output_cursor *wlr_output_cursor_create(struct wlr_output *output); -- cgit v1.2.3