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 <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35856>
This commit is contained in:
Rob Clark 2025-07-01 07:54:32 -07:00 committed by Marge Bot
parent 4aaf431a11
commit 092bafe2ec

View file

@ -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))