From: Likun Gao <[email protected]>

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 <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 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 5e9ab3a5184e5..b93b2fbc4a12a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
@@ -898,11 +898,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.51.1

Reply via email to