]> Git Repo - linux.git/commitdiff
drm/xe: Add xe_sched_add_msg_locked helper
authorMatthew Brost <[email protected]>
Fri, 9 Aug 2024 19:19:27 +0000 (12:19 -0700)
committerMatthew Brost <[email protected]>
Sat, 10 Aug 2024 02:07:30 +0000 (19:07 -0700)
Will help by allowing callers to own message locking.

Signed-off-by: Matthew Brost <[email protected]>
Reviewed-by: Jonathan Cavitt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/xe/xe_gpu_scheduler.c
drivers/gpu/drm/xe/xe_gpu_scheduler.h

index 1c703e8423de4f598c1db8087afda22a5f278f69..c518d1d16d828595802828bcdd1bcddb78b04433 100644 (file)
@@ -94,8 +94,15 @@ void xe_sched_add_msg(struct xe_gpu_scheduler *sched,
                      struct xe_sched_msg *msg)
 {
        xe_sched_msg_lock(sched);
-       list_add_tail(&msg->link, &sched->msgs);
+       xe_sched_add_msg_locked(sched, msg);
        xe_sched_msg_unlock(sched);
+}
 
+void xe_sched_add_msg_locked(struct xe_gpu_scheduler *sched,
+                            struct xe_sched_msg *msg)
+{
+       lockdep_assert_held(&sched->base.job_list_lock);
+
+       list_add_tail(&msg->link, &sched->msgs);
        xe_sched_process_msg_queue(sched);
 }
index a54038fb3094ec7b0e501be5db537f77701bb0e5..cee9c6809fc0df5997379ff62cb23d07b9ad278a 100644 (file)
@@ -24,6 +24,8 @@ void xe_sched_submission_stop(struct xe_gpu_scheduler *sched);
 
 void xe_sched_add_msg(struct xe_gpu_scheduler *sched,
                      struct xe_sched_msg *msg);
+void xe_sched_add_msg_locked(struct xe_gpu_scheduler *sched,
+                            struct xe_sched_msg *msg);
 
 static inline void xe_sched_msg_lock(struct xe_gpu_scheduler *sched)
 {
This page took 0.057604 seconds and 4 git commands to generate.