* [PATCH] tests/intel/xe_exec_multi_queue: enable preempt flag for Q0
@ 2026-01-14 6:32 Xin Wang
2026-01-14 6:39 ` Niranjana Vishwanathapura
0 siblings, 1 reply; 2+ messages in thread
From: Xin Wang @ 2026-01-14 6:32 UTC (permalink / raw)
To: igt-dev; +Cc: stuart.summers, Xin Wang, Niranjana Vishwanathapura
The spinner preempt flag enables queue preemption and multi-queue
switching. Always enable premept flag while inserting multi-queue
switch point. We need multi-queue switch point only in Q0 which
acts as a gating queue until all other queues with different
priorities are submitted to hardware.
Suggested-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Xin Wang <x.wang@intel.com>
---
lib/xe/xe_spin.c | 2 +-
tests/intel/xe_exec_multi_queue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
index 4dc110c22..0bc06aec3 100644
--- a/lib/xe/xe_spin.c
+++ b/lib/xe/xe_spin.c
@@ -181,7 +181,7 @@ void xe_spin_init(struct xe_spin *spin, struct xe_spin_opts *opts)
*/
if (opts->multi_queue_switch) {
uint64_t wait_addr = opts->addr + offsetof(struct xe_spin, wait_cond);
-
+ igt_assert_f(opts->preempt, "preempt field is required to enable multi-queue switching\n");
spin->batch[b++] = MI_SEMAPHORE_WAIT_CMD |
MI_SEMAPHORE_POLL |
MI_SEMAPHORE_QUEUE_SWITCH_MODE |
diff --git a/tests/intel/xe_exec_multi_queue.c b/tests/intel/xe_exec_multi_queue.c
index 6bc6f9f63..32a84ef6b 100644
--- a/tests/intel/xe_exec_multi_queue.c
+++ b/tests/intel/xe_exec_multi_queue.c
@@ -453,8 +453,8 @@ __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);
+ /* Insert multi-queue switch point in Q0 to validate priority based queue switching */
+ xe_spin_init_opts(spin[i], .addr = spin_addr, .multi_queue_switch = !i, .preempt = !i);
sync.addr = spin_addr + (char *)&spin[i]->exec_sync - (char *)spin[i];
exec.exec_queue_id = exec_queues[i];
exec.address = spin_addr;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tests/intel/xe_exec_multi_queue: enable preempt flag for Q0
2026-01-14 6:32 [PATCH] tests/intel/xe_exec_multi_queue: enable preempt flag for Q0 Xin Wang
@ 2026-01-14 6:39 ` Niranjana Vishwanathapura
0 siblings, 0 replies; 2+ messages in thread
From: Niranjana Vishwanathapura @ 2026-01-14 6:39 UTC (permalink / raw)
To: Xin Wang; +Cc: igt-dev, stuart.summers
On Wed, Jan 14, 2026 at 06:32:36AM +0000, Xin Wang wrote:
>The spinner preempt flag enables queue preemption and multi-queue
>switching. Always enable premept flag while inserting multi-queue
>switch point. We need multi-queue switch point only in Q0 which
>acts as a gating queue until all other queues with different
>priorities are submitted to hardware.
NIT...may be bit of rewording...
"In priority test, we need multi-queue switch point only in Q0..."
In any case, LGTM.
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
>
>Suggested-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
>Signed-off-by: Xin Wang <x.wang@intel.com>
>---
> lib/xe/xe_spin.c | 2 +-
> tests/intel/xe_exec_multi_queue.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
>index 4dc110c22..0bc06aec3 100644
>--- a/lib/xe/xe_spin.c
>+++ b/lib/xe/xe_spin.c
>@@ -181,7 +181,7 @@ void xe_spin_init(struct xe_spin *spin, struct xe_spin_opts *opts)
> */
> if (opts->multi_queue_switch) {
> uint64_t wait_addr = opts->addr + offsetof(struct xe_spin, wait_cond);
>-
>+ igt_assert_f(opts->preempt, "preempt field is required to enable multi-queue switching\n");
> spin->batch[b++] = MI_SEMAPHORE_WAIT_CMD |
> MI_SEMAPHORE_POLL |
> MI_SEMAPHORE_QUEUE_SWITCH_MODE |
>diff --git a/tests/intel/xe_exec_multi_queue.c b/tests/intel/xe_exec_multi_queue.c
>index 6bc6f9f63..32a84ef6b 100644
>--- a/tests/intel/xe_exec_multi_queue.c
>+++ b/tests/intel/xe_exec_multi_queue.c
>@@ -453,8 +453,8 @@ __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);
>+ /* Insert multi-queue switch point in Q0 to validate priority based queue switching */
>+ xe_spin_init_opts(spin[i], .addr = spin_addr, .multi_queue_switch = !i, .preempt = !i);
> sync.addr = spin_addr + (char *)&spin[i]->exec_sync - (char *)spin[i];
> exec.exec_queue_id = exec_queues[i];
> exec.address = spin_addr;
>--
>2.43.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-14 6:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-14 6:32 [PATCH] tests/intel/xe_exec_multi_queue: enable preempt flag for Q0 Xin Wang
2026-01-14 6:39 ` Niranjana Vishwanathapura
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox