aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_linux_dmabuf_v1.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/types/wlr_linux_dmabuf_v1.c b/types/wlr_linux_dmabuf_v1.c
index 69aa64b7..a124d521 100644
--- a/types/wlr_linux_dmabuf_v1.c
+++ b/types/wlr_linux_dmabuf_v1.c
@@ -475,16 +475,12 @@ static ssize_t get_drm_format_set_index(const struct wlr_drm_format_set *set,
format_found = true;
break;
}
- idx += 1 + fmt->len;
+ idx += fmt->len;
}
if (!format_found) {
return -1;
}
- if (modifier == DRM_FORMAT_MOD_INVALID) {
- return idx;
- }
-
for (size_t i = 0; i < fmt->len; i++) {
if (fmt->modifiers[i] == modifier) {
return idx;
@@ -506,7 +502,7 @@ static struct wlr_linux_dmabuf_feedback_v1_compiled *feedback_compile(
size_t table_len = 0;
for (size_t i = 0; i < fallback_tranche->formats->len; i++) {
const struct wlr_drm_format *fmt = fallback_tranche->formats->formats[i];
- table_len += 1 + fmt->len;
+ table_len += fmt->len;
}
assert(table_len > 0);
@@ -533,12 +529,6 @@ static struct wlr_linux_dmabuf_feedback_v1_compiled *feedback_compile(
for (size_t i = 0; i < fallback_tranche->formats->len; i++) {
const struct wlr_drm_format *fmt = fallback_tranche->formats->formats[i];
- table[n] = (struct wlr_linux_dmabuf_feedback_v1_table_entry){
- .format = fmt->format,
- .modifier = DRM_FORMAT_MOD_INVALID,
- };
- n++;
-
for (size_t k = 0; k < fmt->len; k++) {
table[n] = (struct wlr_linux_dmabuf_feedback_v1_table_entry){
.format = fmt->format,
@@ -584,20 +574,6 @@ static struct wlr_linux_dmabuf_feedback_v1_compiled *feedback_compile(
uint16_t *indices = compiled_tranche->indices.data;
for (size_t j = 0; j < tranche->formats->len; j++) {
const struct wlr_drm_format *fmt = tranche->formats->formats[j];
-
- ssize_t index = get_drm_format_set_index(
- fallback_tranche->formats, fmt->format,
- DRM_FORMAT_MOD_INVALID);
- if (index < 0) {
- wlr_log(WLR_ERROR, "Format 0x%" PRIX32 " and modifier "
- "INVALID are in tranche #%zu but are missing "
- "from the fallback tranche",
- fmt->format, i);
- goto error_compiled;
- }
- indices[n] = index;
- n++;
-
for (size_t k = 0; k < fmt->len; k++) {
ssize_t index = get_drm_format_set_index(
fallback_tranche->formats, fmt->format, fmt->modifiers[k]);