aboutsummaryrefslogtreecommitdiff
path: root/include/wlr/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-12-01 13:35:50 +0100
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-12-03 14:42:41 +0000
commit7201aae3d607ad121ea0dfb3a50eb2c3f65b7d85 (patch)
tree3b0851a1e21756f65af9df962cda5ef9ca95e30a /include/wlr/render
parent92080b3a014d92af628de964e66aca705da3041d (diff)
render/drm-format-set: add wlr_drm_format_set_intersect
This intersects two DRM format sets. This is useful for implementing DMA-BUF feedback in compositors, see e.g. the Sway PR [1]. [1]: https://github.com/swaywm/sway/pull/6313
Diffstat (limited to 'include/wlr/render')
-rw-r--r--include/wlr/render/drm_format_set.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/wlr/render/drm_format_set.h b/include/wlr/render/drm_format_set.h
index 9427df3b..9f4a86ea 100644
--- a/include/wlr/render/drm_format_set.h
+++ b/include/wlr/render/drm_format_set.h
@@ -63,4 +63,13 @@ bool wlr_drm_format_set_has(const struct wlr_drm_format_set *set,
bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format,
uint64_t modifier);
+/**
+ * Intersect two DRM format sets `a` and `b`, storing in the destination set
+ * `dst` the format + modifier pairs which are in both source sets.
+ *
+ * Returns false on failure or when the intersection is empty.
+ */
+bool wlr_drm_format_set_intersect(struct wlr_drm_format_set *dst,
+ const struct wlr_drm_format_set *a, const struct wlr_drm_format_set *b);
+
#endif