mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
drm/amd/powerplay/rv: power up/down sdma via the SMU
sdma is powered down by default in vbios, need to power up in driver init. Power it down again on driver tear down. Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a960d61cbd
commit
401b58ceb5
|
|
@ -243,6 +243,26 @@ static int rv_verify_smc_interface(struct pp_smumgr *smumgr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* sdma is disabled by default in vbios, need to re-enable in driver */
|
||||||
|
static int rv_smc_enable_sdma(struct pp_smumgr *smumgr)
|
||||||
|
{
|
||||||
|
PP_ASSERT_WITH_CODE(!rv_send_msg_to_smc(smumgr,
|
||||||
|
PPSMC_MSG_PowerUpSdma),
|
||||||
|
"Attempt to power up sdma Failed!",
|
||||||
|
return -EINVAL);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int rv_smc_disable_sdma(struct pp_smumgr *smumgr)
|
||||||
|
{
|
||||||
|
PP_ASSERT_WITH_CODE(!rv_send_msg_to_smc(smumgr,
|
||||||
|
PPSMC_MSG_PowerDownSdma),
|
||||||
|
"Attempt to power down sdma Failed!",
|
||||||
|
return -EINVAL);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int rv_smu_fini(struct pp_smumgr *smumgr)
|
static int rv_smu_fini(struct pp_smumgr *smumgr)
|
||||||
{
|
{
|
||||||
|
|
@ -250,6 +270,7 @@ static int rv_smu_fini(struct pp_smumgr *smumgr)
|
||||||
(struct rv_smumgr *)(smumgr->backend);
|
(struct rv_smumgr *)(smumgr->backend);
|
||||||
|
|
||||||
if (priv) {
|
if (priv) {
|
||||||
|
rv_smc_disable_sdma(smumgr);
|
||||||
cgs_free_gpu_mem(smumgr->device,
|
cgs_free_gpu_mem(smumgr->device,
|
||||||
priv->smu_tables.entry[WMTABLE].handle);
|
priv->smu_tables.entry[WMTABLE].handle);
|
||||||
cgs_free_gpu_mem(smumgr->device,
|
cgs_free_gpu_mem(smumgr->device,
|
||||||
|
|
@ -265,6 +286,8 @@ static int rv_start_smu(struct pp_smumgr *smumgr)
|
||||||
{
|
{
|
||||||
if (rv_verify_smc_interface(smumgr))
|
if (rv_verify_smc_interface(smumgr))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (rv_smc_enable_sdma(smumgr))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user