diff options
author | Simon Ser <contact@emersion.fr> | 2021-10-01 17:22:04 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-10-01 09:26:05 -0600 |
commit | 1d7e438d8ac636a2c90d58875e73a67e5440e4ae (patch) | |
tree | 1e42c9eeb72a7e2af478c8db73824968b2b0c109 /backend/drm | |
parent | 61b83441a195d9500a3c96bd640a756be16b658e (diff) |
Revert "Require INVALID for implicit format modifiers"
This reverts commit ea7357b70366588069c83f158e6a4eb2d3a702b3.
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 4b92d767..abfd1c2f 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -118,14 +118,9 @@ static bool add_plane(struct wlr_drm_backend *drm, p->id = drm_plane->plane_id; p->props = *props; - for (size_t i = 0; i < drm_plane->count_formats; ++i) { - // Force a LINEAR layout for the cursor if the driver doesn't support - // modifiers - uint64_t mod = DRM_FORMAT_MOD_INVALID; - if (type == DRM_PLANE_TYPE_CURSOR) { - mod = DRM_FORMAT_MOD_LINEAR; - } - wlr_drm_format_set_add(&p->formats, drm_plane->formats[i], mod); + for (size_t j = 0; j < drm_plane->count_formats; ++j) { + wlr_drm_format_set_add(&p->formats, drm_plane->formats[j], + DRM_FORMAT_MOD_INVALID); } if (p->props.in_formats && drm->addfb2_modifiers) { @@ -155,6 +150,13 @@ static bool add_plane(struct wlr_drm_backend *drm, } drmModeFreePropertyBlob(blob); + } else if (type == DRM_PLANE_TYPE_CURSOR) { + // Force a LINEAR layout for the cursor if the driver doesn't support + // modifiers + for (size_t i = 0; i < p->formats.len; ++i) { + wlr_drm_format_set_add(&p->formats, p->formats.formats[i]->format, + DRM_FORMAT_MOD_LINEAR); + } } switch (type) { |