1 | /* SPDX-License-Identifier: GPL-2.0 or MIT */ |
2 | /* Copyright 2023 Collabora ltd. */ |
3 | |
4 | #ifndef __PANTHOR_SCHED_H__ |
5 | #define __PANTHOR_SCHED_H__ |
6 | |
7 | struct drm_exec; |
8 | struct dma_fence; |
9 | struct drm_file; |
10 | struct drm_gem_object; |
11 | struct drm_sched_job; |
12 | struct drm_memory_stats; |
13 | struct drm_panthor_group_create; |
14 | struct drm_panthor_queue_create; |
15 | struct drm_panthor_group_get_state; |
16 | struct drm_panthor_queue_submit; |
17 | struct panthor_device; |
18 | struct panthor_file; |
19 | struct panthor_group_pool; |
20 | struct panthor_job; |
21 | |
22 | int panthor_group_create(struct panthor_file *pfile, |
23 | const struct drm_panthor_group_create *group_args, |
24 | const struct drm_panthor_queue_create *queue_args); |
25 | int panthor_group_destroy(struct panthor_file *pfile, u32 group_handle); |
26 | int panthor_group_get_state(struct panthor_file *pfile, |
27 | struct drm_panthor_group_get_state *get_state); |
28 | |
29 | struct drm_sched_job * |
30 | panthor_job_create(struct panthor_file *pfile, |
31 | u16 group_handle, |
32 | const struct drm_panthor_queue_submit *qsubmit); |
33 | struct drm_sched_job *panthor_job_get(struct drm_sched_job *job); |
34 | struct panthor_vm *panthor_job_vm(struct drm_sched_job *sched_job); |
35 | void panthor_job_put(struct drm_sched_job *job); |
36 | void panthor_job_update_resvs(struct drm_exec *exec, struct drm_sched_job *job); |
37 | |
38 | int panthor_group_pool_create(struct panthor_file *pfile); |
39 | void panthor_group_pool_destroy(struct panthor_file *pfile); |
40 | void panthor_fdinfo_gather_group_mem_info(struct panthor_file *pfile, |
41 | struct drm_memory_stats *stats); |
42 | |
43 | int panthor_sched_init(struct panthor_device *ptdev); |
44 | void panthor_sched_unplug(struct panthor_device *ptdev); |
45 | void panthor_sched_pre_reset(struct panthor_device *ptdev); |
46 | void panthor_sched_post_reset(struct panthor_device *ptdev, bool reset_failed); |
47 | void panthor_sched_suspend(struct panthor_device *ptdev); |
48 | void panthor_sched_resume(struct panthor_device *ptdev); |
49 | |
50 | void panthor_sched_report_mmu_fault(struct panthor_device *ptdev); |
51 | void panthor_sched_report_fw_events(struct panthor_device *ptdev, u32 events); |
52 | |
53 | void panthor_fdinfo_gather_group_samples(struct panthor_file *pfile); |
54 | |
55 | #endif |
56 | |