linux_dmabuf_v1: Use wlr_drm_format_set_union

This commit is contained in:
Alexander Orzechowski 2023-05-03 12:38:28 -04:00
parent ec37d55a5e
commit cbe8876050
1 changed files with 6 additions and 7 deletions

View File

@ -916,14 +916,13 @@ static bool set_default_feedback(struct wlr_linux_dmabuf_v1 *linux_dmabuf,
struct wlr_drm_format_set formats = {0};
for (size_t i = 0; i < tranches_len; i++) {
const struct wlr_linux_dmabuf_feedback_v1_tranche *tranche = &tranches[i];
for (size_t j = 0; j < tranche->formats.len; j++) {
const struct wlr_drm_format *fmt = tranche->formats.formats[j];
for (size_t k = 0; k < fmt->len; k++) {
if (!wlr_drm_format_set_add(&formats, fmt->format, fmt->modifiers[k])) {
goto error_formats;
}
}
struct wlr_drm_format_set uni;
if (!wlr_drm_format_set_union(&uni, &formats, &tranche->formats)) {
goto error_formats;
}
wlr_drm_format_set_finish(&formats);
formats = uni;
}
compiled_feedback_destroy(linux_dmabuf->default_feedback);