tests/intel/xe_exec_multi_queue: enable preempt flag for Q0
PATCH 1/1 tests/intel/xe_exec_multi_queue: enable preempt flag for Q0
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.
--- lib/xe/xe_spin.c | 2 +- tests/intel/xe_exec_multi_queue.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
lib/xe/xe_spin.c +1 -1
@@ -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 |
tests/intel/xe_exec_multi_queue.c +2 -2
@@ -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;
Signature · 1 line
2.43.0
Quoted 5 lines · Xin Wang
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.
Quoted 39 lines
Suggested-by Niranjana Vishwanathapura <[email protected]>Signed-off-by Xin Wang <[email protected]>---
lib/xe/xe_spin.c| 2 +-tests/intel/xe_exec_multi_queue.c| 4 ++--2 files changed, 3 insertions(+), 3 deletions(-)lib/xe/xe_spin.c +1
-1@@ -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 |tests/intel/xe_exec_multi_queue.c +2
-2@@ -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;Signature · 1 line
2.43.0