radeonsi: stop special-casing YUV formats in si_query_dmabuf_modifiers

Instead of having a special case for YUV formats in
si_query_dmabuf_modifiers, let ac_get_supported_modifiers handle
them. Keep setting external_only = 1 for YUV formats, since we
can only sample from such formats (we can't use them as render
targets).

This shouldn't change si_query_dmabuf_modifiers's behavior, because
for YUV formats ac_get_supported_modifiers will return a single
LINEAR modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>
This commit is contained in:
Simon Ser 2021-04-09 14:03:53 +02:00 committed by Marge Bot
parent 19378dfe3c
commit 979e138695
1 changed files with 1 additions and 11 deletions

View File

@ -1341,16 +1341,6 @@ static void si_query_dmabuf_modifiers(struct pipe_screen *screen,
{
struct si_screen *sscreen = (struct si_screen *)screen;
if (util_format_is_yuv(format)) {
if (max) {
*modifiers = DRM_FORMAT_MOD_LINEAR;
if (external_only)
*external_only = 1;
}
*count = 1;
return;
}
unsigned ac_mod_count = max;
ac_get_supported_modifiers(&sscreen->info, &(struct ac_modifier_options) {
.dcc = !(sscreen->debug_flags & DBG(NO_DCC)),
@ -1361,7 +1351,7 @@ static void si_query_dmabuf_modifiers(struct pipe_screen *screen,
}, format, &ac_mod_count, max ? modifiers : NULL);
if (max && external_only) {
for (unsigned i = 0; i < ac_mod_count; ++i)
external_only[i] = 0;
external_only[i] = util_format_is_yuv(format);
}
*count = ac_mod_count;
}