mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-28 21:46:02 -04:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user