]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: correct rlc autoload for xcc harvest
authorLikun Gao <Likun.Gao@amd.com>
Thu, 10 Jul 2025 06:25:03 +0000 (14:25 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Dec 2025 18:29:07 +0000 (13:29 -0500)
If the number instances of firmware is RLC_NUM_INS_CODE0(Only 1 inst),
need to copy it directly for rlcautolad.
For the firmware which instances number bigger than 1, only copy for
enabled XCC to save copy 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 3a641d223ad683c549df50baa644cae82842dab9..96ca3648205d6d4f2d2f3e35ae134937174acb95 100644 (file)
@@ -933,7 +933,8 @@ 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++) {
-               if ((1 << (i / 2)) & adev->gfx.xcc_mask) {
+               if ((num_inst == RLC_NUM_INS_CODE0) ||
+                   ((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)