Lines Matching refs:sched

8 static void xe_sched_process_msg_queue(struct xe_gpu_scheduler *sched)
10 if (!READ_ONCE(sched->base.pause_submit))
11 queue_work(sched->base.submit_wq, &sched->work_process_msg);
14 static void xe_sched_process_msg_queue_if_ready(struct xe_gpu_scheduler *sched)
18 spin_lock(&sched->base.job_list_lock);
19 msg = list_first_entry_or_null(&sched->msgs, struct xe_sched_msg, link);
21 xe_sched_process_msg_queue(sched);
22 spin_unlock(&sched->base.job_list_lock);
26 xe_sched_get_msg(struct xe_gpu_scheduler *sched)
30 spin_lock(&sched->base.job_list_lock);
31 msg = list_first_entry_or_null(&sched->msgs,
35 spin_unlock(&sched->base.job_list_lock);
42 struct xe_gpu_scheduler *sched =
46 if (READ_ONCE(sched->base.pause_submit))
49 msg = xe_sched_get_msg(sched);
51 sched->ops->process_msg(msg);
53 xe_sched_process_msg_queue_if_ready(sched);
57 int xe_sched_init(struct xe_gpu_scheduler *sched,
66 sched->ops = xe_ops;
67 INIT_LIST_HEAD(&sched->msgs);
68 INIT_WORK(&sched->work_process_msg, xe_sched_process_msg_work);
70 return drm_sched_init(&sched->base, ops, submit_wq, 1, hw_submission,
75 void xe_sched_fini(struct xe_gpu_scheduler *sched)
77 xe_sched_submission_stop(sched);
78 drm_sched_fini(&sched->base);
81 void xe_sched_submission_start(struct xe_gpu_scheduler *sched)
83 drm_sched_wqueue_start(&sched->base);
84 queue_work(sched->base.submit_wq, &sched->work_process_msg);
87 void xe_sched_submission_stop(struct xe_gpu_scheduler *sched)
89 drm_sched_wqueue_stop(&sched->base);
90 cancel_work_sync(&sched->work_process_msg);
93 void xe_sched_add_msg(struct xe_gpu_scheduler *sched,
96 spin_lock(&sched->base.job_list_lock);
97 list_add_tail(&msg->link, &sched->msgs);
98 spin_unlock(&sched->base.job_list_lock);
100 xe_sched_process_msg_queue(sched);