Commit e4deccc1 authored by Lang Yu's avatar Lang Yu Committed by Alex Deucher

drm/amdgpu: add support to power up/down UMSCH by SMU

Power up/down UMSCH by SMU.
Signed-off-by: default avatarLang Yu <Lang.Yu@amd.com>
Acked-by: default avatarLeo Liu <leo.liu@amd.com>
Acked-by: default avatarVeerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 56d3de7d
...@@ -299,6 +299,29 @@ static int smu_dpm_set_vpe_enable(struct smu_context *smu, ...@@ -299,6 +299,29 @@ static int smu_dpm_set_vpe_enable(struct smu_context *smu,
return ret; return ret;
} }
static int smu_dpm_set_umsch_mm_enable(struct smu_context *smu,
bool enable)
{
struct smu_power_context *smu_power = &smu->smu_power;
struct smu_power_gate *power_gate = &smu_power->power_gate;
int ret = 0;
if (!smu->adev->enable_umsch_mm)
return 0;
if (!smu->ppt_funcs->dpm_set_umsch_mm_enable)
return 0;
if (atomic_read(&power_gate->umsch_mm_gated) ^ enable)
return 0;
ret = smu->ppt_funcs->dpm_set_umsch_mm_enable(smu, enable);
if (!ret)
atomic_set(&power_gate->umsch_mm_gated, !enable);
return ret;
}
/** /**
* smu_dpm_set_power_gate - power gate/ungate the specific IP block * smu_dpm_set_power_gate - power gate/ungate the specific IP block
* *
...@@ -1196,6 +1219,7 @@ static int smu_sw_init(void *handle) ...@@ -1196,6 +1219,7 @@ static int smu_sw_init(void *handle)
atomic_set(&smu->smu_power.power_gate.vcn_gated, 1); atomic_set(&smu->smu_power.power_gate.vcn_gated, 1);
atomic_set(&smu->smu_power.power_gate.jpeg_gated, 1); atomic_set(&smu->smu_power.power_gate.jpeg_gated, 1);
atomic_set(&smu->smu_power.power_gate.vpe_gated, 1); atomic_set(&smu->smu_power.power_gate.vpe_gated, 1);
atomic_set(&smu->smu_power.power_gate.umsch_mm_gated, 1);
smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT]; smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT] = 0; smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT] = 0;
...@@ -1549,6 +1573,7 @@ static int smu_hw_init(void *handle) ...@@ -1549,6 +1573,7 @@ static int smu_hw_init(void *handle)
smu_dpm_set_vcn_enable(smu, true); smu_dpm_set_vcn_enable(smu, true);
smu_dpm_set_jpeg_enable(smu, true); smu_dpm_set_jpeg_enable(smu, true);
smu_dpm_set_vpe_enable(smu, true); smu_dpm_set_vpe_enable(smu, true);
smu_dpm_set_umsch_mm_enable(smu, true);
smu_set_gfx_cgpg(smu, true); smu_set_gfx_cgpg(smu, true);
} }
...@@ -1726,6 +1751,7 @@ static int smu_hw_fini(void *handle) ...@@ -1726,6 +1751,7 @@ static int smu_hw_fini(void *handle)
smu_dpm_set_vcn_enable(smu, false); smu_dpm_set_vcn_enable(smu, false);
smu_dpm_set_jpeg_enable(smu, false); smu_dpm_set_jpeg_enable(smu, false);
smu_dpm_set_vpe_enable(smu, false); smu_dpm_set_vpe_enable(smu, false);
smu_dpm_set_umsch_mm_enable(smu, false);
adev->vcn.cur_state = AMD_PG_STATE_GATE; adev->vcn.cur_state = AMD_PG_STATE_GATE;
adev->jpeg.cur_state = AMD_PG_STATE_GATE; adev->jpeg.cur_state = AMD_PG_STATE_GATE;
......
...@@ -375,6 +375,7 @@ struct smu_power_gate { ...@@ -375,6 +375,7 @@ struct smu_power_gate {
atomic_t vcn_gated; atomic_t vcn_gated;
atomic_t jpeg_gated; atomic_t jpeg_gated;
atomic_t vpe_gated; atomic_t vpe_gated;
atomic_t umsch_mm_gated;
}; };
struct smu_power_context { struct smu_power_context {
......
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