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 <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Likun Gao 2025-06-18 17:56:30 +08:00 committed by Alex Deucher
parent 12323f9588
commit bb562c955e

View File

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