From 82443ea46b32111744aa62a42a24312027e512f8 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 25 Nov 2020 15:58:37 +0100 Subject: render/drm_format_set: introduce wlr_drm_format_intersect Intersects modifiers from two wlr_drm_format structs. If either format doesn't support modifiers, the resulting format won't support modifiers. --- include/render/drm_format_set.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/render') diff --git a/include/render/drm_format_set.h b/include/render/drm_format_set.h index ae1fcc47..78b70e9b 100644 --- a/include/render/drm_format_set.h +++ b/include/render/drm_format_set.h @@ -4,5 +4,14 @@ #include struct wlr_drm_format *wlr_drm_format_dup(const struct wlr_drm_format *format); +/** + * Intersect modifiers for two DRM formats. + * + * Both arguments must have the same format field. If the formats aren't + * compatible, NULL is returned. If either format doesn't support any modifier, + * a format that doesn't support any modifier is returned. + */ +struct wlr_drm_format *wlr_drm_format_intersect( + const struct wlr_drm_format *a, const struct wlr_drm_format *b); #endif -- cgit v1.2.3