drm/xe: Fix xe_exec_queue_is_idle for parallel exec queues
authorMatthew Brost <matthew.brost@intel.com>
Wed, 20 Sep 2023 19:29:27 +0000 (15:29 -0400)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:43:10 +0000 (11:43 -0500)
Last little piece to support parallel exec queue is compute mode.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_exec_queue.c

index 23789122b5b1c22674174541efce5a33e4fd4c31..c88acecc3a90fc854c17286b83f4b373f0124864 100644 (file)
@@ -867,8 +867,17 @@ bool xe_exec_queue_ring_full(struct xe_exec_queue *q)
  */
 bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
 {
-       if (XE_WARN_ON(xe_exec_queue_is_parallel(q)))
-               return false;
+       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;