]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Don't change LRC ring head on job resubmission
authorMatthew Brost <matthew.brost@intel.com>
Wed, 8 Oct 2025 21:45:04 +0000 (14:45 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 9 Oct 2025 10:22:21 +0000 (03:22 -0700)
Now that we save the job's head during submission, it's no longer
necessary to adjust the LRC ring head during resubmission. Instead, a
software-based adjustment of the tail will overwrite the old jobs in
place. For some odd reason, adjusting the LRC ring head didn't work on
parallel queues, which was causing issues in our CI.

v5:
 - Add comment in guc_exec_queue_start explaning why the function works
   (Auld)
v7:
 - Only adjust first state on first unsignaled job (Auld)
v8:
 - Break unsignaled job handling to separate patch (Auld)

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Tomasz Lis <tomasz.lis@intel.com>
Link: https://lore.kernel.org/r/20251008214532.3442967-7-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_guc_submit.c

index 3a534d93505f016e919b0619556de0057078f952..d123bdb633692fc06767b93513e7d350f4576f80 100644 (file)
@@ -2008,11 +2008,25 @@ static void guc_exec_queue_start(struct xe_exec_queue *q)
        struct xe_gpu_scheduler *sched = &q->guc->sched;
 
        if (!exec_queue_killed_or_banned_or_wedged(q)) {
+               struct xe_sched_job *job = xe_sched_first_pending_job(sched);
                int i;
 
                trace_xe_exec_queue_resubmit(q);
-               for (i = 0; i < q->width; ++i)
-                       xe_lrc_set_ring_head(q->lrc[i], q->lrc[i]->ring.tail);
+               if (job) {
+                       for (i = 0; i < q->width; ++i) {
+                               /*
+                                * The GuC context is unregistered at this point
+                                * time, adjusting software ring tail ensures
+                                * jobs are rewritten in original placement,
+                                * adjusting LRC tail ensures the newly loaded
+                                * GuC / contexts only view the LRC tail
+                                * increasing as jobs are written out.
+                                */
+                               q->lrc[i]->ring.tail = job->ptrs[i].head;
+                               xe_lrc_set_ring_tail(q->lrc[i],
+                                                    xe_lrc_ring_head(q->lrc[i]));
+                       }
+               }
                xe_sched_resubmit_jobs(sched);
        }