aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorhersen wu <hersenxs.wu@amd.com>2019-05-30 00:28:55 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-21 19:59:31 -0400
commit382fb77891b6f9b067fc801cc63503d0d1d07dfb (patch)
tree95dd96209cf842beef22ff674780bc9f557d4a40 /drivers
parent576851345b677b28617217f5d97920f62eab471e (diff)
drm/amd/powerplay: allow dc request uclk change
when dc set mode or color format in frame buffer change, it may request clock changes, like dispclk, dcfclk, uclk. after smu get clock requests, smu will make decision. Signed-off-by: hersen wu <hersenxs.wu@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/powerplay/smu_v11_0.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index e77cfb96fc56..bab61fe46b46 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -1275,7 +1275,8 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
1275 1275
1276 if (!smu->pm_enabled) 1276 if (!smu->pm_enabled)
1277 return -EINVAL; 1277 return -EINVAL;
1278 if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_DCEFCLK_BIT)) { 1278 if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_DCEFCLK_BIT) ||
1279 smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UCLK_BIT)) {
1279 switch (clk_type) { 1280 switch (clk_type) {
1280 case amd_pp_dcef_clock: 1281 case amd_pp_dcef_clock:
1281 clk_select = SMU_DCEFCLK; 1282 clk_select = SMU_DCEFCLK;
@@ -1289,6 +1290,9 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
1289 case amd_pp_phy_clock: 1290 case amd_pp_phy_clock:
1290 clk_select = SMU_PHYCLK; 1291 clk_select = SMU_PHYCLK;
1291 break; 1292 break;
1293 case amd_pp_mem_clock:
1294 clk_select = SMU_UCLK;
1295 break;
1292 default: 1296 default:
1293 pr_info("[%s] Invalid Clock Type!", __func__); 1297 pr_info("[%s] Invalid Clock Type!", __func__);
1294 ret = -EINVAL; 1298 ret = -EINVAL;
@@ -1298,8 +1302,10 @@ smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
1298 if (ret) 1302 if (ret)
1299 goto failed; 1303 goto failed;
1300 1304
1305 mutex_lock(&smu->mutex);
1301 ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinByFreq, 1306 ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinByFreq,
1302 (smu_clk_get_index(smu, clk_select) << 16) | clk_freq); 1307 (smu_clk_get_index(smu, clk_select) << 16) | clk_freq);
1308 mutex_unlock(&smu->mutex);
1303 } 1309 }
1304 1310
1305failed: 1311failed: