From 4d603826c811883f656be61743e499831541fede Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 1 Dec 2020 16:21:10 +0100 Subject: output: add get_primary_formats to interface This function returns the set of formats the backend can use for the primary buffer. It can be used to allocate a buffer suitable for scan-out. --- include/wlr/interfaces/wlr_output.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h index aef41367..c74ea156 100644 --- a/include/wlr/interfaces/wlr_output.h +++ b/include/wlr/interfaces/wlr_output.h @@ -94,6 +94,15 @@ struct wlr_output_impl { * size for the cursor may fail. */ void (*get_cursor_size)(struct wlr_output *output, int *width, int *height); + /** + * Get the list of DMA-BUF formats suitable for the primary buffer, + * assuming a buffer with the specified capabilities. + * + * If unimplemented, the primary buffer has no format constraint. If NULL + * is returned, no format is suitable. + */ + const struct wlr_drm_format_set *(*get_primary_formats)( + struct wlr_output *output, uint32_t buffer_caps); }; /** -- cgit v1.2.3