summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2026-05-07 12:03:47 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-06-17 15:51:35 -0400
commite49044061b37cc4be99bfd17f6ccdd3509300469 (patch)
tree6985d03e7aa36afc6c355bc00613831c2f5188ad /drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
parentb86e1ea9e2290088d676442ddec29da9663416c2 (diff)
downloadlinux-next-e49044061b37cc4be99bfd17f6ccdd3509300469.tar.gz
linux-next-e49044061b37cc4be99bfd17f6ccdd3509300469.zip
drm/amdgpu/gfx: add a common helper to handle MES compute resets
Add helpers to handle MES compute queue resets when multiple queues are affected. Can you be used by both KGD and KFD. v2: sqaush in updates v3: squash in userq updates Co-developed-by: Jesse Zhang <jesse.zhang@amd.com> Co-developed-by: Amber Lin <Amber.Lin@amd.com> Signed-off-by: Amber Lin <Amber.Lin@amd.com> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com> Reviewed-by: Jesse Zhang <jesse.zhang@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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index ae45d840a066..b1b7f69bcff3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -252,6 +252,10 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
}
}
+ adev->gfx.mec.mes_hung_db_array =
+ kcalloc(amdgpu_mes_get_hung_queue_db_array_size(adev),
+ sizeof(u32), GFP_KERNEL);
+
return 0;
error_doorbell:
@@ -279,6 +283,8 @@ void amdgpu_mes_fini(struct amdgpu_device *adev)
int i;
int num_xcc = adev->gfx.xcc_mask ? NUM_XCC(adev->gfx.xcc_mask) : 1;
+ kfree(adev->gfx.mec.mes_hung_db_array);
+
amdgpu_bo_free_kernel(&adev->mes.event_log_gpu_obj,
&adev->mes.event_log_gpu_addr,
&adev->mes.event_log_cpu_addr);