summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2026-09-25 13:15:23 -0700
committerMatthew Brost <matthew.brost@intel.com>2026-09-25 17:18:11 -0700
commit40c756bdbbee2ae47e5b69b57ae1155806ca475f (patch)
tree59c453f22b583f7d3e235162a3223471450bfd17 /drivers/gpu
parent6ec0b87160be50639fffa8d26fc2d7e00ae61ed9 (diff)
downloadlinux-next-40c756bdbbee2ae47e5b69b57ae1155806ca475f.tar.gz
linux-next-40c756bdbbee2ae47e5b69b57ae1155806ca475f.zip
drm/xe: Add ULLS migration job support to GuC submission
Add ULLS migration job support to GuC submission backend. Changes required: - On migration queue, reduce max jobs to the number of ULLS semaphores minus one - Skip writing the saved ring tail for ULLS jobs except for the first ULLS job - the ring updates both the saved tail and the tail register itself - Set ULLS sempahore for current job releasing last job except for first ULLS job - Suppress submit H2G for ULLS except for first ULLS job Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Maarten Lankhorst <dev@lankhorst.se> Link: https://patch.msgid.link/20260925201526.1355279-22-matthew.brost@intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/xe/xe_guc_submit.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index a2784763e72b..cd9bb9f9e28c 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1190,9 +1190,10 @@ static void submit_exec_queue(struct xe_exec_queue *q, struct xe_sched_job *job)
xe_gt_assert(guc_to_gt(guc), exec_queue_registered(q));
if (!job->restore_replay || job->last_replay) {
+ /* A ULLS job past the first publishes its own ring tail */
if (xe_exec_queue_is_parallel(q))
wq_item_append(q);
- else
+ else if (!xe_sched_job_ulls_is_chained(job))
xe_lrc_set_ring_tail(lrc, lrc->ring.tail);
job->last_replay = false;
}
@@ -1209,6 +1210,9 @@ static void submit_exec_queue(struct xe_exec_queue *q, struct xe_sched_job *job)
if (exec_queue_suspended(q))
return;
+ if (xe_sched_job_ulls_is_chained(job))
+ xe_lrc_set_ulls_semaphore(lrc, xe_sched_job_lrc_seqno(job));
+
if (!exec_queue_enabled(q)) {
action[len++] = XE_GUC_ACTION_SCHED_CONTEXT_MODE_SET;
action[len++] = q->guc->id;
@@ -1222,13 +1226,14 @@ static void submit_exec_queue(struct xe_exec_queue *q, struct xe_sched_job *job)
set_exec_queue_pending_enable(q);
set_exec_queue_enabled(q);
trace_xe_exec_queue_scheduling_enable(q);
- } else {
+ } else if (!xe_sched_job_ulls_is_chained(job)) {
action[len++] = XE_GUC_ACTION_SCHED_CONTEXT;
action[len++] = q->guc->id;
trace_xe_exec_queue_submit(q);
}
- xe_guc_ct_send(&guc->ct, action, len, g2h_len, num_g2h);
+ if (!xe_sched_job_ulls_is_chained(job) || num_g2h)
+ xe_guc_ct_send(&guc->ct, action, len, g2h_len, num_g2h);
if (extra_submit) {
len = 0;
@@ -2100,6 +2105,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
struct xe_guc_exec_queue *ge;
long timeout;
int err, i;
+ int max_jobs = (xe_lrc_ring_size() / MAX_JOB_SIZE_BYTES);
xe_gt_assert(guc_to_gt(guc), xe_device_uc_enabled(guc_to_xe(guc)));
@@ -2139,8 +2145,11 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
submit_wq = primary->guc->sched.base.submit_wq;
}
+ if (q->vm && q->vm->flags & XE_VM_FLAG_MIGRATION)
+ max_jobs = min(max_jobs, LRC_MIGRATION_ULLS_SEMAPHORE_COUNT - 1);
+
err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops,
- submit_wq, xe_lrc_ring_size() / MAX_JOB_SIZE_BYTES, 64,
+ submit_wq, max_jobs, 64,
timeout, guc_to_gt(guc)->ordered_wq, NULL,
ge->name, gt_to_xe(q->gt)->drm.dev);
if (err)