]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu/mes: implement removing mes ring
authorJack Xiao <Jack.Xiao@amd.com>
Fri, 27 Mar 2020 10:04:36 +0000 (18:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 4 May 2022 14:43:52 +0000 (10:43 -0400)
Remove the mes ring and its resources.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h

index 827391fcb2a3f32db173b73ee8a4dfe979e5481f..fa43a7e3c9abdf6b01d8cfa3967907826002427b 100644 (file)
@@ -846,3 +846,14 @@ clean_up_memory:
        mutex_unlock(&adev->mes.mutex);
        return r;
 }
+
+void amdgpu_mes_remove_ring(struct amdgpu_device *adev,
+                           struct amdgpu_ring *ring)
+{
+       if (!ring)
+               return;
+
+       amdgpu_mes_remove_hw_queue(adev, ring->hw_queue_id);
+       amdgpu_ring_fini(ring);
+       kfree(ring);
+}
index 287f4e633677900c8df9f4f0a23478442206cc8c..b68719823195d9d48feee4cbee8f98160d30ee62 100644 (file)
@@ -259,5 +259,7 @@ int amdgpu_mes_add_ring(struct amdgpu_device *adev, int gang_id,
                        int queue_type, int idx,
                        struct amdgpu_mes_ctx_data *ctx_data,
                        struct amdgpu_ring **out);
+void amdgpu_mes_remove_ring(struct amdgpu_device *adev,
+                           struct amdgpu_ring *ring);
 
 #endif /* __AMDGPU_MES_H__ */