aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2017-11-08 03:39:00 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-01-10 15:44:55 -0500
commitad8cec7df5d4bf3b1109fabbb1d61663857045ae (patch)
tree6825d3ca0010c12b2294fe40be084d04914302c0
parentd25426495f69be24b4f7b1da1c66ba6a34e49cdd (diff)
drm/amd/pp: Implement get_max_high_clocks for CI/VI
v2: add table length check. DC component expect PP to give max engine clock and memory clock through pp_get_display_mode_validation_clocks on DGPU as well. This patch can fix MultiGPU-Display blank out with 1 IGPU-4k display and 2 DGPU-two 4K displays. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 40adc855c416..41e42beff213 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -4651,6 +4651,25 @@ static int smu7_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,
4651 return 0; 4651 return 0;
4652} 4652}
4653 4653
4654static int smu7_get_max_high_clocks(struct pp_hwmgr *hwmgr,
4655 struct amd_pp_simple_clock_info *clocks)
4656{
4657 struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
4658 struct smu7_single_dpm_table *sclk_table = &(data->dpm_table.sclk_table);
4659 struct smu7_single_dpm_table *mclk_table = &(data->dpm_table.mclk_table);
4660
4661 if (clocks == NULL)
4662 return -EINVAL;
4663
4664 clocks->memory_max_clock = mclk_table->count > 1 ?
4665 mclk_table->dpm_levels[mclk_table->count-1].value :
4666 mclk_table->dpm_levels[0].value;
4667 clocks->engine_max_clock = sclk_table->count > 1 ?
4668 sclk_table->dpm_levels[sclk_table->count-1].value :
4669 sclk_table->dpm_levels[0].value;
4670 return 0;
4671}
4672
4654static const struct pp_hwmgr_func smu7_hwmgr_funcs = { 4673static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
4655 .backend_init = &smu7_hwmgr_backend_init, 4674 .backend_init = &smu7_hwmgr_backend_init,
4656 .backend_fini = &smu7_hwmgr_backend_fini, 4675 .backend_fini = &smu7_hwmgr_backend_fini,
@@ -4703,6 +4722,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
4703 .disable_smc_firmware_ctf = smu7_thermal_disable_alert, 4722 .disable_smc_firmware_ctf = smu7_thermal_disable_alert,
4704 .start_thermal_controller = smu7_start_thermal_controller, 4723 .start_thermal_controller = smu7_start_thermal_controller,
4705 .notify_cac_buffer_info = smu7_notify_cac_buffer_info, 4724 .notify_cac_buffer_info = smu7_notify_cac_buffer_info,
4725 .get_max_high_clocks = smu7_get_max_high_clocks,
4706}; 4726};
4707 4727
4708uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock, 4728uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock,