Skip to contentSkip to conversation

Integrate igt_spin_new with Xe.

PATCH In review [email protected] 4 participants 11 messages May 25, 2023 – May 30, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Integrate igt_spin_new with Xe.

From: Sai Gowtham Ch <[email protected]>

Extending the spin_create implementation and allocator handle support in xe, where it submits dummy work loads to engine. This Implementation is wrapped around vm_bind and unbind as we are supposed to do it manually for xe.

Cc Zbigniew Kempczyński <[email protected]>

Sai Gowtham Ch (2):
lib/xe/xe_spin: Integrate igt_spin_new with Xe. tests/xe/xe_spin_batch: Add new test to exercise igt_spin_new for xe.

 lib/igt_dummyload.c      |  24 +++++--
 lib/igt_dummyload.h      |  10 +++
 lib/xe/xe_spin.c         |  89 +++++++++++++++++++++++++
 lib/xe/xe_spin.h         |   7 ++
 tests/meson.build        |   1 +
 tests/xe/xe_spin_batch.c | 138 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 263 insertions(+), 6 deletions(-)
 create mode 100644 tests/xe/xe_spin_batch.c
Signature · 1 line
2.39.1
#1 lore raw

PATCH 1/2 lib/xe/xe_spin: Integrate igt_spin_new with Xe.

From: Sai Gowtham Ch <[email protected]>

Extending the spin_create implementation and allocator handle support in xe, where it submits dummy work loads to engine. This Implementation is wrapped around vm_bind and unbind as we are supposed to do it manually for xe.

Cc Zbigniew Kempczyński <[email protected]>
---
 lib/igt_dummyload.c | 24 +++++++++---
 lib/igt_dummyload.h | 10 +++++
 lib/xe/xe_spin.c    | 89 +++++++++++++++++++++++++++++++++++++++++++++
 lib/xe/xe_spin.h    |  7 ++++
 4 files changed, 124 insertions(+), 6 deletions(-)
lib/igt_dummyload.c +18 -6
index 740a58f3..6e89b72d 100644
@@ -46,6 +46,7 @@
 #include "intel_reg.h"
 #include "ioctl_wrappers.h"
 #include "sw_sync.h"
+#include "xe/xe_spin.h"
 
 /**
  * SECTION:igt_dummyload
@@ -447,7 +448,10 @@ spin_create(int fd, const struct igt_spin_factory *opts)
 igt_spin_t *
 __igt_spin_factory(int fd, const struct igt_spin_factory *opts)
 {
-	return spin_create(fd, opts);
+	if (is_xe_device(fd))
+		return xe_spin_create(fd, opts);
+	else
+		return spin_create(fd, opts);
 }
 
 /**
@@ -467,6 +471,11 @@ igt_spin_factory(int fd, const struct igt_spin_factory *opts)
 {
 	igt_spin_t *spin;
 
+	if (is_xe_device(fd)) {
+		spin = xe_spin_create(fd, opts);
+		return spin;
+	}
+
 	if ((opts->flags & IGT_SPIN_POLL_RUN) && opts->engine != ALL_ENGINES) {
 		unsigned int class;
 
@@ -647,11 +656,14 @@ void igt_spin_free(int fd, igt_spin_t *spin)
 	if (!spin)
 		return;
 
-	pthread_mutex_lock(&list_lock);
-	igt_list_del(&spin->link);
-	pthread_mutex_unlock(&list_lock);
-
-	__igt_spin_free(fd, spin);
+	if (is_xe_device(fd)) {
+		xe_spin_free(fd, spin);
+	} else {
+		pthread_mutex_lock(&list_lock);
+		igt_list_del(&spin->link);
+		pthread_mutex_unlock(&list_lock);
+		__igt_spin_free(fd, spin);
+	}
 }
 
 void igt_terminate_spins(void)
lib/igt_dummyload.h +10 -0
index b247ab02..7bcc7b56 100644
@@ -54,6 +54,8 @@ typedef struct igt_spin_factory {
 	unsigned int flags;
 	int fence;
 	uint64_t ahnd;
+	struct drm_xe_engine_class_instance *hwe;
+	uint32_t vm;
 } igt_spin_factory_t;
 
 typedef struct igt_spin {
@@ -83,6 +85,14 @@ typedef struct igt_spin {
 #define SPIN_CLFLUSH (1 << 0)
 
 	struct igt_spin_factory opts;
+
+	struct xe_spin *xe_spin;
+	size_t bo_size;
+	uint64_t address;
+	unsigned int engine;
+	uint32_t vm;
+	uint32_t syncobj;
+
 } igt_spin_t;
 
 
lib/xe/xe_spin.c +89 -0

101 lines not on this page · raw message

lib/xe/xe_spin.h +7 -0
index 73f9a026..48867eb8 100644
@@ -13,19 +13,26 @@
 #include <stdbool.h>
 
 #include "xe_query.h"
+#include "lib/igt_dummyload.h"
 
 /* Mapped GPU object */
+
 struct xe_spin {
 	uint32_t batch[16];
 	uint64_t pad;
 	uint32_t start;
 	uint32_t end;
+
 };
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt);
 void xe_spin_init(struct xe_spin *spin, uint64_t addr, bool preempt);
 bool xe_spin_started(struct xe_spin *spin);
+void xe_spin_sync_wait(int fd, struct igt_spin *spin);
 void xe_spin_wait_started(struct xe_spin *spin);
 void xe_spin_end(struct xe_spin *spin);
