Commit 85dec717 authored by Jiansong Chen's avatar Jiansong Chen Committed by Alex Deucher

drm/amd/powerplay: retrieve VCN dpm table per instances

To accommodate VCN instances variance, otherwise it may trigger
smu response error for configuration with less instances.
Signed-off-by: default avatarJiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: default avatarTao Zhou <tao.zhou1@amd.com>
Reviewed-by: default avatarLikun Gao <Likun.Gao@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8985adb6
...@@ -525,6 +525,7 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu) ...@@ -525,6 +525,7 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context; struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
PPTable_t *driver_ppt = smu->smu_table.driver_pptable; PPTable_t *driver_ppt = smu->smu_table.driver_pptable;
struct smu_11_0_dpm_table *dpm_table; struct smu_11_0_dpm_table *dpm_table;
struct amdgpu_device *adev = smu->adev;
int ret = 0; int ret = 0;
/* socclk dpm table setup */ /* socclk dpm table setup */
...@@ -618,21 +619,24 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu) ...@@ -618,21 +619,24 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
} }
/* vclk1 dpm table setup */ /* vclk1 dpm table setup */
dpm_table = &dpm_context->dpm_tables.vclk1_table; if (adev->vcn.num_vcn_inst > 1) {
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) { dpm_table = &dpm_context->dpm_tables.vclk1_table;
ret = smu_v11_0_set_single_dpm_table(smu, if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
SMU_VCLK1, ret = smu_v11_0_set_single_dpm_table(smu,
dpm_table); SMU_VCLK1,
if (ret) dpm_table);
return ret; if (ret)
dpm_table->is_fine_grained = return ret;
!driver_ppt->DpmDescriptor[PPCLK_VCLK_1].SnapToDiscrete; dpm_table->is_fine_grained =
} else { !driver_ppt->DpmDescriptor[PPCLK_VCLK_1].SnapToDiscrete;
dpm_table->count = 1; } else {
dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.vclk / 100; dpm_table->count = 1;
dpm_table->dpm_levels[0].enabled = true; dpm_table->dpm_levels[0].value =
dpm_table->min = dpm_table->dpm_levels[0].value; smu->smu_table.boot_values.vclk / 100;
dpm_table->max = dpm_table->dpm_levels[0].value; dpm_table->dpm_levels[0].enabled = true;
dpm_table->min = dpm_table->dpm_levels[0].value;
dpm_table->max = dpm_table->dpm_levels[0].value;
}
} }
/* dclk0 dpm table setup */ /* dclk0 dpm table setup */
...@@ -654,21 +658,24 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu) ...@@ -654,21 +658,24 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
} }
/* dclk1 dpm table setup */ /* dclk1 dpm table setup */
dpm_table = &dpm_context->dpm_tables.dclk1_table; if (adev->vcn.num_vcn_inst > 1) {
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) { dpm_table = &dpm_context->dpm_tables.dclk1_table;
ret = smu_v11_0_set_single_dpm_table(smu, if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
SMU_DCLK1, ret = smu_v11_0_set_single_dpm_table(smu,
dpm_table); SMU_DCLK1,
if (ret) dpm_table);
return ret; if (ret)
dpm_table->is_fine_grained = return ret;
!driver_ppt->DpmDescriptor[PPCLK_DCLK_1].SnapToDiscrete; dpm_table->is_fine_grained =
} else { !driver_ppt->DpmDescriptor[PPCLK_DCLK_1].SnapToDiscrete;
dpm_table->count = 1; } else {
dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.dclk / 100; dpm_table->count = 1;
dpm_table->dpm_levels[0].enabled = true; dpm_table->dpm_levels[0].value =
dpm_table->min = dpm_table->dpm_levels[0].value; smu->smu_table.boot_values.dclk / 100;
dpm_table->max = dpm_table->dpm_levels[0].value; dpm_table->dpm_levels[0].enabled = true;
dpm_table->min = dpm_table->dpm_levels[0].value;
dpm_table->max = dpm_table->dpm_levels[0].value;
}
} }
/* dcefclk dpm table setup */ /* dcefclk dpm table setup */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment