aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
diff options
context:
space:
mode:
authorshaoyunl <shaoyun.liu@amd.com>2019-02-21 16:30:25 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 15:36:48 -0500
commit9b638f9751308ae3ae8f28e0c6e9decffd97f5f9 (patch)
treef64c4de40d4e49ea3f11ba79dbc3e65bd514c2fa /drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
parentdrm/amdgpu: Enable XGMI mapping for peer device (diff)
downloadlinux-dev-9b638f9751308ae3ae8f28e0c6e9decffd97f5f9.tar.xz
linux-dev-9b638f9751308ae3ae8f28e0c6e9decffd97f5f9.zip
drm/amdgpu: XGMI pstate switch initial support
Driver vote low to high pstate switch whenever there is an outstanding XGMI mapping request. Driver vote high to low pstate when all the outstanding XGMI mapping is terminated. Signed-off-by: shaoyunl <shaoyun.liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index fcc4b05c745c..807440d3edff 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -200,6 +200,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev, int lo
if (lock)
mutex_lock(&tmp->hive_lock);
+ tmp->pstate = -1;
mutex_unlock(&xgmi_mutex);
@@ -321,3 +322,17 @@ void amdgpu_xgmi_remove_device(struct amdgpu_device *adev)
mutex_unlock(&hive->hive_lock);
}
}
+
+int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
+{
+ int ret = 0;
+ struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0);
+
+ if (!hive)
+ return 0;
+
+ if (hive->pstate == pstate)
+ return 0;
+ /* Todo : sent the message to SMU for pstate change */
+ return ret;
+} \ No newline at end of file