diff options
author | Simon Ser <contact@emersion.fr> | 2021-03-31 22:07:54 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-26 16:40:53 +0000 |
commit | 98f2efde9837dec3e39fbe1f56832d18940eb6cd (patch) | |
tree | f16a5e5c536ef6b4078db7ffa38c1b31fdfd2468 | |
parent | d5df8d5cbf5055a4712f3871f4ba227464ebebb5 (diff) |
render/drm_format_set: remove special LINEAR case
This was used to make the intersection of INVALID and LINEAR result
in LINEAR. We can now just require LINEAR to be in both lists.
-rw-r--r-- | render/drm_format_set.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/render/drm_format_set.c b/render/drm_format_set.c index 90256098..82997eda 100644 --- a/render/drm_format_set.c +++ b/render/drm_format_set.c @@ -144,18 +144,6 @@ struct wlr_drm_format *wlr_drm_format_intersect( const struct wlr_drm_format *a, const struct wlr_drm_format *b) { assert(a->format == b->format); - // Special case: if a format only supports LINEAR and the other supports - // implicit modifiers, force LINEAR. This will force the allocator to - // create a buffer with a linear layout instead of an implicit modifier. - if (a->len == 1 && a->modifiers[0] == DRM_FORMAT_MOD_LINEAR && - wlr_drm_format_has(b, DRM_FORMAT_MOD_INVALID)) { - return wlr_drm_format_dup(a); - } - if (b->len == 1 && b->modifiers[0] == DRM_FORMAT_MOD_LINEAR && - wlr_drm_format_has(a, DRM_FORMAT_MOD_INVALID)) { - return wlr_drm_format_dup(b); - } - size_t format_cap = a->len < b->len ? a->len : b->len; size_t format_size = sizeof(struct wlr_drm_format) + format_cap * sizeof(a->modifiers[0]); |