]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/powerplay : send SMC message to set XGMI pstate
authorshaoyunl <shaoyun.liu@amd.com>
Mon, 15 Apr 2019 15:22:38 +0000 (11:22 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 19 Apr 2019 16:32:32 +0000 (11:32 -0500)
Send message with parameter to SMC to set xgmi pstate

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/smu_v11_0.c

index c478b38662d09946fef1ff66b27db81d89550f7f..92903a4cc4d8f460f371d76c942c4cb04afdc2af 100644 (file)
@@ -1896,8 +1896,13 @@ static int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
 static int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
                                     uint32_t pstate)
 {
-       /* send msg to SMU to set pstate */
-       return 0;
+       int ret = 0;
+       mutex_lock(&(smu->mutex));
+       ret = smu_send_smc_msg_with_param(smu,
+                                         SMU_MSG_SetXgmiMode,
+                                         pstate ? XGMI_STATE_D0 : XGMI_STATE_D3);
+       mutex_unlock(&(smu->mutex));
+       return ret;
 }
 
 static const struct smu_funcs smu_v11_0_funcs = {