aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChengming Gui <Jack.Gui@amd.com>2019-01-17 05:45:16 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 16:04:00 -0400
commit4ebbe6192e7cd09eed63c87d9845d4e8227a27cb (patch)
tree9831f841b8259ec0758c1ac5de77dd5c4b53fea1
parente0aa879479368b9dd09f75adc7a442cc777ce5b7 (diff)
drm/amd/powerplay: add display_config_changed for SMU11.
add display_config_changed to support sys interface for SMU11. Signed-off-by: Chengming Gui <Jack.Gui@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/powerplay/vega20_ppt.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
index 1908b91f22c6..0b13c9319fa9 100644
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
@@ -1376,6 +1376,48 @@ vega20_set_uclk_to_highest_dpm_level(struct smu_context *smu,
1376 return ret; 1376 return ret;
1377} 1377}
1378 1378
1379static int vega20_display_config_changed(struct smu_context *smu)
1380{
1381 int ret = 0;
1382 struct vega20_dpm_table *dpm_table = smu->smu_dpm.dpm_context;
1383
1384 if (!smu->funcs)
1385 return -EINVAL;
1386
1387 if (!smu->smu_dpm.dpm_context ||
1388 !smu->smu_table.tables ||
1389 !smu->smu_table.tables[TABLE_WATERMARKS].cpu_addr)
1390 return -EINVAL;
1391
1392 smu_send_smc_msg_with_param(smu, SMU_MSG_NumOfDisplays, 0);
1393 ret = vega20_set_uclk_to_highest_dpm_level(smu,
1394 &dpm_table->mem_table);
1395 if (ret) {
1396 pr_err("Failed to set uclk to highest dpm level");
1397 return ret;
1398 }
1399
1400 if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
1401 !(smu->watermarks_bitmap & WATERMARKS_LOADED)) {
1402 ret = smu->funcs->write_watermarks_table(smu);
1403 if (ret) {
1404 pr_err("Failed to update WMTABLE!");
1405 return ret;
1406 }
1407 smu->watermarks_bitmap |= WATERMARKS_LOADED;
1408 }
1409
1410 if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&
1411 smu_feature_is_supported(smu, FEATURE_DPM_DCEFCLK_BIT) &&
1412 smu_feature_is_supported(smu, FEATURE_DPM_SOCCLK_BIT)) {
1413 smu_send_smc_msg_with_param(smu,
1414 SMU_MSG_NumOfDisplays,
1415 smu->display_config->num_display);
1416 }
1417
1418 return ret;
1419}
1420
1379static const struct pptable_funcs vega20_ppt_funcs = { 1421static const struct pptable_funcs vega20_ppt_funcs = {
1380 .alloc_dpm_context = vega20_allocate_dpm_context, 1422 .alloc_dpm_context = vega20_allocate_dpm_context,
1381 .store_powerplay_table = vega20_store_powerplay_table, 1423 .store_powerplay_table = vega20_store_powerplay_table,