From 867a995ce759a725b58d3fa23e5e319035b7e3f9 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 2 Oct 2023 22:32:26 -0400 Subject: [PATCH] ac/gpu_info: override ib_size_alignment for VCN_DEC and JPEG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the commit 4f660f99 ("ac/gpu_info: pad IBs according to ib_size_alignment"), we found kernel isn't reporting ib_base/size_alignment correctly, thus causing VCN_DEC and JPEG functions broken. We will fix the kernel and bump the kernel version, and now for the older kernel, we need this override. closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9916 Signed-off-by: Leo Liu Reviewed-by: Marek Olšák Part-of: --- src/amd/common/ac_gpu_info.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index 8ae8d6cf77e..5cf4a88d04b 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -681,6 +681,14 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, info->ip[ip_type].ib_base_alignment = ip_info.ib_start_alignment; info->ip[ip_type].ib_size_alignment = ip_info.ib_size_alignment; + /* Override ib_base/size_alignment for VCN_DEC and JPEG, after the kernel fixed, + * here will be adding kernel version check for the old kernel. + */ + if (ip_type == AMD_IP_VCN_DEC || ip_type == AMD_IP_VCN_JPEG) { + info->ip[ip_type].ib_base_alignment = 64; + info->ip[ip_type].ib_size_alignment = 64; + } + /* I guess we must align IBs due to caching on GFX9. This fixes a hang. */ if ((ip_type == AMD_IP_GFX || ip_type == AMD_IP_COMPUTE) && info->ip[ip_type].ver_major == 9) {