aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-11-25 15:58:37 +0100
committerIlia Bozhinov <ammen99@gmail.com>2020-12-03 10:52:25 +0100
commit82443ea46b32111744aa62a42a24312027e512f8 (patch)
tree92d5609de2978dc9c435c6b0372005e2ce7aac76 /include
parent237c2cf2fbe6056382077456646916f04140f49b (diff)
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.
Diffstat (limited to 'include')
-rw-r--r--include/render/drm_format_set.h9
1 files changed, 9 insertions, 0 deletions
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 <wlr/render/drm_format_set.h>
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