gbm/dri: Propagate queryDmaBufModifiers return value

We were treating count == 0 as the format not being supported at all,
but queryDmaBufModifiers would return false in that case.

Fixes spuriously reporting all formats as unsupported with radeonsi
(which doesn't support modifiers yet), which would e.g. cause mutter
to think the HW cursor format isn't supported and fall back to SW
cursor.

Suggested-by: Daniel Stone <daniels@collabora.com>
Fixes: 4e3a7dcf6e "gallium: enable
                     EGL_EXT_image_dma_buf_import_modifiers
                     unconditionally"

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4532>
This commit is contained in:
Michel Dänzer
2020-04-15 18:13:54 +02:00
committed by Marge Bot
parent b5b25ee032
commit e58509cdec

View File

@@ -618,14 +618,12 @@ gbm_dri_is_format_supported(struct gbm_device *gbm,
}
}
/* Check if the driver returns any modifiers for this format; since linear
* is counted as a modifier, we will have at least one modifier for any
* supported format. */
/* This returns false if the format isn't supported */
if (!dri->image->queryDmaBufModifiers(dri->screen, format, 0, NULL, NULL,
&count))
return 0;
return (count > 0);
return 1;
}
static int