From 5b619cc4b04a725c9bad26122af0488d23c5071a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 1 Jul 2025 21:00:59 -0700 Subject: [PATCH] freedreno: Advertise external_only if we can't render Don't claim we can render to formats unconditionally. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_screen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 818cf075550..52b3ccffb06 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -744,6 +744,12 @@ is_format_supported(struct pipe_screen *pscreen, return modifier == DRM_FORMAT_MOD_LINEAR; } +static bool +is_rendering_supported(struct pipe_screen *pscreen, enum pipe_format format) +{ + return pscreen->is_format_supported(pscreen, format, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_RENDER_TARGET); +} + static void fd_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, enum pipe_format format, int max, @@ -767,7 +773,7 @@ fd_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, modifiers[num] = all_modifiers[i]; if (external_only) - external_only[num] = false; + external_only[num] = !is_rendering_supported(pscreen, format); } num++;