1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2020-2023 Intel Corporation
9 #include <linux/kref.h>
10 #include <linux/idr.h>
15 struct ivpu_file_priv;
18 * struct ivpu_cmdq - Object representing device queue used to send jobs.
19 * @jobq: Pointer to job queue memory shared with the device
20 * @mem: Memory allocated for the job queue, shared with device
21 * @entry_count Number of job entries in the queue
22 * @db_id: Doorbell assigned to this job queue
23 * @db_registered: True if doorbell is registered in device
26 struct vpu_job_queue *jobq;
34 * struct ivpu_job - KMD object that represents batchbuffer / DMA buffer.
35 * Each batch / DMA buffer is a job to be submitted and executed by the VPU FW.
36 * This is a unit of execution, and be tracked by the job_id for
37 * any status reporting from VPU FW through IPC JOB RET/DONE message.
38 * @file_priv: The client that submitted this job
39 * @job_id: Job ID for KMD tracking and job status reporting from VPU FW
40 * @status: Status of the Job from IPC JOB RET/DONE message
41 * @batch_buffer: CPU vaddr points to the batch buffer memory allocated for the job
42 * @submit_status_offset: Offset within batch buffer where job completion handler
43 will update the job status
47 struct ivpu_device *vdev;
48 struct ivpu_file_priv *file_priv;
49 struct dma_fence *done_fence;
54 struct ivpu_bo *bos[];
57 int ivpu_submit_ioctl(struct drm_device *dev, void *data, struct drm_file *file);
59 void ivpu_cmdq_release_all(struct ivpu_file_priv *file_priv);
60 void ivpu_cmdq_reset_all_contexts(struct ivpu_device *vdev);
62 int ivpu_job_done_thread_init(struct ivpu_device *vdev);
63 void ivpu_job_done_thread_fini(struct ivpu_device *vdev);
65 void ivpu_jobs_abort_all(struct ivpu_device *vdev);
67 #endif /* __IVPU_JOB_H__ */