radeonsi/video: Fix setting decode surface format for single plane formats

multi_plane_format is only valid when num_planes > 1.

Fixes: 26979becec ("radeonsi/video: Add video decoder using ac_video_dec")
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40811>
This commit is contained in:
David Rosca 2026-04-07 09:15:58 +02:00 committed by Marge Bot
parent 44a061a034
commit cc78a5dd4b

View file

@ -124,9 +124,9 @@ static void si_dec_fill_surface(struct si_video_dec *vid, struct pipe_resource *
struct si_screen *sscreen = (struct si_screen *)vid->screen;
struct si_texture *tex = (struct si_texture *)res;
surf->format = tex->multi_plane_format;
surf->format = tex->num_planes > 1 ? tex->multi_plane_format : res->format;
surf->size += tex->buffer.buf->size;
surf->num_planes = util_format_get_num_planes(tex->multi_plane_format);
surf->num_planes = util_format_get_num_planes(surf->format);
for (uint32_t i = 0; i < surf->num_planes; i++) {
assert(tex);