[PATCH i-g-t 6/8] lib/intel_batchbuffer/xe: add bb exec path to use specific engine and gt

Juha-Pekka Heikkila
2026-03-20T13:47:13Z

Add __xe_bb_exec path to use specific engine/class/gt

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
lib/intel_batchbuffer.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index a3fa58b4f..5c0597869 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -2522,7 +2522,17 @@ int __xe_bb_exec(struct intel_bb *ibb, uint64_t flags, bool sync)
igt_assert_eq(ibb->num_relocs, 0);
igt_assert_eq(ibb->xe_bound, false);

- if (ibb->ctx) {
+ if (ibb->gt_id) {
+ unsigned short class = get_engine_class(ibb->fd, flags);
+
+ if (ibb->engine_id)
+ xe_exec_queue_destroy(ibb->fd, ibb->engine_id);
+
+ ibb->engine_id = engine_id = xe_exec_queue_create_class_gt(ibb->fd,
+ ibb->vm_id,
+ class,
+ ibb->gt_id);
+ } else if (ibb->ctx) {
engine_id = ibb->ctx;
} else if (ibb->last_engine != engine) {
struct drm_xe_engine_class_instance inst = { };
--
2.43.0