Commit 807c42dd authored by Matthew Brost's avatar Matthew Brost
Browse files

drm/xe: Don't change LRC ring head on job resubmission



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: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarTomasz Lis <tomasz.lis@intel.com>
Link: https://lore.kernel.org/r/20251008214532.3442967-7-matthew.brost@intel.com
parent b00d1e3f
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -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);
	}