From 979e13869538e79e8b56e18dfb4e7ea8816443f4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 9 Apr 2021 14:03:53 +0200 Subject: [PATCH] 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 Reviewed-by: Bas Nieuwenhuizen Acked-by: Leo Liu Part-of: --- src/gallium/drivers/radeonsi/si_texture.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index c54cf2d9f45..50621e0ed8c 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -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; }