drm/amd/powerplay: propagate errors in phm_get_voltage_evv_on_sclk
Subsystems (2)
PATCH 1/4 drm/amd/powerplay: propagate errors in phm_get_voltage_evv_on_sclk
Missing for one case.
bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=185681
https://bugs.freedesktop.org/show_bug.cgi?id=98357
--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +1 -1
@@ -711,7 +711,7 @@ int phm_get_voltage_evv_on_sclk(struct pp_hwmgr *hwmgr, uint8_t voltage_type,int ret =0 ;if (hwmgr->chip_id <CHIP_POLARIS10 ) { -atomctrl_get_voltage_evv_on_sclk (hwmgr, voltage_type, sclk, id, voltage); + ret =atomctrl_get_voltage_evv_on_sclk (hwmgr, voltage_type, sclk, id, voltage);if (*voltage >=2000 || *voltage ==0 ) *voltage =1150 ; }else {
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1478795135-11758-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/4 drm/amd/powerplay: update phm_get_voltage_evv_on_sclk for iceland
Was missing the handling for iceland.
bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=185681
https://bugs.freedesktop.org/show_bug.cgi?id=98357
--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +3 -1
@@ -710,7 +710,9 @@ int phm_get_voltage_evv_on_sclk(struct pp_hwmgr *hwmgr, uint8_t voltage_type,uint32_t vol;int ret =0 ; -if (hwmgr->chip_id <CHIP_POLARIS10 ) { +if (hwmgr->chip_id <CHIP_TONGA ) { + ret =atomctrl_get_voltage_evv (hwmgr, id, voltage); + }else if (hwmgr->chip_id <CHIP_POLARIS10 ) { ret =atomctrl_get_voltage_evv_on_sclk (hwmgr, voltage_type, sclk, id, voltage);if (*voltage >=2000 || *voltage ==0 ) *voltage =1150 ;
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/4 drm/amd/powerplay/smu7: fix checks in smu7_get_evv_voltages (v2)
In reply to a message not in the archiveOnly check if the tables exist in relevant configs. This fixes a failure on V0 tables.
v2: fix version check as suggested by Rex
bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=185681
https://bugs.freedesktop.org/show_bug.cgi?id=98357
--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +10 -7
@@ -1460,19 +1460,19 @@ static int smu7_get_evv_voltages(struct pp_hwmgr *hwmgr)struct phm_ppt_v1_clock_voltage_dependency_table *sclk_table =NULL ; -if (table_info ==NULL ) -return -EINVAL ; - - sclk_table = table_info->vdd_dep_on_sclk; -for (i =0 ; i <SMU7_MAX_LEAKAGE_COUNT ; i++) { vv_id =ATOM_VIRTUAL_VOLTAGE_ID0 + i;if (data->vdd_gfx_control ==SMU7_VOLTAGE_CONTROL_BY_SVID2 ) { -if (0 ==phm_get_sclk_for_voltage_evv (hwmgr, +if ((hwmgr->pp_table_version ==PP_TABLE_V1 ) + && !phm_get_sclk_for_voltage_evv (hwmgr, table_info->vddgfx_lookup_table, vv_id, &sclk)) {if (phm_cap_enabled (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_ClockStretcher)) { +if (table_info ==NULL ) +return -EINVAL ; + sclk_table = table_info->vdd_dep_on_sclk; +for (j =1 ; j < sclk_table->count; j++) {if (sclk_table->entries[j].clk == sclk && sclk_table->entries[j].cks_enable ==0 ) {
@@ -1498,12 +1498,15 @@ static int smu7_get_evv_voltages(struct pp_hwmgr *hwmgr) } } }else { -if ((hwmgr->pp_table_version ==PP_TABLE_V0 ) || !phm_get_sclk_for_voltage_evv (hwmgr, table_info->vddc_lookup_table, vv_id, &sclk)) {if (phm_cap_enabled (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_ClockStretcher)) { +if (table_info ==NULL ) +return -EINVAL ; + sclk_table = table_info->vdd_dep_on_sclk; +for (j =1 ; j < sclk_table->count; j++) {if (sclk_table->entries[j].clk == sclk && sclk_table->entries[j].cks_enable ==0 ) {
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/4 drm/amd/powerplay: implement get_clock_by_type for iceland.
In reply to a message not in the archiveFrom: Rex Zhu <[email protected]>
iceland use pptable v0.
--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 51 +++++++++++++++--------- 1 file changed, 33 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +33 -18
@@ -4233,18 +4233,26 @@ static int smu7_get_sclks(struct pp_hwmgr *hwmgr, struct amd_pp_clocks *clocks) {struct phm_ppt_v1_information *table_info = (struct phm_ppt_v1_information *)hwmgr->pptable; -struct phm_ppt_v1_clock_voltage_dependency_table *dep_sclk_table; +struct phm_ppt_v1_clock_voltage_dependency_table *dep_sclk_table =NULL ; +struct phm_clock_voltage_dependency_table *sclk_table;int i; -if (table_info ==NULL ) -return -EINVAL ; - - dep_sclk_table = table_info->vdd_dep_on_sclk; - -for (i =0 ; i < dep_sclk_table->count; i++) { - clocks->clock[i] = dep_sclk_table->entries[i].clk; - clocks->count++; +if (hwmgr->pp_table_version ==PP_TABLE_V1 ) { +if (table_info ==NULL || table_info->vdd_dep_on_sclk ==NULL ) +return -EINVAL ; + dep_sclk_table = table_info->vdd_dep_on_sclk; +for (i =0 ; i < dep_sclk_table->count; i++) { + clocks->clock[i] = dep_sclk_table->entries[i].clk; + clocks->count++; + } + }else if (hwmgr->pp_table_version ==PP_TABLE_V0 ) { + sclk_table = hwmgr->dyn_state.vddc_dependency_on_sclk; +for (i =0 ; i < sclk_table->count; i++) { + clocks->clock[i] = sclk_table->entries[i].clk; + clocks->count++; + } } +return 0 ; }
@@ -4266,17 +4274,24 @@ static int smu7_get_mclks(struct pp_hwmgr *hwmgr, struct amd_pp_clocks *clocks) (struct phm_ppt_v1_information *)hwmgr->pptable;struct phm_ppt_v1_clock_voltage_dependency_table *dep_mclk_table;int i; +struct phm_clock_voltage_dependency_table *mclk_table; -if (table_info ==NULL ) -return -EINVAL ; - - dep_mclk_table = table_info->vdd_dep_on_mclk; - -for (i =0 ; i < dep_mclk_table->count; i++) { - clocks->clock[i] = dep_mclk_table->entries[i].clk; - clocks->latency[i] =smu7_get_mem_latency (hwmgr, +if (hwmgr->pp_table_version ==PP_TABLE_V1 ) { +if (table_info ==NULL ) +return -EINVAL ; + dep_mclk_table = table_info->vdd_dep_on_mclk; +for (i =0 ; i < dep_mclk_table->count; i++) { + clocks->clock[i] = dep_mclk_table->entries[i].clk; + clocks->latency[i] =smu7_get_mem_latency (hwmgr, dep_mclk_table->entries[i].clk); - clocks->count++; + clocks->count++; + } + }else if (hwmgr->pp_table_version ==PP_TABLE_V0 ) { + mclk_table = hwmgr->dyn_state.vddc_dependency_on_mclk; +for (i =0 ; i < mclk_table->count; i++) { + clocks->clock[i] = mclk_table->entries[i].clk; + clocks->count++; + } }return 0 ; }
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx