Skip to content

Commit d507742

Browse files
Timur Kristófalexdeucher
authored andcommitted
drm/amd/pm: Don't clear SI SMC table when setting power limit
There is no reason to clear the SMC table. We also don't need to recalculate the power limit then. Fixes: 841686d ("drm/amdgpu: add SI DPM support (v4)") Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit e214d62)
1 parent 4ca284c commit d507742

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

  • drivers/gpu/drm/amd/pm/legacy-dpm

drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,8 +2273,6 @@ static int si_populate_smc_tdp_limits(struct amdgpu_device *adev,
22732273
if (scaling_factor == 0)
22742274
return -EINVAL;
22752275

2276-
memset(smc_table, 0, sizeof(SISLANDS_SMC_STATETABLE));
2277-
22782276
ret = si_calculate_adjusted_tdp_limits(adev,
22792277
false, /* ??? */
22802278
adev->pm.dpm.tdp_adjustment,
@@ -2328,16 +2326,8 @@ static int si_populate_smc_tdp_limits_2(struct amdgpu_device *adev,
23282326

23292327
if (ni_pi->enable_power_containment) {
23302328
SISLANDS_SMC_STATETABLE *smc_table = &si_pi->smc_statetable;
2331-
u32 scaling_factor = si_get_smc_power_scaling_factor(adev);
23322329
int ret;
23332330

2334-
memset(smc_table, 0, sizeof(SISLANDS_SMC_STATETABLE));
2335-
2336-
smc_table->dpm2Params.NearTDPLimit =
2337-
cpu_to_be32(si_scale_power_for_smc(adev->pm.dpm.near_tdp_limit_adjusted, scaling_factor) * 1000);
2338-
smc_table->dpm2Params.SafePowerLimit =
2339-
cpu_to_be32(si_scale_power_for_smc((adev->pm.dpm.near_tdp_limit_adjusted * SISLANDS_DPM2_TDP_SAFE_LIMIT_PERCENT) / 100, scaling_factor) * 1000);
2340-
23412331
ret = amdgpu_si_copy_bytes_to_smc(adev,
23422332
(si_pi->state_table_start +
23432333
offsetof(SISLANDS_SMC_STATETABLE, dpm2Params) +

0 commit comments

Comments
 (0)