mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
drm/amd/powerplay: report bootup clock as max supported on dpm disabled
With gfxclk or uclk dpm disabled, it's reasonable to report bootup clock as the max supported. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
fbdc5d8d84
commit
3a48c10d7f
@ -137,12 +137,37 @@ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
|
|||||||
{
|
{
|
||||||
int ret = 0, clk_id = 0;
|
int ret = 0, clk_id = 0;
|
||||||
uint32_t param = 0;
|
uint32_t param = 0;
|
||||||
|
uint32_t clock_limit;
|
||||||
|
|
||||||
if (!min && !max)
|
if (!min && !max)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!smu_clk_dpm_is_enabled(smu, clk_type))
|
if (!smu_clk_dpm_is_enabled(smu, clk_type)) {
|
||||||
|
switch (clk_type) {
|
||||||
|
case SMU_MCLK:
|
||||||
|
case SMU_UCLK:
|
||||||
|
clock_limit = smu->smu_table.boot_values.uclk;
|
||||||
|
break;
|
||||||
|
case SMU_GFXCLK:
|
||||||
|
case SMU_SCLK:
|
||||||
|
clock_limit = smu->smu_table.boot_values.gfxclk;
|
||||||
|
break;
|
||||||
|
case SMU_SOCCLK:
|
||||||
|
clock_limit = smu->smu_table.boot_values.socclk;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
clock_limit = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* clock in Mhz unit */
|
||||||
|
if (min)
|
||||||
|
*min = clock_limit / 100;
|
||||||
|
if (max)
|
||||||
|
*max = clock_limit / 100;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
mutex_lock(&smu->mutex);
|
mutex_lock(&smu->mutex);
|
||||||
clk_id = smu_clk_get_index(smu, clk_type);
|
clk_id = smu_clk_get_index(smu, clk_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user