diff options
| author | Jack Xiao <[email protected]> | 2020-03-27 08:41:56 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2022-05-04 14:43:51 +0000 |
| commit | c8bb10572ca3a03aa0a11d0ba2d87c205f140883 (patch) | |
| tree | b97cb5dc6a32ef20cb8cea0d1d97a8999132b502 /drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | |
| parent | drm/amdgpu/mes: implement removing mes gang (diff) | |
| download | kernel-c8bb10572ca3a03aa0a11d0ba2d87c205f140883.tar.gz kernel-c8bb10572ca3a03aa0a11d0ba2d87c205f140883.zip | |
drm/amdgpu/mes: implement suspending all gangs
Implement suspending all gangs.
Signed-off-by: Jack Xiao <[email protected]>
Acked-by: Christian König <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c index 07ddf7bf6a3b..e64f2a4b5a3b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c @@ -446,3 +446,28 @@ int amdgpu_mes_remove_gang(struct amdgpu_device *adev, int gang_id) mutex_unlock(&adev->mes.mutex); return 0; } + +int amdgpu_mes_suspend(struct amdgpu_device *adev) +{ + struct idr *idp; + struct amdgpu_mes_process *process; + struct amdgpu_mes_gang *gang; + struct mes_suspend_gang_input input; + int r, pasid; + + mutex_lock(&adev->mes.mutex); + + idp = &adev->mes.pasid_idr; + + idr_for_each_entry(idp, process, pasid) { + list_for_each_entry(gang, &process->gang_list, list) { + r = adev->mes.funcs->suspend_gang(&adev->mes, &input); + if (r) + DRM_ERROR("failed to suspend pasid %d gangid %d", + pasid, gang->gang_id); + } + } + + mutex_unlock(&adev->mes.mutex); + return 0; +} |
