[PATCH i-g-t 3/8] lib/xe: add xe_exec_queue_create_class_gt

Juha-Pekka Heikkila
2026-03-20T13:46:49Z

add function to create exec queue with class and gt id

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
lib/xe/xe_ioctl.c | 20 ++++++++++++++++++++
lib/xe/xe_ioctl.h | 2 ++
2 files changed, 22 insertions(+)

diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
index 16aae05c9..1aa3b43ae 100644
--- a/lib/xe/xe_ioctl.c
+++ b/lib/xe/xe_ioctl.c
@@ -503,6 +503,26 @@ uint32_t xe_exec_queue_create_class(int fd, uint32_t vm, uint16_t class)
return create.exec_queue_id;
}

+uint32_t xe_exec_queue_create_class_gt(int fd, uint32_t vm, uint16_t class,
+ uint16_t gt_id)
+{
+ struct drm_xe_engine_class_instance instance = {
+ .engine_class = class,
+ .engine_instance = 0,
+ .gt_id = gt_id,
+ };
+ struct drm_xe_exec_queue_create create = {
+ .vm_id = vm,
+ .width = 1,
+ .num_placements = 1,
+ .instances = to_user_pointer(&instance),
+ };
+
+ igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &create), 0);
+
+ return create.exec_queue_id;
+}
+
int __xe_exec_queue_set_property(int fd, uint32_t exec_queue, uint32_t property,
uint64_t value)
{
diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
index 3ea651063..fbc4fcf99 100644
--- a/lib/xe/xe_ioctl.h
+++ b/lib/xe/xe_ioctl.h
@@ -83,6 +83,8 @@ uint32_t xe_exec_queue_create(int fd, uint32_t vm,
uint64_t ext);
uint32_t xe_bind_exec_queue_create(int fd, uint32_t vm, uint64_t ext);
uint32_t xe_exec_queue_create_class(int fd, uint32_t vm, uint16_t class);
+uint32_t xe_exec_queue_create_class_gt(int fd, uint32_t vm, uint16_t class,
+ uint16_t gt_id);
int __xe_exec_queue_set_property(int fd, uint32_t exec_queue, uint32_t property,
uint64_t value);
void xe_exec_queue_set_property(int fd, uint32_t exec_queue, uint32_t property,
--
2.43.0