diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c | 26 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 2 |
3 files changed, 24 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c index 64ee78f7d41e..20ccbc73a8f7 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c | |||
| @@ -1805,6 +1805,7 @@ static int polaris10_populate_clock_stretcher_data_table(struct pp_hwmgr *hwmgr) | |||
| 1805 | data->smc_state_table.Sclk_voltageOffset[i] = volt_offset; | 1805 | data->smc_state_table.Sclk_voltageOffset[i] = volt_offset; |
| 1806 | } | 1806 | } |
| 1807 | 1807 | ||
| 1808 | data->smc_state_table.LdoRefSel = (table_info->cac_dtp_table->ucCKS_LDO_REFSEL != 0) ? table_info->cac_dtp_table->ucCKS_LDO_REFSEL : 6; | ||
| 1808 | /* Populate CKS Lookup Table */ | 1809 | /* Populate CKS Lookup Table */ |
| 1809 | if (stretch_amount == 1 || stretch_amount == 2 || stretch_amount == 5) | 1810 | if (stretch_amount == 1 || stretch_amount == 2 || stretch_amount == 5) |
| 1810 | stretch_amount2 = 0; | 1811 | stretch_amount2 = 0; |
| @@ -2487,6 +2488,8 @@ int polaris10_enable_dpm_tasks(struct pp_hwmgr *hwmgr) | |||
| 2487 | PP_ASSERT_WITH_CODE((0 == tmp_result), | 2488 | PP_ASSERT_WITH_CODE((0 == tmp_result), |
| 2488 | "Failed to enable VR hot GPIO interrupt!", result = tmp_result); | 2489 | "Failed to enable VR hot GPIO interrupt!", result = tmp_result); |
| 2489 | 2490 | ||
| 2491 | smum_send_msg_to_smc(hwmgr->smumgr, (PPSMC_Msg)PPSMC_HasDisplay); | ||
| 2492 | |||
| 2490 | tmp_result = polaris10_enable_sclk_control(hwmgr); | 2493 | tmp_result = polaris10_enable_sclk_control(hwmgr); |
| 2491 | PP_ASSERT_WITH_CODE((0 == tmp_result), | 2494 | PP_ASSERT_WITH_CODE((0 == tmp_result), |
| 2492 | "Failed to enable SCLK control!", result = tmp_result); | 2495 | "Failed to enable SCLK control!", result = tmp_result); |
| @@ -4359,6 +4362,15 @@ static int polaris10_notify_link_speed_change_after_state_change( | |||
| 4359 | return 0; | 4362 | return 0; |
| 4360 | } | 4363 | } |
| 4361 | 4364 | ||
| 4365 | static int polaris10_notify_smc_display(struct pp_hwmgr *hwmgr) | ||
| 4366 | { | ||
| 4367 | struct polaris10_hwmgr *data = (struct polaris10_hwmgr *)(hwmgr->backend); | ||
| 4368 | |||
| 4369 | smum_send_msg_to_smc_with_parameter(hwmgr->smumgr, | ||
| 4370 | (PPSMC_Msg)PPSMC_MSG_SetVBITimeout, data->frame_time_x2); | ||
| 4371 | return (smum_send_msg_to_smc(hwmgr->smumgr, (PPSMC_Msg)PPSMC_HasDisplay) == 0) ? 0 : -EINVAL; | ||
| 4372 | } | ||
| 4373 | |||
| 4362 | static int polaris10_set_power_state_tasks(struct pp_hwmgr *hwmgr, const void *input) | 4374 | static int polaris10_set_power_state_tasks(struct pp_hwmgr *hwmgr, const void *input) |
| 4363 | { | 4375 | { |
| 4364 | int tmp_result, result = 0; | 4376 | int tmp_result, result = 0; |
| @@ -4407,6 +4419,11 @@ static int polaris10_set_power_state_tasks(struct pp_hwmgr *hwmgr, const void *i | |||
| 4407 | "Failed to program memory timing parameters!", | 4419 | "Failed to program memory timing parameters!", |
| 4408 | result = tmp_result); | 4420 | result = tmp_result); |
| 4409 | 4421 | ||
| 4422 | tmp_result = polaris10_notify_smc_display(hwmgr); | ||
| 4423 | PP_ASSERT_WITH_CODE((0 == tmp_result), | ||
| 4424 | "Failed to notify smc display settings!", | ||
| 4425 | result = tmp_result); | ||
| 4426 | |||
| 4410 | tmp_result = polaris10_unfreeze_sclk_mclk_dpm(hwmgr); | 4427 | tmp_result = polaris10_unfreeze_sclk_mclk_dpm(hwmgr); |
| 4411 | PP_ASSERT_WITH_CODE((0 == tmp_result), | 4428 | PP_ASSERT_WITH_CODE((0 == tmp_result), |
| 4412 | "Failed to unfreeze SCLK MCLK DPM!", | 4429 | "Failed to unfreeze SCLK MCLK DPM!", |
| @@ -4441,6 +4458,7 @@ static int polaris10_set_max_fan_pwm_output(struct pp_hwmgr *hwmgr, uint16_t us_ | |||
| 4441 | PPSMC_MSG_SetFanPwmMax, us_max_fan_pwm); | 4458 | PPSMC_MSG_SetFanPwmMax, us_max_fan_pwm); |
| 4442 | } | 4459 | } |
| 4443 | 4460 | ||
| 4461 | |||
| 4444 | int polaris10_notify_smc_display_change(struct pp_hwmgr *hwmgr, bool has_display) | 4462 | int polaris10_notify_smc_display_change(struct pp_hwmgr *hwmgr, bool has_display) |
| 4445 | { | 4463 | { |
| 4446 | PPSMC_Msg msg = has_display ? (PPSMC_Msg)PPSMC_HasDisplay : (PPSMC_Msg)PPSMC_NoDisplay; | 4464 | PPSMC_Msg msg = has_display ? (PPSMC_Msg)PPSMC_HasDisplay : (PPSMC_Msg)PPSMC_NoDisplay; |
| @@ -4460,8 +4478,6 @@ int polaris10_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hwm | |||
| 4460 | 4478 | ||
| 4461 | if (num_active_displays > 1) /* to do && (pHwMgr->pPECI->displayConfiguration.bMultiMonitorInSync != TRUE)) */ | 4479 | if (num_active_displays > 1) /* to do && (pHwMgr->pPECI->displayConfiguration.bMultiMonitorInSync != TRUE)) */ |
| 4462 | polaris10_notify_smc_display_change(hwmgr, false); | 4480 | polaris10_notify_smc_display_change(hwmgr, false); |
| 4463 | else | ||
| 4464 | polaris10_notify_smc_display_change(hwmgr, true); | ||
| 4465 | 4481 | ||
| 4466 | return 0; | 4482 | return 0; |
| 4467 | } | 4483 | } |
| @@ -4502,6 +4518,8 @@ int polaris10_program_display_gap(struct pp_hwmgr *hwmgr) | |||
| 4502 | frame_time_in_us = 1000000 / refresh_rate; | 4518 | frame_time_in_us = 1000000 / refresh_rate; |
| 4503 | 4519 | ||
| 4504 | pre_vbi_time_in_us = frame_time_in_us - 200 - mode_info.vblank_time_us; | 4520 | pre_vbi_time_in_us = frame_time_in_us - 200 - mode_info.vblank_time_us; |
| 4521 | data->frame_time_x2 = frame_time_in_us * 2 / 100; | ||
| 4522 | |||
| 4505 | display_gap2 = pre_vbi_time_in_us * (ref_clock / 100); | 4523 | display_gap2 = pre_vbi_time_in_us * (ref_clock / 100); |
| 4506 | 4524 | ||
| 4507 | cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixCG_DISPLAY_GAP_CNTL2, display_gap2); | 4525 | cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixCG_DISPLAY_GAP_CNTL2, display_gap2); |
| @@ -4510,8 +4528,6 @@ int polaris10_program_display_gap(struct pp_hwmgr *hwmgr) | |||
| 4510 | 4528 | ||
| 4511 | cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, data->soft_regs_start + offsetof(SMU74_SoftRegisters, VBlankTimeout), (frame_time_in_us - pre_vbi_time_in_us)); | 4529 | cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, data->soft_regs_start + offsetof(SMU74_SoftRegisters, VBlankTimeout), (frame_time_in_us - pre_vbi_time_in_us)); |
| 4512 | 4530 | ||
| 4513 | polaris10_notify_smc_display_change(hwmgr, num_active_displays != 0); | ||
| 4514 | |||
| 4515 | return 0; | 4531 | return 0; |
| 4516 | } | 4532 | } |
| 4517 | 4533 | ||
| @@ -4623,7 +4639,7 @@ int polaris10_upload_mc_firmware(struct pp_hwmgr *hwmgr) | |||
| 4623 | return 0; | 4639 | return 0; |
| 4624 | } | 4640 | } |
| 4625 | 4641 | ||
| 4626 | data->need_long_memory_training = true; | 4642 | data->need_long_memory_training = false; |
| 4627 | 4643 | ||
| 4628 | /* | 4644 | /* |
| 4629 | * PPMCME_FirmwareDescriptorEntry *pfd = NULL; | 4645 | * PPMCME_FirmwareDescriptorEntry *pfd = NULL; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.h index d717789441f5..afc3434822d1 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.h | |||
| @@ -315,6 +315,7 @@ struct polaris10_hwmgr { | |||
| 315 | 315 | ||
| 316 | uint32_t avfs_vdroop_override_setting; | 316 | uint32_t avfs_vdroop_override_setting; |
| 317 | bool apply_avfs_cks_off_voltage; | 317 | bool apply_avfs_cks_off_voltage; |
| 318 | uint32_t frame_time_x2; | ||
| 318 | }; | 319 | }; |
| 319 | 320 | ||
| 320 | /* To convert to Q8.8 format for firmware */ | 321 | /* To convert to Q8.8 format for firmware */ |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h index 28f571449495..77e8e33d5870 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | |||
| @@ -411,6 +411,8 @@ struct phm_cac_tdp_table { | |||
| 411 | uint8_t ucVr_I2C_Line; | 411 | uint8_t ucVr_I2C_Line; |
| 412 | uint8_t ucPlx_I2C_address; | 412 | uint8_t ucPlx_I2C_address; |
| 413 | uint8_t ucPlx_I2C_Line; | 413 | uint8_t ucPlx_I2C_Line; |
| 414 | uint32_t usBoostPowerLimit; | ||
| 415 | uint8_t ucCKS_LDO_REFSEL; | ||
| 414 | }; | 416 | }; |
| 415 | 417 | ||
| 416 | struct phm_ppm_table { | 418 | struct phm_ppm_table { |
