From 285a1ec4a45888f304caf2e5e91e35b6dc8b850d Mon Sep 17 00:00:00 2001 From: Matthew Brost Date: Fri, 25 Sep 2026 13:15:06 -0700 Subject: [PATCH] drm/xe: Decouple exec queue idle check from LRC We already maintain a job count for each exec queue, so simplify the idle check to rely on the job count rather than the LRC state. This decouples exec queues from LRC-based backends and avoids unnecessarily coupling idle detection to backend-specific implementation details. Signed-off-by: Matthew Brost Reviewed-by: Stuart Summers Reviewed-by: Maarten Lankhorst Link: https://patch.msgid.link/20260925201526.1355279-5-matthew.brost@intel.com --- drivers/gpu/drm/xe/xe_exec_queue.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index e63559a2f582..7bbb31431900 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -1580,20 +1580,7 @@ bool xe_exec_queue_is_lr(struct xe_exec_queue *q) */ bool xe_exec_queue_is_idle(struct xe_exec_queue *q) { - if (xe_exec_queue_is_parallel(q)) { - int i; - - for (i = 0; i < q->width; ++i) { - if (xe_lrc_seqno(q->lrc[i]) != - q->lrc[i]->fence_ctx.next_seqno - 1) - return false; - } - - return true; - } - - return xe_lrc_seqno(q->lrc[0]) == - q->lrc[0]->fence_ctx.next_seqno - 1; + return !atomic_read(&q->job_cnt); } /**