From db7d38ccefe735d74cf7987bc77c8817f2ef4d26 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 19 May 2025 11:22:33 +0200 Subject: [PATCH] radv: fix missing texel scale for unaligned linear SDMA copies texel_scale was 0 which caused GPU hangs for unaligned linear copies. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13195 Fixes: 4b73d7e8174 ("radv: fix SDMA copies for linear 96-bits formats") Signed-off-by: Samuel Pitoiset Part-of: (cherry picked from commit c22d86e844d864ddf17de78d476c1cdfd5d3f1b3) --- .pick_status.json | 2 +- src/amd/vulkan/radv_sdma.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 0407f5b43c8..038009f80ab 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -164,7 +164,7 @@ "description": "radv: fix missing texel scale for unaligned linear SDMA copies", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "4b73d7e8174faf7cc9bfa351befc637ffe2e53c1", "notes": null diff --git a/src/amd/vulkan/radv_sdma.c b/src/amd/vulkan/radv_sdma.c index e99c0fda029..7f74bbb2f82 100644 --- a/src/amd/vulkan/radv_sdma.c +++ b/src/amd/vulkan/radv_sdma.c @@ -521,6 +521,7 @@ radv_sdma_emit_copy_linear_sub_window(const struct radv_device *device, struct r /* Adjust offset/extent for 96-bits formats because SDMA expects a power of two bpp. */ const uint32_t texel_scale = src->texel_scale == 1 ? dst->texel_scale : src->texel_scale; + assert(texel_scale); src_off.x *= texel_scale; dst_off.x *= texel_scale; ext.width *= texel_scale; @@ -729,6 +730,7 @@ radv_sdma_copy_buffer_image_unaligned(const struct radv_device *device, struct r .blk_h = img.blk_h, .pitch = info.aligned_row_pitch * img.blk_w, .slice_pitch = info.aligned_row_pitch * img.blk_w * info.extent_vertical_blocks * img.blk_h, + .texel_scale = buf->texel_scale, }; VkExtent3D extent = base_extent;