diff options
author | Aaron Liu <[email protected]> | 2021-01-07 09:13:35 +0800 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2021-06-04 16:03:13 -0400 |
commit | e44510e24e12ff3d02be4445d8c5a9e2d7699c17 (patch) | |
tree | bb24ab0e67832da2c756a2a61a32ab94b693f829 | |
parent | 94adc46fb01c3276d51424d5fd0f68ce4e870abf (diff) |
drm/amdgpu/pm: add set_driver_table_location implementation for yellow carp
This patch adds set_driver_table_location implementation for yellow
carp.
Signed-off-by: Aaron Liu <[email protected]>
Reviewed-by: Huang Rui <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r-- | drivers/gpu/drm/amd/pm/inc/smu_v13_0_1.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_1.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v13_0_1.h b/drivers/gpu/drm/amd/pm/inc/smu_v13_0_1.h index b2e9258dc06c..9339c39c78fe 100644 --- a/drivers/gpu/drm/amd/pm/inc/smu_v13_0_1.h +++ b/drivers/gpu/drm/amd/pm/inc/smu_v13_0_1.h @@ -48,5 +48,6 @@ int smu_v13_0_1_fini_smc_tables(struct smu_context *smu); int smu_v13_0_1_set_default_dpm_tables(struct smu_context *smu); +int smu_v13_0_1_set_driver_table_location(struct smu_context *smu); #endif #endif diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_1.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_1.c index 6ad2fcb2af2f..4e41c026a2e6 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_1.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_1.c @@ -129,3 +129,26 @@ int smu_v13_0_1_set_default_dpm_tables(struct smu_context *smu) return smu_cmn_update_table(smu, SMU_TABLE_DPMCLOCKS, 0, smu_table->clocks_table, false); } +int smu_v13_0_1_set_driver_table_location(struct smu_context *smu) +{ + struct smu_table *driver_table = &smu->smu_table.driver_table; + int ret = 0; + + if (!driver_table->mc_address) + return 0; + + ret = smu_cmn_send_smc_msg_with_param(smu, + SMU_MSG_SetDriverDramAddrHigh, + upper_32_bits(driver_table->mc_address), + NULL); + + if (ret) + return ret; + + ret = smu_cmn_send_smc_msg_with_param(smu, + SMU_MSG_SetDriverDramAddrLow, + lower_32_bits(driver_table->mc_address), + NULL); + + return ret; +} diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c index d849fa83f01f..cfe086658ce5 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c @@ -151,6 +151,7 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .is_dpm_running = yellow_carp_is_dpm_running, .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask, + .set_driver_table_location = smu_v13_0_1_set_driver_table_location, }; void yellow_carp_set_ppt_funcs(struct smu_context *smu) |