drm/amd/powerplay: fix bug visit array out of bounds
Subsystems (2)
PATCH 1/2 drm/amd/powerplay: fix bug visit array out of bounds
From: Rex Zhu <[email protected]>
Signed-off-by Rex Zhu <[email protected]>
Acked-by Christian König <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c | 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c +1 -1
@@ -1830,7 +1830,7 @@ static uint16_t fiji_find_closest_vddci(struct pp_hwmgr *hwmgr, uint16_t vddci)PP_ASSERT_WITH_CODE (false,"VDDCI is larger than max VDDCI in VDDCI Voltage Table!" , - return vddci_table->entries[i].value); + return vddci_table->entries[i-1].value); } static int fiji_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr,
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c +1 -1
@@ -469,7 +469,7 @@ uint16_t phm_find_closest_vddci(struct pp_atomctrl_voltage_table *vddci_table, uPP_ASSERT_WITH_CODE (false,"VDDCI is larger than max VDDCI in VDDCI Voltage Table!" , - return vddci_table->entries[i].value); + return vddci_table->entries[i-1].value); } int phm_find_boot_level(void *table,
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm/amd/powerplay: delete useless code as pptable changed in vbios.
From: Rex Zhu <[email protected]>
The vbios table changed so this code is useless now.
Signed-off-by Rex Zhu <[email protected]>
Reviewed-by Christian König <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c +0 -21
@@ -2847,27 +2847,6 @@ static int tonga_setup_default_dpm_tables(struct pp_hwmgr *hwmgr) } } -/* Initialize Vddc DPM table based on allow Vddc values. And populate corresponding std values. */ -for (i =0 ; i < allowed_vdd_sclk_table->count; i++) { - data->dpm_table.vddc_table.dpm_levels[i].value = allowed_vdd_mclk_table->entries[i].vddc; -/* tonga_hwmgr->dpm_table.VddcTable.dpm_levels[i].param1 = stdVoltageTable->entries[i].Leakage; */ -/* param1 is for corresponding std voltage */ - data->dpm_table.vddc_table.dpm_levels[i].enabled =1 ; - } - data->dpm_table.vddc_table.count = allowed_vdd_sclk_table->count; - -if (NULL != allowed_vdd_mclk_table) { -/* Initialize Vddci DPM table based on allow Mclk values */ -for (i =0 ; i < allowed_vdd_mclk_table->count; i++) { - data->dpm_table.vdd_ci_table.dpm_levels[i].value = allowed_vdd_mclk_table->entries[i].vddci; - data->dpm_table.vdd_ci_table.dpm_levels[i].enabled =1 ; - data->dpm_table.mvdd_table.dpm_levels[i].value = allowed_vdd_mclk_table->entries[i].mvdd; - data->dpm_table.mvdd_table.dpm_levels[i].enabled =1 ; - } - data->dpm_table.vdd_ci_table.count = allowed_vdd_mclk_table->count; - data->dpm_table.mvdd_table.count = allowed_vdd_mclk_table->count; - } -/* setup PCIE gen speed levels*/ tonga_setup_default_pcie_tables (hwmgr);
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel