From: "Wang, X" <x.wang@intel.com>
To: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH 1/3] lib/xe/xe_spin: Enhance multi-queue switch option
Date: Wed, 6 May 2026 17:50:57 -0700 [thread overview]
Message-ID: <78796e94-e168-4764-873f-4783bac3a6a8@intel.com> (raw)
In-Reply-To: <20260506183137.51479-6-niranjana.vishwanathapura@intel.com>
On 5/6/2026 11:31, Niranjana Vishwanathapura wrote:
> From: gta <gta@DUT4637NVLP.fm.intel.com>
Hi Niranjana,
It looks like each patch has a stray "From: gta
<gta@DUT4637NVLP.fm.intel.com>"
line in the commit message body, likely due to a local git config mismatch.
Please fix and resend as v2.
Xin
> Allow user to control whether the multi-queue switch should
> happen after parsing the MI_SEMAPHORE_WAIT instruction or
> only if the instruction is unsuccessful in getting the
> semaphore, thus having to wait.
>
> Ensure that in xe_exec_multi_queue@priority test, the multi-queue
> switch happens only when the spinner has to wait for the semaphore.
>
> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
> ---
> lib/xe/xe_spin.c | 13 +++++++------
> lib/xe/xe_spin.h | 6 +++++-
> tests/intel/xe_exec_multi_queue.c | 2 +-
> 3 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
> index 4dc110c222..14952ca90e 100644
> --- a/lib/xe/xe_spin.c
> +++ b/lib/xe/xe_spin.c
> @@ -179,14 +179,15 @@ void xe_spin_init(struct xe_spin *spin, struct xe_spin_opts *opts)
> * Insert a MI_SEMAPHORE_WAIT_CMD instruction with condition controlled
> * by the user which acts as a queue switch point in multi queue mode.
> */
> - if (opts->multi_queue_switch) {
> + if (opts->multi_queue_switch || opts->multi_queue_switch_on_wait) {
> uint64_t wait_addr = opts->addr + offsetof(struct xe_spin, wait_cond);
> + uint32_t sema_cmd = MI_SEMAPHORE_WAIT_CMD | MI_SEMAPHORE_POLL |
> + MI_SEMAPHORE_SAD_EQ_SDD | 3;
>
> - spin->batch[b++] = MI_SEMAPHORE_WAIT_CMD |
> - MI_SEMAPHORE_POLL |
> - MI_SEMAPHORE_QUEUE_SWITCH_MODE |
> - MI_SEMAPHORE_SAD_EQ_SDD |
> - 3;
> + if (opts->multi_queue_switch_on_wait)
> + sema_cmd |= MI_SEMAPHORE_QUEUE_SWITCH_MODE;
> +
> + spin->batch[b++] = sema_cmd;
> spin->batch[b++] = 0;
> spin->batch[b++] = wait_addr;
> spin->batch[b++] = wait_addr >> 32;
> diff --git a/lib/xe/xe_spin.h b/lib/xe/xe_spin.h
> index 31154997b9..db0febd8ab 100644
> --- a/lib/xe/xe_spin.h
> +++ b/lib/xe/xe_spin.h
> @@ -46,7 +46,10 @@ struct xe_spin_mem_copy {
> * struct xe_spin_opts
> * @addr: offset of spinner within vm
> * @preempt: allow spinner to be preempted or not
> - * @multi_queue_switch: Add a multi-queue switch point
> + * @multi_queue_switch: Add a SEMAPHORE_WAIT multi-queue switch point
> + * and have the queue switch happen after command is parsed.
> + * @multi_queue_switch_on_wait: Add a SEMAPHORE_WAIT multi-queue switch point
> + * and have the queue switch only happen if waiting on the semaphore.
> * @ctx_ticks: number of ticks after which spinner is stopped, applied if > 0
> * @mem_copy: container of objects used for memory copy (optional)
> *
> @@ -56,6 +59,7 @@ struct xe_spin_opts {
> uint64_t addr;
> bool preempt;
> bool multi_queue_switch;
> + bool multi_queue_switch_on_wait;
> uint32_t ctx_ticks;
> bool write_timestamp;
> struct xe_spin_mem_copy *mem_copy;
> diff --git a/tests/intel/xe_exec_multi_queue.c b/tests/intel/xe_exec_multi_queue.c
> index 0479554bb6..6f90c3e4e8 100644
> --- a/tests/intel/xe_exec_multi_queue.c
> +++ b/tests/intel/xe_exec_multi_queue.c
> @@ -459,7 +459,7 @@ __test_priority(int fd, struct drm_xe_engine_class_instance *eci,
> for (i = 0; i < num_queues; i++) {
> uint64_t spin_addr = addr + i * sizeof(struct xe_spin);
>
> - xe_spin_init_opts(spin[i], .addr = spin_addr, .multi_queue_switch = true,
> + xe_spin_init_opts(spin[i], .addr = spin_addr, .multi_queue_switch_on_wait = true,
> .write_timestamp = true);
> /*
> * Pre-set all spinners to preempt-wait so each queue, once
next prev parent reply other threads:[~2026-05-07 0:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 18:31 [PATCH 0/3] tests/intel/xe_exec_reset: Validate multi-queue timestamping Niranjana Vishwanathapura
2026-05-06 18:31 ` [PATCH 1/3] lib/xe/xe_spin: Enhance multi-queue switch option Niranjana Vishwanathapura
2026-05-07 0:50 ` Wang, X [this message]
2026-05-07 19:15 ` Summers, Stuart
2026-05-07 20:11 ` Niranjana Vishwanathapura
2026-05-06 18:31 ` [PATCH 2/3] lib/xe/xe_spin: Add option for QUEUE_TIMESTAMP Niranjana Vishwanathapura
2026-05-07 19:23 ` Summers, Stuart
2026-05-07 19:41 ` Umesh Nerlige Ramappa
2026-05-07 20:05 ` Summers, Stuart
2026-05-07 20:07 ` Niranjana Vishwanathapura
2026-05-06 18:31 ` [PATCH 3/3] tests/intel/xe_exec_reset: Add multi-queue long spin tests Niranjana Vishwanathapura
2026-05-07 19:37 ` Summers, Stuart
2026-05-07 20:11 ` Niranjana Vishwanathapura
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=78796e94-e168-4764-873f-4783bac3a6a8@intel.com \
--to=x.wang@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--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