Skip to content

Commit 57a8011

Browse files
Kenneth Fengalexdeucher
authored andcommitted
drm/amd/pm: workaround for compute workload type on some skus
On smu 13.0.0, the compute workload type cannot be set on all the skus due to some other problems. This workaround is to make sure compute workload type can also run on some specific skus. v2: keep the variable consistent Signed-off-by: Kenneth Feng <[email protected]> Acked-by: Lijo Lazar <[email protected]> Reviewed-by: Feifei Xu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 389c6b3 commit 57a8011

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,10 +2179,39 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu,
21792179
}
21802180
}
21812181

2182-
/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
2183-
workload_type = smu_cmn_to_asic_specific_index(smu,
2182+
if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_COMPUTE &&
2183+
(((smu->adev->pdev->device == 0x744C) && (smu->adev->pdev->revision == 0xC8)) ||
2184+
((smu->adev->pdev->device == 0x744C) && (smu->adev->pdev->revision == 0xCC)))) {
2185+
ret = smu_cmn_update_table(smu,
2186+
SMU_TABLE_ACTIVITY_MONITOR_COEFF,
2187+
WORKLOAD_PPLIB_COMPUTE_BIT,
2188+
(void *)(&activity_monitor_external),
2189+
false);
2190+
if (ret) {
2191+
dev_err(smu->adev->dev, "[%s] Failed to get activity monitor!", __func__);
2192+
return ret;
2193+
}
2194+
2195+
ret = smu_cmn_update_table(smu,
2196+
SMU_TABLE_ACTIVITY_MONITOR_COEFF,
2197+
WORKLOAD_PPLIB_CUSTOM_BIT,
2198+
(void *)(&activity_monitor_external),
2199+
true);
2200+
if (ret) {
2201+
dev_err(smu->adev->dev, "[%s] Failed to set activity monitor!", __func__);
2202+
return ret;
2203+
}
2204+
2205+
workload_type = smu_cmn_to_asic_specific_index(smu,
2206+
CMN2ASIC_MAPPING_WORKLOAD,
2207+
PP_SMC_POWER_PROFILE_CUSTOM);
2208+
} else {
2209+
/* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
2210+
workload_type = smu_cmn_to_asic_specific_index(smu,
21842211
CMN2ASIC_MAPPING_WORKLOAD,
21852212
smu->power_profile_mode);
2213+
}
2214+
21862215
if (workload_type < 0)
21872216
return -EINVAL;
21882217

0 commit comments

Comments
 (0)