Commit 162aa5c3 authored by Kenneth Feng's avatar Kenneth Feng Committed by Alex Deucher

amd/powerplay: update the vcn pg

update the vcn pg function in navi10.
Signed-off-by: default avatarKenneth Feng <kenneth.feng@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9c62f993
...@@ -439,9 +439,15 @@ struct smu_dpm_context { ...@@ -439,9 +439,15 @@ struct smu_dpm_context {
struct mclock_latency_table *mclk_latency_table; struct mclock_latency_table *mclk_latency_table;
}; };
struct smu_power_gate {
bool uvd_gated;
bool vce_gated;
};
struct smu_power_context { struct smu_power_context {
void *power_context; void *power_context;
uint32_t power_context_size; uint32_t power_context_size;
struct smu_power_gate power_gate;
}; };
......
...@@ -521,15 +521,21 @@ static int navi10_set_default_dpm_table(struct smu_context *smu) ...@@ -521,15 +521,21 @@ static int navi10_set_default_dpm_table(struct smu_context *smu)
static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable) static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable)
{ {
int ret = 0; int ret = 0;
struct smu_power_context *smu_power = &smu->smu_power;
struct smu_power_gate *power_gate = &smu_power->power_gate;
if (enable) { if (enable && power_gate->uvd_gated) {
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 1); ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 1);
if (ret) if (ret)
return ret; return ret;
power_gate->uvd_gated = false;
} else { } else {
ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn); if (!enable && !power_gate->uvd_gated) {
if (ret) ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn);
return ret; if (ret)
return ret;
power_gate->uvd_gated = true;
}
} }
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