Commit e02e4d51 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: cache the software_shutdown_temp

As it's needed in the succeeding thermal irq setting.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2b1f12a2
...@@ -1029,6 +1029,9 @@ static int arcturus_force_clk_levels(struct smu_context *smu, ...@@ -1029,6 +1029,9 @@ static int arcturus_force_clk_levels(struct smu_context *smu,
static int arcturus_get_thermal_temperature_range(struct smu_context *smu, static int arcturus_get_thermal_temperature_range(struct smu_context *smu,
struct smu_temperature_range *range) struct smu_temperature_range *range)
{ {
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;
PPTable_t *pptable = smu->smu_table.driver_pptable; PPTable_t *pptable = smu->smu_table.driver_pptable;
if (!range) if (!range)
...@@ -1046,6 +1049,7 @@ static int arcturus_get_thermal_temperature_range(struct smu_context *smu, ...@@ -1046,6 +1049,7 @@ static int arcturus_get_thermal_temperature_range(struct smu_context *smu,
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES; SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
range->mem_emergency_max = (pptable->TmemLimit + CTF_OFFSET_MEM)* range->mem_emergency_max = (pptable->TmemLimit + CTF_OFFSET_MEM)*
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES; SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
range->software_shutdown_temp = powerplay_table->software_shutdown_temp;
return 0; return 0;
} }
......
...@@ -119,6 +119,7 @@ struct smu_temperature_range { ...@@ -119,6 +119,7 @@ struct smu_temperature_range {
int mem_min; int mem_min;
int mem_crit_max; int mem_crit_max;
int mem_emergency_max; int mem_emergency_max;
int software_shutdown_temp;
}; };
struct smu_state_validation_block { struct smu_state_validation_block {
......
...@@ -1856,6 +1856,9 @@ static int navi10_get_uclk_dpm_states(struct smu_context *smu, uint32_t *clocks_ ...@@ -1856,6 +1856,9 @@ static int navi10_get_uclk_dpm_states(struct smu_context *smu, uint32_t *clocks_
static int navi10_get_thermal_temperature_range(struct smu_context *smu, static int navi10_get_thermal_temperature_range(struct smu_context *smu,
struct smu_temperature_range *range) struct smu_temperature_range *range)
{ {
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;
PPTable_t *pptable = smu->smu_table.driver_pptable; PPTable_t *pptable = smu->smu_table.driver_pptable;
if (!range) if (!range)
...@@ -1873,6 +1876,7 @@ static int navi10_get_thermal_temperature_range(struct smu_context *smu, ...@@ -1873,6 +1876,7 @@ static int navi10_get_thermal_temperature_range(struct smu_context *smu,
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES; SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
range->mem_emergency_max = (pptable->TmemLimit + CTF_OFFSET_MEM)* range->mem_emergency_max = (pptable->TmemLimit + CTF_OFFSET_MEM)*
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES; SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
range->software_shutdown_temp = powerplay_table->software_shutdown_temp;
return 0; return 0;
} }
......
...@@ -1645,6 +1645,9 @@ static int sienna_cichlid_get_uclk_dpm_states(struct smu_context *smu, uint32_t ...@@ -1645,6 +1645,9 @@ static int sienna_cichlid_get_uclk_dpm_states(struct smu_context *smu, uint32_t
static int sienna_cichlid_get_thermal_temperature_range(struct smu_context *smu, static int sienna_cichlid_get_thermal_temperature_range(struct smu_context *smu,
struct smu_temperature_range *range) struct smu_temperature_range *range)
{ {
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_7_powerplay_table *powerplay_table =
table_context->power_play_table;
PPTable_t *pptable = smu->smu_table.driver_pptable; PPTable_t *pptable = smu->smu_table.driver_pptable;
if (!range) if (!range)
...@@ -1662,6 +1665,7 @@ static int sienna_cichlid_get_thermal_temperature_range(struct smu_context *smu, ...@@ -1662,6 +1665,7 @@ static int sienna_cichlid_get_thermal_temperature_range(struct smu_context *smu,
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES; SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
range->mem_emergency_max = (pptable->TemperatureLimit[TEMP_MEM] + CTF_OFFSET_MEM)* range->mem_emergency_max = (pptable->TemperatureLimit[TEMP_MEM] + CTF_OFFSET_MEM)*
SMU_TEMPERATURE_UNITS_PER_CENTIGRADES; SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
range->software_shutdown_temp = powerplay_table->software_shutdown_temp;
return 0; return 0;
} }
......
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