Skip to content

Commit 910ab9e

Browse files
Hawking Zhangalexdeucher
authored andcommitted
drm/amdgpu: only init tap_delay ucode when it's included in ucode binary
Not all the gfx10 variants need to integrate global tap_delay and per se tap_delay firmwares Only init tap_delay ucode when it does include in rlc ucode binary so driver doesn't send a null buffer to psp for firmware loading Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Jack Gui <Jack.Gui@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 7b471c3 commit 910ab9e

1 file changed

Lines changed: 35 additions & 25 deletions

File tree

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4274,35 +4274,45 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
42744274

42754275
}
42764276

4277-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS];
4278-
info->ucode_id = AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS;
4279-
info->fw = adev->gfx.rlc_fw;
4280-
adev->firmware.fw_size +=
4281-
ALIGN(adev->gfx.rlc.global_tap_delays_ucode_size_bytes, PAGE_SIZE);
4277+
if (adev->gfx.rlc.global_tap_delays_ucode_size_bytes) {
4278+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS];
4279+
info->ucode_id = AMDGPU_UCODE_ID_GLOBAL_TAP_DELAYS;
4280+
info->fw = adev->gfx.rlc_fw;
4281+
adev->firmware.fw_size +=
4282+
ALIGN(adev->gfx.rlc.global_tap_delays_ucode_size_bytes, PAGE_SIZE);
4283+
}
42824284

4283-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE0_TAP_DELAYS];
4284-
info->ucode_id = AMDGPU_UCODE_ID_SE0_TAP_DELAYS;
4285-
info->fw = adev->gfx.rlc_fw;
4286-
adev->firmware.fw_size +=
4287-
ALIGN(adev->gfx.rlc.se0_tap_delays_ucode_size_bytes, PAGE_SIZE);
4285+
if (adev->gfx.rlc.se0_tap_delays_ucode_size_bytes) {
4286+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE0_TAP_DELAYS];
4287+
info->ucode_id = AMDGPU_UCODE_ID_SE0_TAP_DELAYS;
4288+
info->fw = adev->gfx.rlc_fw;
4289+
adev->firmware.fw_size +=
4290+
ALIGN(adev->gfx.rlc.se0_tap_delays_ucode_size_bytes, PAGE_SIZE);
4291+
}
42884292

4289-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE1_TAP_DELAYS];
4290-
info->ucode_id = AMDGPU_UCODE_ID_SE1_TAP_DELAYS;
4291-
info->fw = adev->gfx.rlc_fw;
4292-
adev->firmware.fw_size +=
4293-
ALIGN(adev->gfx.rlc.se1_tap_delays_ucode_size_bytes, PAGE_SIZE);
4293+
if (adev->gfx.rlc.se1_tap_delays_ucode_size_bytes) {
4294+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE1_TAP_DELAYS];
4295+
info->ucode_id = AMDGPU_UCODE_ID_SE1_TAP_DELAYS;
4296+
info->fw = adev->gfx.rlc_fw;
4297+
adev->firmware.fw_size +=
4298+
ALIGN(adev->gfx.rlc.se1_tap_delays_ucode_size_bytes, PAGE_SIZE);
4299+
}
42944300

4295-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE2_TAP_DELAYS];
4296-
info->ucode_id = AMDGPU_UCODE_ID_SE2_TAP_DELAYS;
4297-
info->fw = adev->gfx.rlc_fw;
4298-
adev->firmware.fw_size +=
4299-
ALIGN(adev->gfx.rlc.se2_tap_delays_ucode_size_bytes, PAGE_SIZE);
4301+
if (adev->gfx.rlc.se2_tap_delays_ucode_size_bytes) {
4302+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE2_TAP_DELAYS];
4303+
info->ucode_id = AMDGPU_UCODE_ID_SE2_TAP_DELAYS;
4304+
info->fw = adev->gfx.rlc_fw;
4305+
adev->firmware.fw_size +=
4306+
ALIGN(adev->gfx.rlc.se2_tap_delays_ucode_size_bytes, PAGE_SIZE);
4307+
}
43004308

4301-
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE3_TAP_DELAYS];
4302-
info->ucode_id = AMDGPU_UCODE_ID_SE3_TAP_DELAYS;
4303-
info->fw = adev->gfx.rlc_fw;
4304-
adev->firmware.fw_size +=
4305-
ALIGN(adev->gfx.rlc.se3_tap_delays_ucode_size_bytes, PAGE_SIZE);
4309+
if (adev->gfx.rlc.se3_tap_delays_ucode_size_bytes) {
4310+
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SE3_TAP_DELAYS];
4311+
info->ucode_id = AMDGPU_UCODE_ID_SE3_TAP_DELAYS;
4312+
info->fw = adev->gfx.rlc_fw;
4313+
adev->firmware.fw_size +=
4314+
ALIGN(adev->gfx.rlc.se3_tap_delays_ucode_size_bytes, PAGE_SIZE);
4315+
}
43064316

43074317
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CP_MEC1];
43084318
info->ucode_id = AMDGPU_UCODE_ID_CP_MEC1;

0 commit comments

Comments
 (0)