Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
render/drm_format_set: remove special LINEAR case
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
emersion committed Oct 1, 2021
1 parent 4542f99 commit 96056d9
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions render/drm_format_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 96056d9

Please sign in to comment.