summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/xe/xe_gpu_scheduler.h
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2024-08-09 21:19:25 +0200
committerMatthew Brost <matthew.brost@intel.com>2024-08-10 04:07:28 +0200
commita86ee96ce819800a399e0260c5ffad793c9c6ac3 (patch)
tree00b0d1418cae02f0c726ccea6d6f87c1a71e236e /drivers/gpu/drm/xe/xe_gpu_scheduler.h
parentdrm/xe: Move VM dma-resv lock from xe_exec_queue_create to __xe_exec_queue_init (diff)
downloadlinux-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.h10
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);