public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: intel-xe@lists.freedesktop.org, niranjana.vishwanathapura@intel.com
Cc: matthew.brost@intel.com
Subject: [PATCH 1/5] drm/xe/multi_queue: Store primary queue and position info in LRC
Date: Thu,  9 Apr 2026 13:37:16 -0700	[thread overview]
Message-ID: <20260409203714.1887402-8-umesh.nerlige.ramappa@intel.com> (raw)
In-Reply-To: <20260409203714.1887402-7-umesh.nerlige.ramappa@intel.com>

Given an LRC belonging to the secondary queue, in order to check if its
context group is active, we need to check the LRC of the primary queue.
In addition to that we want to compare the secondary queue position to
CSMQDEBUG register to check if the queue itself is active.

To do so, store primary queue and position information int the LRC.

Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
 drivers/gpu/drm/xe/xe_exec_queue.c |  8 +++++++-
 drivers/gpu/drm/xe/xe_lrc.h        |  5 +++++
 drivers/gpu/drm/xe/xe_lrc_types.h  | 10 ++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index b287d0e0e60a..4fb02eda77b4 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -275,8 +275,14 @@ static void xe_exec_queue_set_lrc(struct xe_exec_queue *q, struct xe_lrc *lrc, u
 {
 	xe_assert(gt_to_xe(q->gt), idx < q->width);
 
-	scoped_guard(spinlock, &q->lrc_lookup_lock)
+	scoped_guard(spinlock, &q->lrc_lookup_lock) {
 		q->lrc[idx] = lrc;
+		if (xe_exec_queue_is_multi_queue(q)) {
+			lrc->multi_queue.primary = q->multi_queue.group->primary;
+			lrc->multi_queue.pos = q->multi_queue.pos;
+			lrc->multi_queue.valid = 1;
+		}
+	}
 }
 
 /**
diff --git a/drivers/gpu/drm/xe/xe_lrc.h b/drivers/gpu/drm/xe/xe_lrc.h
index e7c975f9e2d9..b544c8169967 100644
--- a/drivers/gpu/drm/xe/xe_lrc.h
+++ b/drivers/gpu/drm/xe/xe_lrc.h
@@ -90,6 +90,11 @@ static inline size_t xe_lrc_ring_size(void)
 	return SZ_16K;
 }
 
+static inline bool xe_lrc_is_multi_queue(struct xe_lrc *lrc)
+{
+	return lrc->multi_queue.valid;
+}
+
 size_t xe_gt_lrc_hang_replay_size(struct xe_gt *gt, enum xe_engine_class class);
 size_t xe_gt_lrc_size(struct xe_gt *gt, enum xe_engine_class class);
 u32 xe_lrc_pphwsp_offset(struct xe_lrc *lrc);
diff --git a/drivers/gpu/drm/xe/xe_lrc_types.h b/drivers/gpu/drm/xe/xe_lrc_types.h
index 5a718f759ed6..93972536214a 100644
--- a/drivers/gpu/drm/xe/xe_lrc_types.h
+++ b/drivers/gpu/drm/xe/xe_lrc_types.h
@@ -63,6 +63,16 @@ struct xe_lrc {
 
 	/** @ctx_timestamp: readout value of CTX_TIMESTAMP on last update */
 	u64 ctx_timestamp;
+
+	/** @multi_queue: Multi queue LRC related information */
+	struct {
+		/** @multi_queue.primary: Primary queue corresponding to this LRC */
+		struct xe_exec_queue *primary;
+		/** @multi_queue.valid: LRC belongs to a multi queue group */
+		u8 valid;
+		/** @multi_queue.pos: Position of LRC within the multi-queue group */
+		u8 pos;
+	} multi_queue;
 };
 
 struct xe_lrc_snapshot;
-- 
2.43.0


  reply	other threads:[~2026-04-09 20:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 20:37 [PATCH 0/5] Support run ticks for multi-queue use case Umesh Nerlige Ramappa
2026-04-09 20:37 ` Umesh Nerlige Ramappa [this message]
2026-04-09 20:59   ` [PATCH 1/5] drm/xe/multi_queue: Store primary queue and position info in LRC Matthew Brost
2026-04-09 23:30     ` Umesh Nerlige Ramappa
2026-04-13 21:33   ` Niranjana Vishwanathapura
2026-04-09 20:37 ` [PATCH 2/5] drm/xe/multi_queue: Add helpers to access CS QUEUE TIMESTAMP from lrc Umesh Nerlige Ramappa
2026-04-09 21:10   ` Matthew Brost
2026-04-09 21:16   ` Matthew Brost
2026-04-13 21:44   ` Niranjana Vishwanathapura
2026-04-09 20:37 ` [PATCH 3/5] drm/xe/multi_queue: Capture queue run times for active queues Umesh Nerlige Ramappa
2026-04-09 22:00   ` Matthew Brost
2026-04-09 22:23   ` Summers, Stuart
2026-04-09 23:54     ` Umesh Nerlige Ramappa
2026-04-09 23:03   ` Summers, Stuart
2026-04-13 22:09   ` Niranjana Vishwanathapura
2026-04-13 22:19     ` Umesh Nerlige Ramappa
2026-04-13 22:40       ` Niranjana Vishwanathapura
2026-04-09 20:37 ` [PATCH 4/5] drm/xe/multi_queue: Use QUEUE_TIMESTAMP as job timestamp for multi-queue Umesh Nerlige Ramappa
2026-04-09 21:20   ` Matthew Brost
2026-04-13 19:08   ` Niranjana Vishwanathapura
2026-04-09 20:37 ` [PATCH 5/5] drm/xe/multi_queue: Whitelist QUEUE_TIMESTAMP register Umesh Nerlige Ramappa
2026-04-13 18:17   ` Niranjana Vishwanathapura
2026-04-14 18:56     ` Umesh Nerlige Ramappa
2026-04-09 20:42 ` ✗ CI.checkpatch: warning for Support run ticks for multi-queue use case Patchwork
2026-04-09 20:44 ` ✗ CI.KUnit: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260409203714.1887402-8-umesh.nerlige.ramappa@intel.com \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=niranjana.vishwanathapura@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox