From 244cfac14366358315dffb4050318c5c8bdd64d0 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 6 Mar 2025 16:37:54 +0100 Subject: [PATCH] gallium/vl: Fix video buffer supported format check It needs to check all plane formats. Fixes: c3ceec6cd85 ("vdpau: Refactor query for video surface formats.") Reviewed-by: Ruijing Dong Part-of: --- src/gallium/auxiliary/vl/vl_video_buffer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c index f2e086fdfaf..db3403d17d3 100644 --- a/src/gallium/auxiliary/vl/vl_video_buffer.c +++ b/src/gallium/auxiliary/vl/vl_video_buffer.c @@ -123,6 +123,8 @@ vl_video_buffer_is_format_supported(struct pipe_screen *screen, enum pipe_format resource_formats[VL_NUM_COMPONENTS]; unsigned i; + assert(format != PIPE_FORMAT_NONE); + if (entrypoint == PIPE_VIDEO_ENTRYPOINT_PROCESSING && format == PIPE_FORMAT_R8_G8_B8_UNORM) return false; @@ -136,14 +138,14 @@ vl_video_buffer_is_format_supported(struct pipe_screen *screen, /* we at least need to sample from it */ if (!screen->is_format_supported(screen, fmt, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW)) - continue; + return false; fmt = vl_video_buffer_surface_format(fmt); - if (screen->is_format_supported(screen, fmt, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_RENDER_TARGET)) - return true; + if (!screen->is_format_supported(screen, fmt, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_RENDER_TARGET)) + return false; } - return false; + return true; } unsigned