diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-03-14 17:57:35 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-24 17:41:54 -0400 |
commit | 380cc704398f9d11aed6c2b17ede6107a577608c (patch) | |
tree | c2c02974fbb77fa157f05f9bfd618276e4bc69dc | |
parent | 401b58ceb598aca618c8df4ce99cb2a7100aa39b (diff) |
drm/amdgpu/raven: power up/down VCN via the SMU (v2)
By default VCN is powered down like SDMA, power it up/down
on driver load/unload.
[Rui: Fix to add the parameter 0 to un-gate VCN] v2
Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smumgr/rv_smumgr.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/rv_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/rv_smumgr.c index 6c931baeeb15..b69dcb9e6a39 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/rv_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/rv_smumgr.c @@ -264,6 +264,27 @@ static int rv_smc_disable_sdma(struct pp_smumgr *smumgr) return 0; } +/* vcn is disabled by default in vbios, need to re-enable in driver */ +static int rv_smc_enable_vcn(struct pp_smumgr *smumgr) +{ + PP_ASSERT_WITH_CODE(!rv_send_msg_to_smc_with_parameter(smumgr, + PPSMC_MSG_PowerUpVcn, 0), + "Attempt to power up vcn Failed!", + return -EINVAL); + + return 0; +} + +static int rv_smc_disable_vcn(struct pp_smumgr *smumgr) +{ + PP_ASSERT_WITH_CODE(!rv_send_msg_to_smc_with_parameter(smumgr, + PPSMC_MSG_PowerDownVcn, 0), + "Attempt to power down vcn Failed!", + return -EINVAL); + + return 0; +} + static int rv_smu_fini(struct pp_smumgr *smumgr) { struct rv_smumgr *priv = @@ -271,6 +292,7 @@ static int rv_smu_fini(struct pp_smumgr *smumgr) if (priv) { rv_smc_disable_sdma(smumgr); + rv_smc_disable_vcn(smumgr); cgs_free_gpu_mem(smumgr->device, priv->smu_tables.entry[WMTABLE].handle); cgs_free_gpu_mem(smumgr->device, @@ -288,6 +310,8 @@ static int rv_start_smu(struct pp_smumgr *smumgr) return -EINVAL; if (rv_smc_enable_sdma(smumgr)) return -EINVAL; + if (rv_smc_enable_vcn(smumgr)) + return -EINVAL; return 0; } |