]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: only copy ucode for enabled xcc
authorLikun Gao <Likun.Gao@amd.com>
Wed, 18 Jun 2025 09:56:30 +0000 (17:56 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Dec 2025 18:22:53 +0000 (13:22 -0500)
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>
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c

index 12564e3cc7d0e5b369b7ed8fe83893fb5c78a0bf..0c18b07cae3b717728abdc2a8f2db9989fe06262 100644 (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);
+               }
        }
 }