From bdfb478be11286f58caa8dfb04376b9e6cdacf63 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 10 Mar 2025 10:18:25 +0100 Subject: [PATCH] radeonsi/video: Only allow 64K_S swizzle mode for VCN < 2.2 Fixes: 7f7206f1a9d ("radeonsi/video: Allocate video buffers with modifiers") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12766 Reviewed-by: Ruijing Dong Part-of: --- src/gallium/drivers/radeonsi/si_uvd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_uvd.c b/src/gallium/drivers/radeonsi/si_uvd.c index fb73273f40c..eacf32c5bb3 100644 --- a/src/gallium/drivers/radeonsi/si_uvd.c +++ b/src/gallium/drivers/radeonsi/si_uvd.c @@ -47,9 +47,16 @@ struct pipe_video_buffer *si_video_buffer_create_with_modifiers(struct pipe_cont continue; } - /* Linear only for UVD/VCE and VCN 1.0 */ - if (sscreen->info.vcn_ip_version < VCN_2_0_0 && mod != DRM_FORMAT_MOD_LINEAR) - continue; + if (mod != DRM_FORMAT_MOD_LINEAR) { + /* Linear only for UVD/VCE and VCN 1.0 */ + if (sscreen->info.vcn_ip_version < VCN_2_0_0) + continue; + + /* Only "S" swizzle modes supported */ + if (sscreen->info.vcn_ip_version < VCN_2_2_0 && + AMD_FMT_MOD_GET(TILE, mod) != AMD_FMT_MOD_TILE_GFX9_64K_S) + continue; + } allowed_modifiers[allowed_modifiers_count++] = mod; }