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 16:36:48 -0400
commit9b638f9751308ae3ae8f28e0c6e9decffd97f5f9 (patch)
treef64c4de40d4e49ea3f11ba79dbc3e65bd514c2fa /drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
parenta690aa0f459eba3e768257a655c82b24d14dcc88 (diff)
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
200 200
201 if (lock) 201 if (lock)
202 mutex_lock(&tmp->hive_lock); 202 mutex_lock(&tmp->hive_lock);
203 tmp->pstate = -1;
203 204
204 mutex_unlock(&xgmi_mutex); 205 mutex_unlock(&xgmi_mutex);
205 206
@@ -321,3 +322,17 @@ void amdgpu_xgmi_remove_device(struct amdgpu_device *adev)
321 mutex_unlock(&hive->hive_lock); 322 mutex_unlock(&hive->hive_lock);
322 } 323 }
323} 324}
325
326int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
327{
328 int ret = 0;
329 struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0);
330
331 if (!hive)
332 return 0;
333
334 if (hive->pstate == pstate)
335 return 0;
336 /* Todo : sent the message to SMU for pstate change */
337 return ret;
338} \ No newline at end of file