From bb562c955e174f028ed06e92fdb23411ad456f0a Mon Sep 17 00:00:00 2001 From: Likun Gao Date: Wed, 18 Jun 2025 17:56:30 +0800 Subject: [PATCH] drm/amdgpu: only copy ucode for enabled xcc Only copy ucode for enabled xcc instead of copy for all 8 xcc for rlc autoload on gfx v12_1 to save time. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c index 12564e3cc7d0..0c18b07cae3b 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c @@ -905,11 +905,13 @@ static void gfx_v12_1_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *ade fw_size = toc_fw_inst_size; for (i = 0; i < num_inst; i++) { - memcpy(ptr + toc_offset + i * toc_fw_inst_size, fw_data, fw_size); + if ((1 << (i / 2)) & adev->gfx.xcc_mask) { + memcpy(ptr + toc_offset + i * toc_fw_inst_size, fw_data, fw_size); - if (fw_size < toc_fw_inst_size) - memset(ptr + toc_offset + fw_size + i * toc_fw_inst_size, - 0, toc_fw_inst_size - fw_size); + if (fw_size < toc_fw_inst_size) + memset(ptr + toc_offset + fw_size + i * toc_fw_inst_size, + 0, toc_fw_inst_size - fw_size); + } } } -- 2.47.3