Skip to content

Commit 85dec71

Browse files
Jiansong Chenalexdeucher
authored andcommitted
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: Jiansong Chen <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Reviewed-by: Likun Gao <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8985adb commit 85dec71

File tree

1 file changed

+37
-30
lines changed

1 file changed

+37
-30
lines changed

drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
525525
struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
526526
PPTable_t *driver_ppt = smu->smu_table.driver_pptable;
527527
struct smu_11_0_dpm_table *dpm_table;
528+
struct amdgpu_device *adev = smu->adev;
528529
int ret = 0;
529530

530531
/* socclk dpm table setup */
@@ -618,21 +619,24 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
618619
}
619620

620621
/* vclk1 dpm table setup */
621-
dpm_table = &dpm_context->dpm_tables.vclk1_table;
622-
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
623-
ret = smu_v11_0_set_single_dpm_table(smu,
624-
SMU_VCLK1,
625-
dpm_table);
626-
if (ret)
627-
return ret;
628-
dpm_table->is_fine_grained =
629-
!driver_ppt->DpmDescriptor[PPCLK_VCLK_1].SnapToDiscrete;
630-
} else {
631-
dpm_table->count = 1;
632-
dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.vclk / 100;
633-
dpm_table->dpm_levels[0].enabled = true;
634-
dpm_table->min = dpm_table->dpm_levels[0].value;
635-
dpm_table->max = dpm_table->dpm_levels[0].value;
622+
if (adev->vcn.num_vcn_inst > 1) {
623+
dpm_table = &dpm_context->dpm_tables.vclk1_table;
624+
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
625+
ret = smu_v11_0_set_single_dpm_table(smu,
626+
SMU_VCLK1,
627+
dpm_table);
628+
if (ret)
629+
return ret;
630+
dpm_table->is_fine_grained =
631+
!driver_ppt->DpmDescriptor[PPCLK_VCLK_1].SnapToDiscrete;
632+
} else {
633+
dpm_table->count = 1;
634+
dpm_table->dpm_levels[0].value =
635+
smu->smu_table.boot_values.vclk / 100;
636+
dpm_table->dpm_levels[0].enabled = true;
637+
dpm_table->min = dpm_table->dpm_levels[0].value;
638+
dpm_table->max = dpm_table->dpm_levels[0].value;
639+
}
636640
}
637641

638642
/* dclk0 dpm table setup */
@@ -654,21 +658,24 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
654658
}
655659

656660
/* dclk1 dpm table setup */
657-
dpm_table = &dpm_context->dpm_tables.dclk1_table;
658-
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
659-
ret = smu_v11_0_set_single_dpm_table(smu,
660-
SMU_DCLK1,
661-
dpm_table);
662-
if (ret)
663-
return ret;
664-
dpm_table->is_fine_grained =
665-
!driver_ppt->DpmDescriptor[PPCLK_DCLK_1].SnapToDiscrete;
666-
} else {
667-
dpm_table->count = 1;
668-
dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.dclk / 100;
669-
dpm_table->dpm_levels[0].enabled = true;
670-
dpm_table->min = dpm_table->dpm_levels[0].value;
671-
dpm_table->max = dpm_table->dpm_levels[0].value;
661+
if (adev->vcn.num_vcn_inst > 1) {
662+
dpm_table = &dpm_context->dpm_tables.dclk1_table;
663+
if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
664+
ret = smu_v11_0_set_single_dpm_table(smu,
665+
SMU_DCLK1,
666+
dpm_table);
667+
if (ret)
668+
return ret;
669+
dpm_table->is_fine_grained =
670+
!driver_ppt->DpmDescriptor[PPCLK_DCLK_1].SnapToDiscrete;
671+
} else {
672+
dpm_table->count = 1;
673+
dpm_table->dpm_levels[0].value =
674+
smu->smu_table.boot_values.dclk / 100;
675+
dpm_table->dpm_levels[0].enabled = true;
676+
dpm_table->min = dpm_table->dpm_levels[0].value;
677+
dpm_table->max = dpm_table->dpm_levels[0].value;
678+
}
672679
}
673680

674681
/* dcefclk dpm table setup */

0 commit comments

Comments
 (0)