From 092bafe2ec2e8fbbce8db93de945cb372ca06931 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 1 Jul 2025 07:54:32 -0700 Subject: [PATCH] dri: Don't iterate the planes for non-YUV Don't iterate the planes in dri2_format_mapping if the format is RGB. Signed-off-by: Rob Clark Part-of: --- src/gallium/frontends/dri/dri_helpers.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/frontends/dri/dri_helpers.c b/src/gallium/frontends/dri/dri_helpers.c index 2496608cfc1..1b0ed83043d 100644 --- a/src/gallium/frontends/dri/dri_helpers.c +++ b/src/gallium/frontends/dri/dri_helpers.c @@ -762,6 +762,10 @@ dri2_yuv_dma_buf_supported(struct dri_screen *screen, if (pscreen->is_format_supported(pscreen, alt_pipe_format(map->pipe_format), screen->target, 0, 0, PIPE_BIND_SAMPLER_VIEW)) return true; + + if (!util_format_is_yuv(map->pipe_format)) + return false; + for (unsigned i = 0; i < map->nplanes; i++) { if (!pscreen->is_format_supported(pscreen, map->planes[i].dri_format, screen->target, 0, 0, PIPE_BIND_SAMPLER_VIEW))