diff options
author | Shaoyun Liu <shaoyun.liu@amd.com> | 2024-10-23 11:12:00 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-11-12 17:02:04 -0500 |
commit | 8521e3c5f0585cad3e73e4ba73535dc274e7eba6 (patch) | |
tree | 6e7e58f6d702aead35679b6912391040fb83d634 /drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | |
parent | 377dda2cff59825079aee3906aa4904779747b0b (diff) | |
download | linux-8521e3c5f0585cad3e73e4ba73535dc274e7eba6.tar.gz linux-8521e3c5f0585cad3e73e4ba73535dc274e7eba6.tar.bz2 linux-8521e3c5f0585cad3e73e4ba73535dc274e7eba6.zip |
drm/amd/amdgpu: limit single process inside MES
This is for MES to limit only one process for the user queues
Signed-off-by: Shaoyun Liu <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_mes.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c index c9ec5c6cad2e..59ec20b07a6a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c @@ -1678,6 +1678,29 @@ bool amdgpu_mes_suspend_resume_all_supported(struct amdgpu_device *adev) return is_supported; } +/* Fix me -- node_id is used to identify the correct MES instances in the future */ +int amdgpu_mes_set_enforce_isolation(struct amdgpu_device *adev, uint32_t node_id, bool enable) +{ + struct mes_misc_op_input op_input = {0}; + int r; + + op_input.op = MES_MISC_OP_CHANGE_CONFIG; + op_input.change_config.option.limit_single_process = enable ? 1 : 0; + + if (!adev->mes.funcs->misc_op) { + dev_err(adev->dev, "mes change config is not supported!\n"); + r = -EINVAL; + goto error; + } + + r = adev->mes.funcs->misc_op(&adev->mes, &op_input); + if (r) + dev_err(adev->dev, "failed to change_config.\n"); + +error: + return r; +} + #if defined(CONFIG_DEBUG_FS) static int amdgpu_debugfs_mes_event_log_show(struct seq_file *m, void *unused) |