Skip to content

Commit dffaa98

Browse files
Andrzej Kacprowskijlawryno
authored andcommitted
accel/ivpu: Send VPU_JSM_MSG_CONTEXT_DELETE when deleting context
The VPU_JSM_MSG_CONTEXT_DELETE will remove any resources associated with the SSID, that included any blobs create by the user space application. The command can also remove doorbell registrations, but since this does not work in HW scheduling case, we do not depend on this capability and unregister the doorbells explicitly. Fixes: cd72722 ("accel/ivpu: Add command buffer submission logic") Signed-off-by: Andrzej Kacprowski <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 38257f5) Signed-off-by: Jacek Lawrynowicz <[email protected]>
1 parent 98d4187 commit dffaa98

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static void file_priv_release(struct kref *ref)
9090

9191
ivpu_cmdq_release_all(file_priv);
9292
ivpu_bo_remove_all_bos_from_context(&file_priv->ctx);
93+
ivpu_jsm_context_release(vdev, file_priv->ctx.id);
9394
ivpu_mmu_user_context_fini(vdev, &file_priv->ctx);
9495
drm_WARN_ON(&vdev->drm, xa_erase_irq(&vdev->context_xa, file_priv->ctx.id) != file_priv);
9596
mutex_destroy(&file_priv->lock);

drivers/accel/ivpu/ivpu_jsm_msg.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,14 @@ int ivpu_jsm_trace_set_config(struct ivpu_device *vdev, u32 trace_level, u32 tra
167167

168168
return ret;
169169
}
170+
171+
int ivpu_jsm_context_release(struct ivpu_device *vdev, u32 host_ssid)
172+
{
173+
struct vpu_jsm_msg req = { .type = VPU_JSM_MSG_SSID_RELEASE };
174+
struct vpu_jsm_msg resp;
175+
176+
req.payload.ssid_release.host_ssid = host_ssid;
177+
178+
return ivpu_ipc_send_receive(vdev, &req, VPU_JSM_MSG_SSID_RELEASE_DONE, &resp,
179+
VPU_IPC_CHAN_ASYNC_CMD, vdev->timeout.jsm);
180+
}

drivers/accel/ivpu/ivpu_jsm_msg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ int ivpu_jsm_trace_get_capability(struct ivpu_device *vdev, u32 *trace_destinati
1919
u64 *trace_hw_component_mask);
2020
int ivpu_jsm_trace_set_config(struct ivpu_device *vdev, u32 trace_level, u32 trace_destination_mask,
2121
u64 trace_hw_component_mask);
22-
22+
int ivpu_jsm_context_release(struct ivpu_device *vdev, u32 host_ssid);
2323
#endif

0 commit comments

Comments
 (0)