+void xe_spin_free(int fd, struct igt_spin *spin);
 
 struct xe_cork {
 	struct xe_spin *spin;
Signature · 1 line
2.39.1
#2 lore raw

Re: [igt-dev] [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

Quoted 153 lines · On Thu, May 25, 2023 at 11:25:18AM +0530, [email protected] wrote:

From: Sai Gowtham Ch <[email protected]>

Extending the spin_create implementation and allocator handle support in xe, where it submits dummy work loads to engine. This Implementation is wrapped around vm_bind and unbind as we are supposed to do it manually for xe.

Cc Zbigniew Kempczyński <[email protected]>
---
 lib/igt_dummyload.c | 24 +++++++++---
 lib/igt_dummyload.h | 10 +++++
 lib/xe/xe_spin.c    | 89 +++++++++++++++++++++++++++++++++++++++++++++
 lib/xe/xe_spin.h    |  7 ++++
 4 files changed, 124 insertions(+), 6 deletions(-)
lib/igt_dummyload.c +18 -6
index 740a58f3..6e89b72d 100644
@@ -46,6 +46,7 @@
 #include "intel_reg.h"
 #include "ioctl_wrappers.h"
 #include "sw_sync.h"
+#include "xe/xe_spin.h"
 
 /**
  * SECTION:igt_dummyload
@@ -447,7 +448,10 @@ spin_create(int fd, const struct igt_spin_factory *opts)
 igt_spin_t *
 __igt_spin_factory(int fd, const struct igt_spin_factory *opts)
 {
-	return spin_create(fd, opts);
+	if (is_xe_device(fd))
+		return xe_spin_create(fd, opts);
+	else
+		return spin_create(fd, opts);
 }
 
 /**
@@ -467,6 +471,11 @@ igt_spin_factory(int fd, const struct igt_spin_factory *opts)
 {
 	igt_spin_t *spin;
 
+	if (is_xe_device(fd)) {
+		spin = xe_spin_create(fd, opts);
+		return spin;
+	}
+
 	if ((opts->flags & IGT_SPIN_POLL_RUN) && opts->engine != ALL_ENGINES) {
 		unsigned int class;
 
@@ -647,11 +656,14 @@ void igt_spin_free(int fd, igt_spin_t *spin)
 	if (!spin)
 		return;
 
-	pthread_mutex_lock(&list_lock);
-	igt_list_del(&spin->link);
-	pthread_mutex_unlock(&list_lock);
-
-	__igt_spin_free(fd, spin);
+	if (is_xe_device(fd)) {
+		xe_spin_free(fd, spin);
+	} else {
+		pthread_mutex_lock(&list_lock);
+		igt_list_del(&spin->link);
+		pthread_mutex_unlock(&list_lock);
+		__igt_spin_free(fd, spin);
+	}
 }
 
 void igt_terminate_spins(void)
lib/igt_dummyload.h +10 -0
index b247ab02..7bcc7b56 100644
@@ -54,6 +54,8 @@ typedef struct igt_spin_factory {
 	unsigned int flags;
 	int fence;
 	uint64_t ahnd;
+	struct drm_xe_engine_class_instance *hwe;
+	uint32_t vm;
 } igt_spin_factory_t;
 
 typedef struct igt_spin {
@@ -83,6 +85,14 @@ typedef struct igt_spin {
 #define SPIN_CLFLUSH (1 << 0)
 
 	struct igt_spin_factory opts;
+
+	struct xe_spin *xe_spin;
+	size_t bo_size;
+	uint64_t address;
+	unsigned int engine;
+	uint32_t vm;
+	uint32_t syncobj;
+
 } igt_spin_t;
 
 
lib/xe/xe_spin.c +39 -0
index 856d0ba2..3a8c7bb3 100644
@@ -15,6 +15,7 @@
 #include "intel_reg.h"
 #include "xe_ioctl.h"
 #include "xe_spin.h"
+#include "lib/igt_dummyload.h"
 
 /**
  * xe_spin_init:
@@ -82,6 +83,94 @@ void xe_spin_end(struct xe_spin *spin)
 	spin->end = 0;
 }
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt)
+{
+	size_t bo_size = xe_get_default_alignment(fd);
+	uint32_t bo;
+	uint64_t ahnd = opt->ahnd, addr;
+	struct igt_spin *spin;
+	struct xe_spin *xe_spin;
+	struct drm_xe_sync sync = {
+		.flags = DRM_XE_SYNC_SYNCOBJ | DRM_XE_SYNC_SIGNAL,
+	};
+	struct drm_xe_exec exec = {
+		.num_batch_buffer = 1,
+		.num_syncs = 1,
+		.syncs = to_user_pointer(&sync),
+	};
+
+	igt_assert(ahnd);
+	spin = calloc(1, sizeof(struct igt_spin));
+	igt_assert(spin);
+
+	spin->syncobj = syncobj_create(fd, 0);
+	if (opt->engine) {
+		spin->opts.engine = opt->engine;
+		spin->opts.vm = opt->vm;
+
+		spin->handle = xe_bo_create(fd, 0, spin->opts.vm, bo_size);
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle, bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);
+		xe_vm_bind_sync(fd, spin->opts.vm, spin->handle, 0, addr, bo_size);
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->opts.engine;
+		exec.address = addr;
+	} else {
+		spin->vm = xe_vm_create(fd, 0, 0);
+		spin->engine = xe_engine_create(fd, spin->vm, opt->hwe, 0);
+

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 133

Quoted 10 lines
lib/xe/xe_spin.c +10 -0
+		bo = xe_bo_create(fd, 0, spin->vm, bo_size);
+		spin->handle = bo;
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle, bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);
+		xe_vm_bind_sync(fd, spin->vm, spin->handle, 0, addr, bo_size);
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->engine;
+		exec.address = addr;
+	}

I think you should support two variants of executing spinners:

1. hwe != NULL (in this case engine must be 0):
if (!vm) -> create vm;
create engine for vm according to hwe

2. engine != 0, vm must be vm on top of which engine was created hwe must be NULL in this case
see Dominik answer about passing engine+vm in:
https://patchwork.freedesktop.org/patch/539173/?series=118227&rev=2

And add support ALL_ENGINES flag (then iterate over all hw engines like Bhanu suggested). And track engine ownership - if caller is the engine/vm owner use it but don't destroy, if spinner code is creating engine you may freely destroy it in spinner free path().

--
Zbigniew

Quoted 77 lines
lib/xe/xe_spin.c +40 -0
+	sync.handle = spin->syncobj;
+	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_EXEC, &exec), 0);
+	xe_spin_wait_started(xe_spin);
+	igt_info("Spinner started\n");
+
+	spin->bo_size = bo_size;
+	spin->address = addr;
+	spin->xe_spin = xe_spin;
+
+	return spin;
+}
+
+void xe_spin_sync_wait(int fd, struct igt_spin *spin)
+{
+	igt_assert(syncobj_wait(fd, &spin->syncobj, 1, INT64_MAX, 0,
+				NULL));
+}
+
+void xe_spin_free(int fd, struct igt_spin *spin)
+{
+	xe_spin_end(spin->xe_spin);
+	xe_spin_sync_wait(fd, spin);
+
+	if (!spin->opts.engine) {
+		xe_vm_unbind_sync(fd, spin->vm, 0, spin->address, spin->bo_size);
+	} else {
+		xe_vm_unbind_sync(fd, spin->opts.vm, 0, spin->address, spin->bo_size);
+	}
+
+	syncobj_destroy(fd, spin->syncobj);
+	gem_munmap(spin->xe_spin, spin->bo_size);
+	gem_close(fd, spin->handle);
+
+	if (!spin->opts.engine) {
+		xe_engine_destroy(fd, spin->engine);
+		xe_vm_destroy(fd, spin->vm);
+	}
+	free(spin);
+}
+
 void xe_cork_init(int fd, struct drm_xe_engine_class_instance *hwe,
 		  struct xe_cork *cork)
 {
lib/xe/xe_spin.h +7 -0
index 73f9a026..48867eb8 100644
@@ -13,19 +13,26 @@
 #include <stdbool.h>
 
 #include "xe_query.h"
+#include "lib/igt_dummyload.h"
 
 /* Mapped GPU object */
+
 struct xe_spin {
 	uint32_t batch[16];
 	uint64_t pad;
 	uint32_t start;
 	uint32_t end;
+
 };
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt);
 void xe_spin_init(struct xe_spin *spin, uint64_t addr, bool preempt);
 bool xe_spin_started(struct xe_spin *spin);
+void xe_spin_sync_wait(int fd, struct igt_spin *spin);
 void xe_spin_wait_started(struct xe_spin *spin);
 void xe_spin_end(struct xe_spin *spin);
+void xe_spin_free(int fd, struct igt_spin *spin);
 
 struct xe_cork {
 	struct xe_spin *spin;
Signature · 1 line
2.39.1
#3 lore raw

Re: [igt-dev] [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

Quoted 185 lines

-----Original Message-----
From: Kempczynski, Zbigniew <[email protected]>
Sent: Monday, May 29, 2023 11:21 AM
To: Ch, Sai Gowtham <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

Quoted 5 lines · On Thu, May 25, 2023 at 11:25:18AM +0530, [email protected] wrote:

From: Sai Gowtham Ch <[email protected]>

Extending the spin_create implementation and allocator handle support in xe, where it submits dummy work loads to engine. This Implementation is wrapped around vm_bind and unbind as we are supposed to

do it manually for xe.

Quoted 33 lines
Cc Zbigniew Kempczyński <[email protected]>
---
 lib/igt_dummyload.c | 24 +++++++++---  lib/igt_dummyload.h | 10 +++++
 lib/xe/xe_spin.c    | 89 +++++++++++++++++++++++++++++++++++++++++++++
 lib/xe/xe_spin.h    |  7 ++++
 4 files changed, 124 insertions(+), 6 deletions(-)
lib/igt_dummyload.c index renamed from lib/igt_dummyload.c +0 -0

740a58f3..6e89b72d 100644

lib/igt_dummyload.c +5 -1
@@ -46,6 +46,7 @@
 #include "intel_reg.h"
 #include "ioctl_wrappers.h"
 #include "sw_sync.h"
+#include "xe/xe_spin.h"
 
 /**
  * SECTION:igt_dummyload
@@ -447,7 +448,10 @@ spin_create(int fd, const struct igt_spin_factory
 *opts)  igt_spin_t *  __igt_spin_factory(int fd, const struct
 igt_spin_factory *opts)  {
-	return spin_create(fd, opts);
+	if (is_xe_device(fd))
+		return xe_spin_create(fd, opts);
+	else
+		return spin_create(fd, opts);
 }
 
 /**

lib/igt_dummyload.c igt_spin_factory(int fd, const struct · line 479

Quoted 9 lines
lib/igt_dummyload.c +5 -0
@@ -467,6 +471,11 @@ igt_spin_factory(int fd, const struct
 igt_spin_factory *opts)  {
 	igt_spin_t *spin;
 
+	if (is_xe_device(fd)) {
+		spin = xe_spin_create(fd, opts);
+		return spin;
+	}
+
 	if ((opts->flags & IGT_SPIN_POLL_RUN) && opts->engine !=

ALL_ENGINES) {

Quoted 84 lines
lib/igt_dummyload.c +8 -5
 		unsigned int class;
 
@@ -647,11 +656,14 @@ void igt_spin_free(int fd, igt_spin_t *spin)
 	if (!spin)
 		return;
 
-	pthread_mutex_lock(&list_lock);
-	igt_list_del(&spin->link);
-	pthread_mutex_unlock(&list_lock);
-
-	__igt_spin_free(fd, spin);
+	if (is_xe_device(fd)) {
+		xe_spin_free(fd, spin);
+	} else {
+		pthread_mutex_lock(&list_lock);
+		igt_list_del(&spin->link);
+		pthread_mutex_unlock(&list_lock);
+		__igt_spin_free(fd, spin);
+	}
 }
 
 void igt_terminate_spins(void)
lib/igt_dummyload.h index renamed from lib/igt_dummyload.h +0 -0

b247ab02..7bcc7b56 100644

lib/igt_dummyload.h +10 -0
@@ -54,6 +54,8 @@ typedef struct igt_spin_factory {
 	unsigned int flags;
 	int fence;
 	uint64_t ahnd;
+	struct drm_xe_engine_class_instance *hwe;
+	uint32_t vm;
 } igt_spin_factory_t;
 
 typedef struct igt_spin {
@@ -83,6 +85,14 @@ typedef struct igt_spin {  #define SPIN_CLFLUSH (1
 << 0)
 
 	struct igt_spin_factory opts;
+
+	struct xe_spin *xe_spin;
+	size_t bo_size;
+	uint64_t address;
+	unsigned int engine;
+	uint32_t vm;
+	uint32_t syncobj;
+
 } igt_spin_t;
 
 
lib/xe/xe_spin.c index renamed from lib/xe/xe_spin.c +0 -0

856d0ba2..3a8c7bb3 100644

lib/xe/xe_spin.c +19 -0
@@ -15,6 +15,7 @@
 #include "intel_reg.h"
 #include "xe_ioctl.h"
 #include "xe_spin.h"
+#include "lib/igt_dummyload.h"
 
 /**
  * xe_spin_init:
@@ -82,6 +83,94 @@ void xe_spin_end(struct xe_spin *spin)
 	spin->end = 0;
 }
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt) {
+	size_t bo_size = xe_get_default_alignment(fd);
+	uint32_t bo;
+	uint64_t ahnd = opt->ahnd, addr;
+	struct igt_spin *spin;
+	struct xe_spin *xe_spin;
+	struct drm_xe_sync sync = {
+		.flags = DRM_XE_SYNC_SYNCOBJ | DRM_XE_SYNC_SIGNAL,
+	};
+	struct drm_xe_exec exec = {
+		.num_batch_buffer = 1,
+		.num_syncs = 1,
+		.syncs = to_user_pointer(&sync),
+	};
+
+	igt_assert(ahnd);
+	spin = calloc(1, sizeof(struct igt_spin));

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 113

Quoted 10 lines
lib/xe/xe_spin.c +10 -0
+	igt_assert(spin);
+
+	spin->syncobj = syncobj_create(fd, 0);
+	if (opt->engine) {
+		spin->opts.engine = opt->engine;
+		spin->opts.vm = opt->vm;
+
+		spin->handle = xe_bo_create(fd, 0, spin->opts.vm, bo_size);
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle,

bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 114

Quoted 1 line
lib/xe/xe_spin.c +1 -0
+		xe_vm_bind_sync(fd, spin->opts.vm, spin->handle, 0, addr,

bo_size);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin)

Quoted 12 lines
lib/xe/xe_spin.c +12 -0
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->opts.engine;
+		exec.address = addr;
+	} else {
+		spin->vm = xe_vm_create(fd, 0, 0);
+		spin->engine = xe_engine_create(fd, spin->vm, opt->hwe, 0);
+
+		bo = xe_bo_create(fd, 0, spin->vm, bo_size);
+		spin->handle = bo;
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle,

bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 133

Quoted 6 lines
lib/xe/xe_spin.c +6 -0
+		xe_vm_bind_sync(fd, spin->vm, spin->handle, 0, addr, bo_size);
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->engine;
+		exec.address = addr;
+	}

I think you should support two variants of executing spinners:

1. hwe != NULL (in this case engine must be 0):
if (!vm) -> create vm;
create engine for vm according to hwe

2. engine != 0, vm must be vm on top of which engine was created hwe must be NULL in this case
see Dominik answer about passing engine+vm in:

Quoted 7 lines
   https://patchwork.freedesktop.org/patch/539173/?series=118227&rev=2

And add support ALL_ENGINES flag (then iterate over all hw engines like Bhanu suggested). And track engine ownership - if caller is the engine/vm owner use it but don't destroy, if spinner code is creating engine you may freely destroy it in spinner free path().

Do we have Driver support for ALL_ENGINES flag ??

I think what Bhanu asking for is as kms tests doesn’t need hwe, We have to pass hwe from the xe_spin_create it self. In that case we can add a support in xe_spin_create where hwe = 0 and engine = 0 ( Note this is only for kms tests) .

I feel ALL_ENGINES support can be added later, Once kms tests are unblocked.

Regarding igt_spin_free, I've already added support not to destroy vm and engines if they are passed from the igt test. Can you have a look at igt_spin_free (Verified it's working fine for me).
-----
Gowtham

Quoted 81 lines

--
Zbigniew

Quoted 77 lines
lib/xe/xe_spin.c +38 -0
+	sync.handle = spin->syncobj;
+	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_EXEC, &exec), 0);
+	xe_spin_wait_started(xe_spin);
+	igt_info("Spinner started\n");
+
+	spin->bo_size = bo_size;
+	spin->address = addr;
+	spin->xe_spin = xe_spin;
+
+	return spin;
+}
+
+void xe_spin_sync_wait(int fd, struct igt_spin *spin) {
+	igt_assert(syncobj_wait(fd, &spin->syncobj, 1, INT64_MAX, 0,
+				NULL));
+}
+
+void xe_spin_free(int fd, struct igt_spin *spin) {
+	xe_spin_end(spin->xe_spin);
+	xe_spin_sync_wait(fd, spin);
+
+	if (!spin->opts.engine) {
+		xe_vm_unbind_sync(fd, spin->vm, 0, spin->address, spin-
 bo_size);
+	} else {
+		xe_vm_unbind_sync(fd, spin->opts.vm, 0, spin->address, spin-
 bo_size);
+	}
+
+	syncobj_destroy(fd, spin->syncobj);
+	gem_munmap(spin->xe_spin, spin->bo_size);
+	gem_close(fd, spin->handle);
+
+	if (!spin->opts.engine) {
+		xe_engine_destroy(fd, spin->engine);
+		xe_vm_destroy(fd, spin->vm);
+	}
+	free(spin);
+}
+
 void xe_cork_init(int fd, struct drm_xe_engine_class_instance *hwe,
 		  struct xe_cork *cork)
 {
lib/xe/xe_spin.h index renamed from lib/xe/xe_spin.h +0 -0

73f9a026..48867eb8 100644

lib/xe/xe_spin.h +7 -1
@@ -13,19 +13,26 @@
 #include <stdbool.h>
 
 #include "xe_query.h"
+#include "lib/igt_dummyload.h"
 
 /* Mapped GPU object */
+
 struct xe_spin {
 	uint32_t batch[16];
 	uint64_t pad;
 	uint32_t start;
 	uint32_t end;
+
 };
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt);
 void xe_spin_init(struct xe_spin *spin, uint64_t addr, bool preempt);
 bool xe_spin_started(struct xe_spin *spin);
+void xe_spin_sync_wait(int fd, struct igt_spin *spin);
 void xe_spin_wait_started(struct xe_spin *spin);  void
 xe_spin_end(struct xe_spin *spin);
+void xe_spin_free(int fd, struct igt_spin *spin);
 
 struct xe_cork {
 	struct xe_spin *spin;
--

2.39.1

#4 lore raw

Re: [igt-dev] [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

Hi Sai,

Quoted 192 lines · Sai Gowtham
Quoted 187 lines

-----Original Message-----
From: Kempczynski, Zbigniew <[email protected]>
Sent: Monday, May 29, 2023 11:21 AM
To: Ch, Sai Gowtham <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

Quoted 5 lines · On Thu, May 25, 2023 at 11:25:18AM +0530, [email protected] wrote:

From: Sai Gowtham Ch <[email protected]>

Extending the spin_create implementation and allocator handle support in xe, where it submits dummy work loads to engine. This Implementation is wrapped around vm_bind and unbind as we are supposed to

do it manually for xe.

Quoted 33 lines
Cc Zbigniew Kempczyński <[email protected]>
---
  lib/igt_dummyload.c | 24 +++++++++---  lib/igt_dummyload.h | 10 +++++
  lib/xe/xe_spin.c    | 89 +++++++++++++++++++++++++++++++++++++++++++++
  lib/xe/xe_spin.h    |  7 ++++
  4 files changed, 124 insertions(+), 6 deletions(-)
lib/igt_dummyload.c index renamed from lib/igt_dummyload.c +0 -0

740a58f3..6e89b72d 100644

lib/igt_dummyload.c +5 -1
@@ -46,6 +46,7 @@
  #include "intel_reg.h"
  #include "ioctl_wrappers.h"
  #include "sw_sync.h"
+#include "xe/xe_spin.h"
 
  /**
   * SECTION:igt_dummyload
@@ -447,7 +448,10 @@ spin_create(int fd, const struct igt_spin_factory
 *opts)  igt_spin_t *  __igt_spin_factory(int fd, const struct
 igt_spin_factory *opts)  {
-	return spin_create(fd, opts);
+	if (is_xe_device(fd))
+		return xe_spin_create(fd, opts);
+	else
+		return spin_create(fd, opts);
  }
 
  /**

lib/igt_dummyload.c igt_spin_factory(int fd, const struct · line 479

Quoted 9 lines
lib/igt_dummyload.c +5 -0
@@ -467,6 +471,11 @@ igt_spin_factory(int fd, const struct
 igt_spin_factory *opts)  {
  	igt_spin_t *spin;
 
+	if (is_xe_device(fd)) {
+		spin = xe_spin_create(fd, opts);
+		return spin;
+	}
+
  	if ((opts->flags & IGT_SPIN_POLL_RUN) && opts->engine !=

ALL_ENGINES) {

Quoted 84 lines
lib/igt_dummyload.c +8 -5
  		unsigned int class;
 
@@ -647,11 +656,14 @@ void igt_spin_free(int fd, igt_spin_t *spin)
  	if (!spin)
  		return;
 
-	pthread_mutex_lock(&list_lock);
-	igt_list_del(&spin->link);
-	pthread_mutex_unlock(&list_lock);
-
-	__igt_spin_free(fd, spin);
+	if (is_xe_device(fd)) {
+		xe_spin_free(fd, spin);
+	} else {
+		pthread_mutex_lock(&list_lock);
+		igt_list_del(&spin->link);
+		pthread_mutex_unlock(&list_lock);
+		__igt_spin_free(fd, spin);
+	}
  }
 
  void igt_terminate_spins(void)
lib/igt_dummyload.h index renamed from lib/igt_dummyload.h +0 -0

b247ab02..7bcc7b56 100644

lib/igt_dummyload.h +10 -0
@@ -54,6 +54,8 @@ typedef struct igt_spin_factory {
  	unsigned int flags;
  	int fence;
  	uint64_t ahnd;
+	struct drm_xe_engine_class_instance *hwe;
+	uint32_t vm;
  } igt_spin_factory_t;
 
  typedef struct igt_spin {
@@ -83,6 +85,14 @@ typedef struct igt_spin {  #define SPIN_CLFLUSH (1
 << 0)
 
  	struct igt_spin_factory opts;
+
+	struct xe_spin *xe_spin;
+	size_t bo_size;
+	uint64_t address;
+	unsigned int engine;
+	uint32_t vm;
+	uint32_t syncobj;
+
  } igt_spin_t;
 
 
lib/xe/xe_spin.c index renamed from lib/xe/xe_spin.c +0 -0

856d0ba2..3a8c7bb3 100644

lib/xe/xe_spin.c +19 -0
@@ -15,6 +15,7 @@
  #include "intel_reg.h"
  #include "xe_ioctl.h"
  #include "xe_spin.h"
+#include "lib/igt_dummyload.h"
 
  /**
   * xe_spin_init:
@@ -82,6 +83,94 @@ void xe_spin_end(struct xe_spin *spin)
  	spin->end = 0;
  }
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt) {
+	size_t bo_size = xe_get_default_alignment(fd);
+	uint32_t bo;
+	uint64_t ahnd = opt->ahnd, addr;
+	struct igt_spin *spin;
+	struct xe_spin *xe_spin;
+	struct drm_xe_sync sync = {
+		.flags = DRM_XE_SYNC_SYNCOBJ | DRM_XE_SYNC_SIGNAL,
+	};
+	struct drm_xe_exec exec = {
+		.num_batch_buffer = 1,
+		.num_syncs = 1,
+		.syncs = to_user_pointer(&sync),
+	};
+
+	igt_assert(ahnd);
+	spin = calloc(1, sizeof(struct igt_spin));

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 113

Quoted 10 lines
lib/xe/xe_spin.c +10 -0
+	igt_assert(spin);
+
+	spin->syncobj = syncobj_create(fd, 0);
+	if (opt->engine) {
+		spin->opts.engine = opt->engine;
+		spin->opts.vm = opt->vm;
+
+		spin->handle = xe_bo_create(fd, 0, spin->opts.vm, bo_size);
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle,

bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 114

Quoted 1 line
lib/xe/xe_spin.c +1 -0
+		xe_vm_bind_sync(fd, spin->opts.vm, spin->handle, 0, addr,

bo_size);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin)

Quoted 12 lines
lib/xe/xe_spin.c +12 -0
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->opts.engine;
+		exec.address = addr;
+	} else {
+		spin->vm = xe_vm_create(fd, 0, 0);
+		spin->engine = xe_engine_create(fd, spin->vm, opt->hwe, 0);
+
+		bo = xe_bo_create(fd, 0, spin->vm, bo_size);
+		spin->handle = bo;
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle,

bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 133

Quoted 6 lines
lib/xe/xe_spin.c +6 -0
+		xe_vm_bind_sync(fd, spin->vm, spin->handle, 0, addr, bo_size);
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->engine;
+		exec.address = addr;
+	}

I think you should support two variants of executing spinners:

1. hwe != NULL (in this case engine must be 0):
if (!vm) -> create vm;
create engine for vm according to hwe

2. engine != 0, vm must be vm on top of which engine was created hwe must be NULL in this case
see Dominik answer about passing engine+vm in:
https://patchwork.freedesktop.org/patch/539173/?series=118227&rev=2

Quoted 5 lines

And add support ALL_ENGINES flag (then iterate over all hw engines like Bhanu suggested). And track engine ownership - if caller is the engine/vm owner use it but don't destroy, if spinner code is creating engine you may freely destroy it in spinner free path().

Quoted 4 lines

Do we have Driver support for ALL_ENGINES flag ??

I think what Bhanu asking for is as kms tests doesn’t need hwe, We have to pass hwe from the xe_spin_create it self. In that case we can add a support in xe_spin_create where hwe = 0 and engine = 0 ( Note this is only for kms tests) .

Yes, KMS tests are not supposed to pass hwe or engines.

- Bhanu

Quoted 87 lines

I feel ALL_ENGINES support can be added later, Once kms tests are unblocked.

Regarding igt_spin_free, I've already added support not to destroy vm and engines if they are passed from the igt test. Can you have a look at igt_spin_free (Verified it's working fine for me).
-----
Gowtham

Quoted 81 lines

--
Zbigniew

Quoted 77 lines
lib/xe/xe_spin.c +38 -0
+	sync.handle = spin->syncobj;
+	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_EXEC, &exec), 0);
+	xe_spin_wait_started(xe_spin);
+	igt_info("Spinner started\n");
+
+	spin->bo_size = bo_size;
+	spin->address = addr;
+	spin->xe_spin = xe_spin;
+
+	return spin;
+}
+
+void xe_spin_sync_wait(int fd, struct igt_spin *spin) {
+	igt_assert(syncobj_wait(fd, &spin->syncobj, 1, INT64_MAX, 0,
+				NULL));
+}
+
+void xe_spin_free(int fd, struct igt_spin *spin) {
+	xe_spin_end(spin->xe_spin);
+	xe_spin_sync_wait(fd, spin);
+
+	if (!spin->opts.engine) {
+		xe_vm_unbind_sync(fd, spin->vm, 0, spin->address, spin-
 bo_size);
+	} else {
+		xe_vm_unbind_sync(fd, spin->opts.vm, 0, spin->address, spin-
 bo_size);
+	}
+
+	syncobj_destroy(fd, spin->syncobj);
+	gem_munmap(spin->xe_spin, spin->bo_size);
+	gem_close(fd, spin->handle);
+
+	if (!spin->opts.engine) {
+		xe_engine_destroy(fd, spin->engine);
+		xe_vm_destroy(fd, spin->vm);
+	}
+	free(spin);
+}
+
  void xe_cork_init(int fd, struct drm_xe_engine_class_instance *hwe,
  		  struct xe_cork *cork)
  {
lib/xe/xe_spin.h index renamed from lib/xe/xe_spin.h +0 -0

73f9a026..48867eb8 100644

lib/xe/xe_spin.h +7 -1
@@ -13,19 +13,26 @@
  #include <stdbool.h>
 
  #include "xe_query.h"
+#include "lib/igt_dummyload.h"
 
  /* Mapped GPU object */
+
  struct xe_spin {
  	uint32_t batch[16];
  	uint64_t pad;
  	uint32_t start;
  	uint32_t end;
+
  };
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt);
  void xe_spin_init(struct xe_spin *spin, uint64_t addr, bool preempt);
 bool xe_spin_started(struct xe_spin *spin);
+void xe_spin_sync_wait(int fd, struct igt_spin *spin);
  void xe_spin_wait_started(struct xe_spin *spin);  void
 xe_spin_end(struct xe_spin *spin);
+void xe_spin_free(int fd, struct igt_spin *spin);
 
  struct xe_cork {
  	struct xe_spin *spin;
--

2.39.1

#5 lore raw

Re: [igt-dev] [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

Quoted 211 lines

-----Original Message-----
From: Modem, Bhanuprakash <[email protected]>
Sent: Tuesday, May 30, 2023 10:14 AM
To: Ch, Sai Gowtham <[email protected]>; Kempczynski, Zbigniew <[email protected]>; Gandi, Ramadevi <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

Hi Sai,

Quoted 10 lines · Sai Gowtham
Quoted 10 lines

-----Original Message-----
From: Kempczynski, Zbigniew <[email protected]>
Sent: Monday, May 29, 2023 11:21 AM
To: Ch, Sai Gowtham <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH i-g-t 1/2] lib/xe/xe_spin: Integrate igt_spin_new with Xe.

On Thu, May 25, 2023 at 11:25:18AM +0530, [email protected]

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines

From: Sai Gowtham Ch <[email protected]>

Extending the spin_create implementation and allocator handle support in xe, where it submits dummy work loads to engine. This Implementation is wrapped around vm_bind and unbind as we are supposed to

Quoted 7 lines
Quoted 7 lines

do it manually for xe.

Quoted 6 lines
Cc Zbigniew Kempczyński <[email protected]>
---
  lib/igt_dummyload.c | 24 +++++++++---  lib/igt_dummyload.h | 10 +++++
  lib/xe/xe_spin.c    | 89

+++++++++++++++++++++++++++++++++++++++++++++

Quoted 172 lines
Quoted 172 lines
Quoted 28 lines
  lib/xe/xe_spin.h    |  7 ++++
  4 files changed, 124 insertions(+), 6 deletions(-)
lib/igt_dummyload.c index renamed from lib/igt_dummyload.c +0 -0

740a58f3..6e89b72d 100644

lib/igt_dummyload.c +1 -0
@@ -46,6 +46,7 @@
  #include "intel_reg.h"
  #include "ioctl_wrappers.h"
  #include "sw_sync.h"
+#include "xe/xe_spin.h"
 
  /**
   * SECTION:igt_dummyload
@@ -447,7 +448,10 @@ spin_create(int fd, const struct

igt_spin_factory
*opts) igt_spin_t * __igt_spin_factory(int fd, const struct igt_spin_factory *opts) {

lib/igt_dummyload.c +4 -1
-	return spin_create(fd, opts);
+	if (is_xe_device(fd))
+		return xe_spin_create(fd, opts);
+	else
+		return spin_create(fd, opts);
  }
 
  /**

lib/igt_dummyload.c igt_spin_factory(int fd, const struct · line 479

Quoted 9 lines
lib/igt_dummyload.c +5 -0
@@ -467,6 +471,11 @@ igt_spin_factory(int fd, const struct
 igt_spin_factory *opts)  {
  	igt_spin_t *spin;
 
+	if (is_xe_device(fd)) {
+		spin = xe_spin_create(fd, opts);
+		return spin;
+	}
+
  	if ((opts->flags & IGT_SPIN_POLL_RUN) && opts->engine !=

ALL_ENGINES) {

Quoted 84 lines
lib/igt_dummyload.c +8 -5
  		unsigned int class;
 
@@ -647,11 +656,14 @@ void igt_spin_free(int fd, igt_spin_t *spin)
  	if (!spin)
  		return;
 
-	pthread_mutex_lock(&list_lock);
-	igt_list_del(&spin->link);
-	pthread_mutex_unlock(&list_lock);
-
-	__igt_spin_free(fd, spin);
+	if (is_xe_device(fd)) {
+		xe_spin_free(fd, spin);
+	} else {
+		pthread_mutex_lock(&list_lock);
+		igt_list_del(&spin->link);
+		pthread_mutex_unlock(&list_lock);
+		__igt_spin_free(fd, spin);
+	}
  }
 
  void igt_terminate_spins(void)
lib/igt_dummyload.h index renamed from lib/igt_dummyload.h +0 -0

b247ab02..7bcc7b56 100644

lib/igt_dummyload.h +10 -0
@@ -54,6 +54,8 @@ typedef struct igt_spin_factory {
  	unsigned int flags;
  	int fence;
  	uint64_t ahnd;
+	struct drm_xe_engine_class_instance *hwe;
+	uint32_t vm;
  } igt_spin_factory_t;
 
  typedef struct igt_spin {
@@ -83,6 +85,14 @@ typedef struct igt_spin {  #define SPIN_CLFLUSH
 (1 << 0)
 
  	struct igt_spin_factory opts;
+
+	struct xe_spin *xe_spin;
+	size_t bo_size;
+	uint64_t address;
+	unsigned int engine;
+	uint32_t vm;
+	uint32_t syncobj;
+
  } igt_spin_t;
 
 
lib/xe/xe_spin.c index renamed from lib/xe/xe_spin.c +0 -0

856d0ba2..3a8c7bb3 100644

lib/xe/xe_spin.c +19 -0
@@ -15,6 +15,7 @@
  #include "intel_reg.h"
  #include "xe_ioctl.h"
  #include "xe_spin.h"
+#include "lib/igt_dummyload.h"
 
  /**
   * xe_spin_init:
@@ -82,6 +83,94 @@ void xe_spin_end(struct xe_spin *spin)
  	spin->end = 0;
  }
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt) {
+	size_t bo_size = xe_get_default_alignment(fd);
+	uint32_t bo;
+	uint64_t ahnd = opt->ahnd, addr;
+	struct igt_spin *spin;
+	struct xe_spin *xe_spin;
+	struct drm_xe_sync sync = {
+		.flags = DRM_XE_SYNC_SYNCOBJ | DRM_XE_SYNC_SIGNAL,
+	};
+	struct drm_xe_exec exec = {
+		.num_batch_buffer = 1,
+		.num_syncs = 1,
+		.syncs = to_user_pointer(&sync),
+	};
+
+	igt_assert(ahnd);
+	spin = calloc(1, sizeof(struct igt_spin));

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 113

Quoted 10 lines
lib/xe/xe_spin.c +10 -0
+	igt_assert(spin);
+
+	spin->syncobj = syncobj_create(fd, 0);
+	if (opt->engine) {
+		spin->opts.engine = opt->engine;
+		spin->opts.vm = opt->vm;
+
+		spin->handle = xe_bo_create(fd, 0, spin->opts.vm, bo_size);
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle,

bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 114

Quoted 1 line
lib/xe/xe_spin.c +1 -0
+		xe_vm_bind_sync(fd, spin->opts.vm, spin->handle, 0, addr,

bo_size);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin)

Quoted 12 lines
lib/xe/xe_spin.c +12 -0
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->opts.engine;
+		exec.address = addr;
+	} else {
+		spin->vm = xe_vm_create(fd, 0, 0);
+		spin->engine = xe_engine_create(fd, spin->vm, opt->hwe, 0);
+
+		bo = xe_bo_create(fd, 0, spin->vm, bo_size);
+		spin->handle = bo;
+		xe_spin = xe_bo_map(fd, spin->handle, bo_size);
+		addr = intel_allocator_alloc_with_strategy(ahnd, spin->handle,

bo_size, 0, ALLOC_STRATEGY_LOW_TO_HIGH);

lib/xe/xe_spin.c void xe_spin_end(struct xe_spin *spin) · line 133

Quoted 6 lines
lib/xe/xe_spin.c +6 -0
+		xe_vm_bind_sync(fd, spin->vm, spin->handle, 0, addr, bo_size);
+
+		xe_spin_init(xe_spin, addr, true);
+		exec.engine_id = spin->engine;
+		exec.address = addr;
+	}

I think you should support two variants of executing spinners:

1. hwe != NULL (in this case engine must be 0):
if (!vm) -> create vm;
create engine for vm according to hwe

2. engine != 0, vm must be vm on top of which engine was created hwe must be NULL in this case
see Dominik answer about passing engine+vm in:

https://patchwork.freedesktop.org/patch/539173/?series=118227&rev=2

And add support ALL_ENGINES flag (then iterate over all hw engines like Bhanu suggested). And track engine ownership - if caller is the engine/vm owner use it but don't destroy, if spinner code is creating engine you may freely destroy it in spinner free path().

Quoted 6 lines
Quoted 3 lines

Do we have Driver support for ALL_ENGINES flag ??

I think what Bhanu asking for is as kms tests doesn’t need hwe, We have to

pass hwe from the xe_spin_create it self.

Quoted 1 line

In that case we can add a support in xe_spin_create where hwe = 0 and engine

= 0 ( Note this is only for kms tests) .

I just realised xe_spin_create with engine_id = 0 will not work, However is there a way to create engine without hwe ?
- Gowtham

Quoted 94 lines

Yes, KMS tests are not supposed to pass hwe or engines.

- Bhanu

Quoted 4 lines

I feel ALL_ENGINES support can be added later, Once kms tests are unblocked.

Regarding igt_spin_free, I've already added support not to destroy vm and

engines if they are passed from the igt test. Can you have a look at igt_spin_free (Verified it's working fine for me).

Quoted 83 lines

-----
Gowtham

Quoted 81 lines

--
Zbigniew

Quoted 77 lines
lib/xe/xe_spin.c +38 -0
+	sync.handle = spin->syncobj;
+	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_EXEC, &exec), 0);
+	xe_spin_wait_started(xe_spin);
+	igt_info("Spinner started\n");
+
+	spin->bo_size = bo_size;
+	spin->address = addr;
+	spin->xe_spin = xe_spin;
+
+	return spin;
+}
+
+void xe_spin_sync_wait(int fd, struct igt_spin *spin) {
+	igt_assert(syncobj_wait(fd, &spin->syncobj, 1, INT64_MAX, 0,
+				NULL));
+}
+
+void xe_spin_free(int fd, struct igt_spin *spin) {
+	xe_spin_end(spin->xe_spin);
+	xe_spin_sync_wait(fd, spin);
+
+	if (!spin->opts.engine) {
+		xe_vm_unbind_sync(fd, spin->vm, 0, spin->address, spin-
 bo_size);
+	} else {
+		xe_vm_unbind_sync(fd, spin->opts.vm, 0, spin->address, spin-
 bo_size);
+	}
+
+	syncobj_destroy(fd, spin->syncobj);
+	gem_munmap(spin->xe_spin, spin->bo_size);
+	gem_close(fd, spin->handle);
+
+	if (!spin->opts.engine) {
+		xe_engine_destroy(fd, spin->engine);
+		xe_vm_destroy(fd, spin->vm);
+	}
+	free(spin);
+}
+
  void xe_cork_init(int fd, struct drm_xe_engine_class_instance *hwe,
  		  struct xe_cork *cork)
  {
lib/xe/xe_spin.h index renamed from lib/xe/xe_spin.h +0 -0

73f9a026..48867eb8 100644

lib/xe/xe_spin.h +7 -1
@@ -13,19 +13,26 @@
  #include <stdbool.h>
 
  #include "xe_query.h"
+#include "lib/igt_dummyload.h"
 
  /* Mapped GPU object */
+
  struct xe_spin {
  	uint32_t batch[16];
  	uint64_t pad;
  	uint32_t start;
  	uint32_t end;
+
  };
 
+igt_spin_t *
+xe_spin_create(int fd, const struct igt_spin_factory *opt);
  void xe_spin_init(struct xe_spin *spin, uint64_t addr, bool
 preempt); bool xe_spin_started(struct xe_spin *spin);
+void xe_spin_sync_wait(int fd, struct igt_spin *spin);
  void xe_spin_wait_started(struct xe_spin *spin);  void
 xe_spin_end(struct xe_spin *spin);
+void xe_spin_free(int fd, struct igt_spin *spin);
 
  struct xe_cork {
  	struct xe_spin *spin;
--

2.39.1

#6 lore raw

PATCH 2/2 tests/xe/xe_spin_batch: Add new test to exercise igt_spin_new for xe.

In reply to [email protected]

From: Sai Gowtham Ch <[email protected]>

xe_spin_batch test exercises basic igt_spin_new submissions and and with all engines.

Cc Zbigniew Kempczyński <[email protected]>
---
 tests/meson.build        |   1 +
 tests/xe/xe_spin_batch.c | 138 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 139 insertions(+)
 create mode 100644 tests/xe/xe_spin_batch.c
tests/meson.build +1 -0
index f71be1db..e794b75a 100644
@@ -268,6 +268,7 @@ xe_progs = [
 	'xe_query',
 	'xe_vm',
 	'xe_waitfence',
+	'xe_spin_batch',
 ]
 
 msm_progs = [
tests/xe/xe_spin_batch.c new file +138 -0

138 lines not on this page · raw message

Signature · 1 line
2.39.1
#7 lore raw

Re: [igt-dev] [PATCH i-g-t 2/2] tests/xe/xe_spin_batch: Add new test to exercise igt_spin_new for xe.

Quoted 53 lines · On Thu, May 25, 2023 at 11:25:19AM +0530, [email protected] wrote:

From: Sai Gowtham Ch <[email protected]>

xe_spin_batch test exercises basic igt_spin_new submissions and and with all engines.

Cc Zbigniew Kempczyński <[email protected]>
---
 tests/meson.build        |   1 +
 tests/xe/xe_spin_batch.c | 138 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 139 insertions(+)
 create mode 100644 tests/xe/xe_spin_batch.c
tests/meson.build +1 -0
index f71be1db..e794b75a 100644
@@ -268,6 +268,7 @@ xe_progs = [
 	'xe_query',
 	'xe_vm',
 	'xe_waitfence',
+	'xe_spin_batch',
 ]
 
 msm_progs = [
tests/xe/xe_spin_batch.c new file +22 -0
new file mode 100644
index 00000000..1b216199
@@ -0,0 +1,138 @@
+#include "igt.h"
+#include "lib/intel_reg.h"
+#include "xe_drm.h"
+#include "xe/xe_ioctl.h"
+#include "xe/xe_query.h"
+
+#define MAX_INSTANCE 9
+/**
+ * TEST:Test for spin batch submissons.
+ *
+ * SUBTEST: spin-batch
+ * Description: Test to submit spin batch with engines and vm.
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+
+static void spin(int fd, struct drm_xe_engine_class_instance *hwe)
+{
+	uint64_t ahnd;
+	unsigned int engine;
+	uint32_t vm;

tests/xe/xe_spin_batch.c line 32

Quoted 10 lines
tests/xe/xe_spin_batch.c new file +10 -0
+	igt_spin_t *spin;
+
+	vm = xe_vm_create(fd, 0, 0);
+	engine = xe_engine_create(fd, vm, hwe, 0);
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+
+	spin = __igt_spin_new(fd, .ahnd = ahnd, .engine = engine, .vm = vm);
+	igt_assert(spin);
+
+	igt_spin_free(fd, spin);

You shouldn't imo destroy engine/vm inside igt_spin_free(). Caller is the owner and they should stay intact.

If instead .engine you'll pass .hwe you may create engine on top of vm (if passed, if not create new one) and destroy in igt_spin_free().

Resume: track the ownershipping.

Quoted 80 lines
tests/xe/xe_spin_batch.c new file +80 -0
+	put_ahnd(ahnd);
+}
+
+/**
+ * TEST: Basic test for spin batch submission.
+ *
+ * SUBTEST: spin-basic
+ * Description: Basic test which validates the functionality of spinner.
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+static void spin_basic(int fd, struct drm_xe_engine_class_instance *hwe)
+{
+	uint64_t ahnd;
+	igt_spin_t *spin;
+
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+	spin = __igt_spin_new(fd, .ahnd = ahnd, .hwe = hwe);
+	igt_assert(spin);
+
+	igt_spin_free(fd, spin);
+	put_ahnd(ahnd);
+}
+
+/**
+ * TEST: Test for spin batch submissions.
+ * SUBTEST: spin-all
+ * Description: Spinner test to run on all the engines!
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+
+static void spin_all (int fd, int gt, int class)
+{
+	uint64_t ahnd;
+	uint32_t engines[MAX_INSTANCE];
+	uint32_t vm[MAX_INSTANCE];
+	int i, num_placements = 0;
+	struct drm_xe_engine_class_instance eci[MAX_INSTANCE];
+	igt_spin_t *spin[MAX_INSTANCE];
+	struct drm_xe_engine_class_instance *hwe;
+
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+
+	xe_for_each_hw_engine(fd, hwe) {
+		if (hwe->engine_class != class || hwe->gt_id != gt)
+			continue;
+		eci[num_placements++] = *hwe;
+	}
+	if (num_placements < 2)
+		return;
+
+	for (i = 0; i < num_placements; i++) {
+		struct drm_xe_engine_create create;
+		vm[i] = xe_vm_create(fd, 0, 0);
+
+		create.vm_id = vm[i];
+		create.width = 1;
+		create.num_placements = num_placements;
+		create.instances = to_user_pointer(eci);
+
+		igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_ENGINE_CREATE,
+					&create), 0);
+		engines[i] = create.engine_id;
+		spin[i] = __igt_spin_new(fd, .ahnd = ahnd, .engine = engines[i], .vm = vm[i]);
+	}
+
+	for (i = 0; i < num_placements; i++) {
+		igt_assert(spin[i]);
+		igt_spin_free(fd, spin[i]);
+	}
+	put_ahnd(ahnd);
+}
+
+igt_main
+{
+	struct drm_xe_engine_class_instance *hwe;
+	int fd;

tests/xe/xe_spin_batch.c line 122

Quoted 10 lines
tests/xe/xe_spin_batch.c new file +10 -0
+	int gt, class;
+
+	igt_fixture {
+		fd = drm_open_driver(DRIVER_XE);
+		xe_device_get(fd);
+	}
+
+	igt_subtest("spin-batch")
+		xe_for_each_hw_engine(fd, hwe)
+			spin(fd, hwe);

Test both variants: with engine/vm created in the test and passed via .engine + .vm field and with passing .hwe only. Add also support for ALL_ENGINES flag.

--
Zbigniew

Quoted 19 lines
tests/xe/xe_spin_batch.c new file +16 -0
+
+	igt_subtest("spin-basic")
+		xe_for_each_hw_engine(fd, hwe)
+			spin_basic(fd, hwe);
+
+	igt_subtest("spin-all") {
+		xe_for_each_gt(fd, gt)
+			xe_for_each_hw_engine_class(class)
+				spin_all(fd, gt, class);
+	}
+
+	igt_fixture {
+		xe_device_put(fd);
+		close(fd);
+	}
+}
Signature · 1 line
2.39.1
#8 lore raw

Re: [igt-dev] [PATCH i-g-t 2/2] tests/xe/xe_spin_batch: Add new test to exercise igt_spin_new for xe.

Quoted 77 lines

-----Original Message-----
From: Kempczynski, Zbigniew <[email protected]>
Sent: Monday, May 29, 2023 11:27 AM
To: Ch, Sai Gowtham <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH i-g-t 2/2] tests/xe/xe_spin_batch: Add new test to exercise igt_spin_new for xe.

Quoted 52 lines · On Thu, May 25, 2023 at 11:25:19AM +0530, [email protected] wrote:

From: Sai Gowtham Ch <[email protected]>

xe_spin_batch test exercises basic igt_spin_new submissions and and with all engines.

Cc Zbigniew Kempczyński <[email protected]>
---
 tests/meson.build        |   1 +
 tests/xe/xe_spin_batch.c | 138
+++++++++++++++++++++++++++++++++++++++
 2 files changed, 139 insertions(+)
 create mode 100644 tests/xe/xe_spin_batch.c
tests/meson.build index renamed from tests/meson.build +0 -0

f71be1db..e794b75a 100644

tests/meson.build +1 -0
@@ -268,6 +268,7 @@ xe_progs = [
 	'xe_query',
 	'xe_vm',
 	'xe_waitfence',
+	'xe_spin_batch',
 ]
 
 msm_progs = [
tests/xe/xe_spin_batch.c new renamed from tests/xe/xe_spin_batch.c +0 -0

file mode 100644 index 00000000..1b216199

tests/xe/xe_spin_batch.c new file +21 -0
@@ -0,0 +1,138 @@
+#include "igt.h"
+#include "lib/intel_reg.h"
+#include "xe_drm.h"
+#include "xe/xe_ioctl.h"
+#include "xe/xe_query.h"
+
+#define MAX_INSTANCE 9
+/**
+ * TEST:Test for spin batch submissons.
+ *
+ * SUBTEST: spin-batch
+ * Description: Test to submit spin batch with engines and vm.
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+
+static void spin(int fd, struct drm_xe_engine_class_instance *hwe) {
+	uint64_t ahnd;
+	unsigned int engine;
+	uint32_t vm;

tests/xe/xe_spin_batch.c line 31

Quoted 10 lines
tests/xe/xe_spin_batch.c new file +10 -0
+	igt_spin_t *spin;
+
+	vm = xe_vm_create(fd, 0, 0);
+	engine = xe_engine_create(fd, vm, hwe, 0);
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+
+	spin = __igt_spin_new(fd, .ahnd = ahnd, .engine = engine, .vm = vm);
+	igt_assert(spin);
+
+	igt_spin_free(fd, spin);

You shouldn't imo destroy engine/vm inside igt_spin_free(). Caller is the owner and they should stay intact.

Quoted 4 lines

If instead .engine you'll pass .hwe you may create engine on top of vm (if passed, if not create new one) and destroy in igt_spin_free().

Resume: track the ownershipping.

I'm handling this in igt_spin_free itself, if you look at the igt_spin_free code that I've sent for review I'm checking if it's passed from the igt test or Is it created inside the xe_spin_create, I'm not destroying engine and vm when it's passed from igt test.

Quoted 86 lines
Quoted 57 lines
tests/xe/xe_spin_batch.c new file +56 -0
+	put_ahnd(ahnd);
+}
+
+/**
+ * TEST: Basic test for spin batch submission.
+ *
+ * SUBTEST: spin-basic
+ * Description: Basic test which validates the functionality of spinner.
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+static void spin_basic(int fd, struct drm_xe_engine_class_instance
+*hwe) {
+	uint64_t ahnd;
+	igt_spin_t *spin;
+
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+	spin = __igt_spin_new(fd, .ahnd = ahnd, .hwe = hwe);
+	igt_assert(spin);
+
+	igt_spin_free(fd, spin);
+	put_ahnd(ahnd);
+}
+
+/**
+ * TEST: Test for spin batch submissions.
+ * SUBTEST: spin-all
+ * Description: Spinner test to run on all the engines!
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+
+static void spin_all (int fd, int gt, int class) {
+	uint64_t ahnd;
+	uint32_t engines[MAX_INSTANCE];
+	uint32_t vm[MAX_INSTANCE];
+	int i, num_placements = 0;
+	struct drm_xe_engine_class_instance eci[MAX_INSTANCE];
+	igt_spin_t *spin[MAX_INSTANCE];
+	struct drm_xe_engine_class_instance *hwe;
+
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+
+	xe_for_each_hw_engine(fd, hwe) {
+		if (hwe->engine_class != class || hwe->gt_id != gt)
+			continue;
+		eci[num_placements++] = *hwe;
+	}
+	if (num_placements < 2)
+		return;
+
+	for (i = 0; i < num_placements; i++) {
+		struct drm_xe_engine_create create;
+		vm[i] = xe_vm_create(fd, 0, 0);

tests/xe/xe_spin_batch.c

Quoted 10 lines
tests/xe/xe_spin_batch.c new file +10 -0
+
+		create.vm_id = vm[i];
+		create.width = 1;
+		create.num_placements = num_placements;
+		create.instances = to_user_pointer(eci);
+
+		igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_ENGINE_CREATE,
+					&create), 0);
+		engines[i] = create.engine_id;
+		spin[i] = __igt_spin_new(fd, .ahnd = ahnd, .engine = engines[i],

.vm = vm[i]);

Quoted 18 lines
tests/xe/xe_spin_batch.c new file +18 -0
+	}
+
+	for (i = 0; i < num_placements; i++) {
+		igt_assert(spin[i]);
+		igt_spin_free(fd, spin[i]);
+	}
+	put_ahnd(ahnd);
+}
+
+igt_main
+{
+	struct drm_xe_engine_class_instance *hwe;
+	int fd;
+	int gt, class;
+
+	igt_fixture {
+		fd = drm_open_driver(DRIVER_XE);
+		xe_device_get(fd);
Quoted 9 lines

tests/xe/xe_spin_batch.c line 122

Quoted 5 lines
tests/xe/xe_spin_batch.c new file +5 -0
+	}
+
+	igt_subtest("spin-batch")
+		xe_for_each_hw_engine(fd, hwe)
+			spin(fd, hwe);

Test both variants: with engine/vm created in the test and passed via .engine + .vm field and with passing .hwe only. Add also support for ALL_ENGINES flag.

I think spin-batch already covers that, it passes both engine and vm to igt_spin_new which are created in the test. And spin-basic passes only .hwe to igt_spin_new.

Thanks,
Gowtham

Quoted 22 lines

--
Zbigniew

Quoted 19 lines
tests/xe/xe_spin_batch.c new file +16 -1
+
+	igt_subtest("spin-basic")
+		xe_for_each_hw_engine(fd, hwe)
+			spin_basic(fd, hwe);
+
+	igt_subtest("spin-all") {
+		xe_for_each_gt(fd, gt)
+			xe_for_each_hw_engine_class(class)
+				spin_all(fd, gt, class);
+	}
+
+	igt_fixture {
+		xe_device_put(fd);
+		close(fd);
+	}
+}
--

2.39.1

#9 lore raw

Re: [igt-dev] [PATCH i-g-t 2/2] tests/xe/xe_spin_batch: Add new test to exercise igt_spin_new for xe.

Quoted 77 lines · Sai Gowtham
Quoted 77 lines

-----Original Message-----
From: Kempczynski, Zbigniew <[email protected]>
Sent: Monday, May 29, 2023 11:27 AM
To: Ch, Sai Gowtham <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH i-g-t 2/2] tests/xe/xe_spin_batch: Add new test to exercise igt_spin_new for xe.

Quoted 52 lines · On Thu, May 25, 2023 at 11:25:19AM +0530, [email protected] wrote:

From: Sai Gowtham Ch <[email protected]>

xe_spin_batch test exercises basic igt_spin_new submissions and and with all engines.

Cc Zbigniew Kempczyński <[email protected]>
---
 tests/meson.build        |   1 +
 tests/xe/xe_spin_batch.c | 138
+++++++++++++++++++++++++++++++++++++++
 2 files changed, 139 insertions(+)
 create mode 100644 tests/xe/xe_spin_batch.c
tests/meson.build index renamed from tests/meson.build +0 -0

f71be1db..e794b75a 100644

tests/meson.build +1 -0
@@ -268,6 +268,7 @@ xe_progs = [
 	'xe_query',
 	'xe_vm',
 	'xe_waitfence',
+	'xe_spin_batch',
 ]
 
 msm_progs = [
tests/xe/xe_spin_batch.c new renamed from tests/xe/xe_spin_batch.c +0 -0

file mode 100644 index 00000000..1b216199

tests/xe/xe_spin_batch.c new file +21 -0
@@ -0,0 +1,138 @@
+#include "igt.h"
+#include "lib/intel_reg.h"
+#include "xe_drm.h"
+#include "xe/xe_ioctl.h"
+#include "xe/xe_query.h"
+
+#define MAX_INSTANCE 9
+/**
+ * TEST:Test for spin batch submissons.
+ *
+ * SUBTEST: spin-batch
+ * Description: Test to submit spin batch with engines and vm.
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+
+static void spin(int fd, struct drm_xe_engine_class_instance *hwe) {
+	uint64_t ahnd;
+	unsigned int engine;
+	uint32_t vm;

tests/xe/xe_spin_batch.c line 31

Quoted 10 lines
tests/xe/xe_spin_batch.c new file +10 -0
+	igt_spin_t *spin;
+
+	vm = xe_vm_create(fd, 0, 0);
+	engine = xe_engine_create(fd, vm, hwe, 0);
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+
+	spin = __igt_spin_new(fd, .ahnd = ahnd, .engine = engine, .vm = vm);
+	igt_assert(spin);
+
+	igt_spin_free(fd, spin);

You shouldn't imo destroy engine/vm inside igt_spin_free(). Caller is the owner and they should stay intact.

Quoted 6 lines
Quoted 4 lines

If instead .engine you'll pass .hwe you may create engine on top of vm (if passed, if not create new one) and destroy in igt_spin_free().

Resume: track the ownershipping.

I'm handling this in igt_spin_free itself, if you look at the igt_spin_free code that I've sent for review I'm checking if it's passed from the igt test or Is it created inside the xe_spin_create, I'm not destroying engine and vm when it's passed from igt test.

So in this case you should destroy it in the test, otherwise it will dangle when test is done.

--
Zbigniew

Quoted 122 lines
Quoted 86 lines
Quoted 57 lines
tests/xe/xe_spin_batch.c new file +56 -0
+	put_ahnd(ahnd);
+}
+
+/**
+ * TEST: Basic test for spin batch submission.
+ *
+ * SUBTEST: spin-basic
+ * Description: Basic test which validates the functionality of spinner.
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+static void spin_basic(int fd, struct drm_xe_engine_class_instance
+*hwe) {
+	uint64_t ahnd;
+	igt_spin_t *spin;
+
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+	spin = __igt_spin_new(fd, .ahnd = ahnd, .hwe = hwe);
+	igt_assert(spin);
+
+	igt_spin_free(fd, spin);
+	put_ahnd(ahnd);
+}
+
+/**
+ * TEST: Test for spin batch submissions.
+ * SUBTEST: spin-all
+ * Description: Spinner test to run on all the engines!
+ * Run type: FULL
+ * TODO: change ``'Run type' == FULL`` to a better category
+ *
+ */
+
+static void spin_all (int fd, int gt, int class) {
+	uint64_t ahnd;
+	uint32_t engines[MAX_INSTANCE];
+	uint32_t vm[MAX_INSTANCE];
+	int i, num_placements = 0;
+	struct drm_xe_engine_class_instance eci[MAX_INSTANCE];
+	igt_spin_t *spin[MAX_INSTANCE];
+	struct drm_xe_engine_class_instance *hwe;
+
+	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
+
+	xe_for_each_hw_engine(fd, hwe) {
+		if (hwe->engine_class != class || hwe->gt_id != gt)
+			continue;
+		eci[num_placements++] = *hwe;
+	}
+	if (num_placements < 2)
+		return;
+
+	for (i = 0; i < num_placements; i++) {
+		struct drm_xe_engine_create create;
+		vm[i] = xe_vm_create(fd, 0, 0);

tests/xe/xe_spin_batch.c

Quoted 10 lines
tests/xe/xe_spin_batch.c new file +10 -0
+
+		create.vm_id = vm[i];
+		create.width = 1;
+		create.num_placements = num_placements;
+		create.instances = to_user_pointer(eci);
+
+		igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_ENGINE_CREATE,
+					&create), 0);
+		engines[i] = create.engine_id;
+		spin[i] = __igt_spin_new(fd, .ahnd = ahnd, .engine = engines[i],

.vm = vm[i]);

Quoted 18 lines
tests/xe/xe_spin_batch.c new file +18 -0
+	}
+
+	for (i = 0; i < num_placements; i++) {
+		igt_assert(spin[i]);
+		igt_spin_free(fd, spin[i]);
+	}
+	put_ahnd(ahnd);
+}
+
+igt_main
+{
+	struct drm_xe_engine_class_instance *hwe;
+	int fd;
+	int gt, class;
+
+	igt_fixture {
+		fd = drm_open_driver(DRIVER_XE);
+		xe_device_get(fd);
Quoted 9 lines

tests/xe/xe_spin_batch.c line 122

Quoted 5 lines
tests/xe/xe_spin_batch.c new file +5 -0
+	}
+
+	igt_subtest("spin-batch")
+		xe_for_each_hw_engine(fd, hwe)
+			spin(fd, hwe);

Test both variants: with engine/vm created in the test and passed via .engine + .vm field and with passing .hwe only. Add also support for ALL_ENGINES flag.

I think spin-batch already covers that, it passes both engine and vm to igt_spin_new which are created in the test. And spin-basic passes only .hwe to igt_spin_new.

Thanks,
Gowtham

Quoted 22 lines

--
Zbigniew

Quoted 19 lines
tests/xe/xe_spin_batch.c new file +16 -1
+
+	igt_subtest("spin-basic")
+		xe_for_each_hw_engine(fd, hwe)
+			spin_basic(fd, hwe);
+
+	igt_subtest("spin-all") {
+		xe_for_each_gt(fd, gt)
+			xe_for_each_hw_engine_class(class)
+				spin_all(fd, gt, class);
+	}
+
+	igt_fixture {
+		xe_device_put(fd);
+		close(fd);
+	}
+}
--

2.39.1

#10 lore raw

[igt-dev] ✗ GitLab.Pipeline: warning for Integrate igt_spin_new with Xe. (rev2)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: Integrate igt_spin_new with Xe. (rev2)
URL : https://patchwork.freedesktop.org/series/118121/
State : warning

== Summary ==

Pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/890115 for the overview.

build-containers:build-debian has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/42415062):
time="2023-05-25T06:02:24Z" level=fatal msg="Invalid status code returned when fetching blob 500 (Internal Server Error)"
Building!
STEP 1: FROM debian:buster
Getting image source signatures
Copying blob sha256:c722db24a050621ee87ea07acd5d066d3d6a94737c32012f27d73a1ad5cc645c
Copying config sha256:8b5601a5a7f855241ac7f372ec0042e793b0b3eb3f3a601014845f22bd371c90
Writing manifest to image destination
Storing signatures
STEP 2: RUN apt-get update
error running container: error creating container for [/bin/sh -c apt-get update]: time="2023-05-25T06:02:29Z" level=warning msg="signal: killed"
time="2023-05-25T06:02:29Z" level=error msg="container_linux.go:346: starting container process caused \"process_linux.go:297: applying cgroup configuration for process caused \\\"mountpoint for cgroup not found\\\"\"\n" container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\""
: exit status 1
Error: error building at STEP "RUN apt-get update": error while running runtime: exit status 1
section_end:1684994551:step_script
section_start:1684994551:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1684994552:cleanup_file_variables
ERROR: Job failed: exit code 1

build-containers:build-debian-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/42415064):
time="2023-05-25T06:02:23Z" level=fatal msg="Invalid status code returned when fetching blob 500 (Internal Server Error)"
Building!
STEP 1: FROM debian:buster
Getting image source signatures
Copying blob sha256:c722db24a050621ee87ea07acd5d066d3d6a94737c32012f27d73a1ad5cc645c
Copying config sha256:8b5601a5a7f855241ac7f372ec0042e793b0b3eb3f3a601014845f22bd371c90
Writing manifest to image destination
Storing signatures
STEP 2: RUN apt-get update
error running container: error creating container for [/bin/sh -c apt-get update]: time="2023-05-25T06:02:26Z" level=warning msg="signal: killed"
time="2023-05-25T06:02:26Z" level=error msg="container_linux.go:346: starting container process caused \"process_linux.go:297: applying cgroup configuration for process caused \\\"mountpoint for cgroup not found\\\"\"\n" container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\""
: exit status 1
Error: error building at STEP "RUN apt-get update": error while running runtime: exit status 1
section_end:1684994546:step_script
section_start:1684994546:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1684994548:cleanup_file_variables
ERROR: Job failed: exit code 1

build-containers:build-debian-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/42415063):
time="2023-05-25T06:02:28Z" level=fatal msg="Invalid status code returned when fetching blob 500 (Internal Server Error)"
Building!
STEP 1: FROM debian:buster
Getting image source signatures
Copying blob sha256:c722db24a050621ee87ea07acd5d066d3d6a94737c32012f27d73a1ad5cc645c
Copying config sha256:8b5601a5a7f855241ac7f372ec0042e793b0b3eb3f3a601014845f22bd371c90
Writing manifest to image destination
Storing signatures
STEP 2: RUN apt-get update
error running container: error creating container for [/bin/sh -c apt-get update]: time="2023-05-25T06:02:32Z" level=warning msg="signal: killed"
time="2023-05-25T06:02:32Z" level=error msg="container_linux.go:346: starting container process caused \"process_linux.go:297: applying cgroup configuration for process caused \\\"mountpoint for cgroup not found\\\"\"\n" container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\""
: exit status 1
Error: error building at STEP "RUN apt-get update": error while running runtime: exit status 1
section_end:1684994554:step_script
section_start:1684994554:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1684994559:cleanup_file_variables
ERROR: Job failed: exit code 1

build-containers:build-debian-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/42415065):
time="2023-05-25T06:02:24Z" level=fatal msg="Invalid status code returned when fetching blob 500 (Internal Server Error)"
Building!
STEP 1: FROM debian:buster
Getting image source signatures
Copying blob sha256:c722db24a050621ee87ea07acd5d066d3d6a94737c32012f27d73a1ad5cc645c
Copying config sha256:8b5601a5a7f855241ac7f372ec0042e793b0b3eb3f3a601014845f22bd371c90
Writing manifest to image destination
Storing signatures
STEP 2: RUN apt-get update
error running container: error creating container for [/bin/sh -c apt-get update]: time="2023-05-25T06:02:28Z" level=warning msg="signal: killed"
time="2023-05-25T06:02:28Z" level=error msg="container_linux.go:346: starting container process caused \"process_linux.go:297: applying cgroup configuration for process caused \\\"mountpoint for cgroup not found\\\"\"\n" container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\""
: exit status 1
Error: error building at STEP "RUN apt-get update": error while running runtime: exit status 1
section_end:1684994549:step_script
section_start:1684994549:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1684994550:cleanup_file_variables
ERROR: Job failed: exit code 1

build-containers:build-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/42415066):
time="2023-05-25T06:02:27Z" level=fatal msg="Invalid status code returned when fetching blob 500 (Internal Server Error)"
Building!
STEP 1: FROM fedora:31
Getting image source signatures
Copying blob sha256:854946d575a439a894349addd141568875d7c1e673d3286b08250f3dde002e6a
Copying config sha256:7e94ed77b448a8d2ff08b92d3ca743e4e862c744892d6886c73487581eb5863a
Writing manifest to image destination
Storing signatures
STEP 2: RUN dnf install -y gcc flex bison libatomic meson ninja-build xdotool 'pkgconfig(libdrm)' 'pkgconfig(pciaccess)' 'pkgconfig(libkmod)' 'pkgconfig(libprocps)' 'pkgconfig(libunwind)' 'pkgconfig(libdw)' 'pkgconfig(pixman-1)' 'pkgconfig(valgrind)' 'pkgconfig(cairo)' 'pkgconfig(libudev)' 'pkgconfig(glib-2.0)' 'pkgconfig(gsl)' 'pkgconfig(alsa)' 'pkgconfig(xmlrpc)' 'pkgconfig(xmlrpc_util)' 'pkgconfig(xmlrpc_client)' 'pkgconfig(json-c)' 'pkgconfig(gtk-doc)' 'pkgconfig(xv)' 'pkgconfig(xrandr)' python3-docutils
error running container: error creating container for [/bin/sh -c dnf install -y gcc flex bison libatomic meson ninja-build xdotool 'pkgconfig(libdrm)' 'pkgconfig(pciaccess)' 'pkgconfig(libkmod)' 'pkgconfig(libprocps)' 'pkgconfig(libunwind)' 'pkgconfig(libdw)' 'pkgconfig(pixman-1)' 'pkgconfig(valgrind)' 'pkgconfig(cairo)' 'pkgconfig(libudev)' 'pkgconfig(glib-2.0)' 'pkgconfig(gsl)' 'pkgconfig(alsa)' 'pkgconfig(xmlrpc)' 'pkgconfig(xmlrpc_util)' 'pkgconfig(xmlrpc_client)' 'pkgconfig(json-c)' 'pkgconfig(gtk-doc)' 'pkgconfig(xv)' 'pkgconfig(xrandr)' python3-docutils]: time="2023-05-25T06:02:31Z" level=warning msg="signal: killed"
time="2023-05-25T06:02:31Z" level=error msg="container_linux.go:346: starting container process caused \"process_linux.go:297: applying cgroup configuration for process caused \\\"mountpoint for cgroup not found\\\"\"\n" container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\""
: exit status 1
Error: error building at STEP "RUN dnf install -y gcc flex bison libatomic meson ninja-build xdotool 'pkgconfig(libdrm)' 'pkgconfig(pciaccess)' 'pkgconfig(libkmod)' 'pkgconfig(libprocps)' 'pkgconfig(libunwind)' 'pkgconfig(libdw)' 'pkgconfig(pixman-1)' 'pkgconfig(valgrind)' 'pkgconfig(cairo)' 'pkgconfig(libudev)' 'pkgconfig(glib-2.0)' 'pkgconfig(gsl)' 'pkgconfig(alsa)' 'pkgconfig(xmlrpc)' 'pkgconfig(xmlrpc_util)' 'pkgconfig(xmlrpc_client)' 'pkgconfig(json-c)' 'pkgconfig(gtk-doc)' 'pkgconfig(xv)' 'pkgconfig(xrandr)' python3-docutils": error while running runtime: exit status 1
section_end:1684994552:step_script
section_start:1684994552:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1684994554:cleanup_file_variables
ERROR: Job failed: exit code 1

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/890115