diff options
author | Matthew Brost <matthew.brost@intel.com> | 2024-08-09 21:19:25 +0200 |
---|---|---|
committer | Matthew Brost <matthew.brost@intel.com> | 2024-08-10 04:07:28 +0200 |
commit | a86ee96ce819800a399e0260c5ffad793c9c6ac3 (patch) | |
tree | 00b0d1418cae02f0c726ccea6d6f87c1a71e236e /drivers/gpu/drm/xe/xe_gpu_scheduler.h | |
parent | drm/xe: Move VM dma-resv lock from xe_exec_queue_create to __xe_exec_queue_init (diff) | |
download | linux-a86ee96ce819800a399e0260c5ffad793c9c6ac3.tar.xz linux-a86ee96ce819800a399e0260c5ffad793c9c6ac3.zip |
drm/xe: Add xe_sched_msg_lock/unlock helper
Will help callers to own locking when adding messages to scheduler.
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809191929.3138956-2-matthew.brost@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_gpu_scheduler.h')
-rw-r--r-- | drivers/gpu/drm/xe/xe_gpu_scheduler.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h index 10c6bb9c9386..a54038fb3094 100644 --- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h +++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h @@ -25,6 +25,16 @@ 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); +static inline void xe_sched_msg_lock(struct xe_gpu_scheduler *sched) +{ + spin_lock(&sched->base.job_list_lock); +} + +static inline void xe_sched_msg_unlock(struct xe_gpu_scheduler *sched) +{ + spin_unlock(&sched->base.job_list_lock); +} + static inline void xe_sched_stop(struct xe_gpu_scheduler *sched) { drm_sched_stop(&sched->base, NULL); |