From 56b0874422e4821b404c6a01efac55817a267403 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 11 Jul 2025 10:50:14 +0200 Subject: [PATCH] radv/sdma: fix unaligned 96-bits copies on GFX9 On SDMA4, when the pitch isn't aligned, the width needs to be scaled by 3 for 96-bits formats. On SDMA5+, the pitch is aligned and the driver doesn't need to fallback to unaligned copies. CC: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: (cherry picked from commit a51afbaff87056b5c708c5992a0099725cb64271) --- .pick_status.json | 2 +- src/amd/vulkan/radv_sdma.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 202aa6d75d4..7955fae5ae0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1794,7 +1794,7 @@ "description": "radv/sdma: fix unaligned 96-bits copies on GFX9", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_sdma.c b/src/amd/vulkan/radv_sdma.c index 7f74bbb2f82..c499d4420c4 100644 --- a/src/amd/vulkan/radv_sdma.c +++ b/src/amd/vulkan/radv_sdma.c @@ -131,7 +131,7 @@ static struct radv_sdma_chunked_copy_info radv_sdma_get_chunked_copy_info(const struct radv_device *const device, const struct radv_sdma_surf *const img, const VkExtent3D extent) { - const unsigned extent_horizontal_blocks = DIV_ROUND_UP(extent.width, img->blk_w); + const unsigned extent_horizontal_blocks = DIV_ROUND_UP(extent.width * img->texel_scale, img->blk_w); const unsigned extent_vertical_blocks = DIV_ROUND_UP(extent.height, img->blk_h); const unsigned aligned_row_pitch = ALIGN(extent_horizontal_blocks, 4); const unsigned aligned_row_bytes = aligned_row_pitch * img->bpp;