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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36067>
(cherry picked from commit a51afbaff8)
This commit is contained in:
Samuel Pitoiset 2025-07-11 10:50:14 +02:00 committed by Eric Engestrom
parent 1c3798ed86
commit 56b0874422
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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;