[igt-dev] [PATCH i-g-t 1/2] tests/i915/gem_spin_batch: Removing context persistence

Jasmine Newsome jasmine.newsome at intel.com
Wed Feb 23 23:59:39 UTC 2022


The spin all test relied on context persistence unecessarily by trying
to destroy contexts while keeping spinners active.
The current implementation of context persistence in i915 can cause
failures with GuC enabled, and persistence is not needed for this test.

Moving intel_ctx_destroy after igt_spin_end.

Signed-off-by: Jasmine Newsome <jasmine.newsome at intel.com>
---
 lib/igt_dummyload.c |  1 +
 lib/igt_dummyload.h | 43 +++++++++++++++++++++++--------------------
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 645db922..0b2be154 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -421,6 +421,7 @@ emit_recursive_batch(igt_spin_t *spin,
 	}
 
 	spin->cmd_precondition = *spin->condition;
+	spin->opts = *opts;
 
 	return fence_fd;
 }
diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
index f0205261..af9e6a43 100644
--- a/lib/igt_dummyload.h
+++ b/lib/igt_dummyload.h
@@ -33,6 +33,28 @@
 #include "i915_drm.h"
 #include "intel_ctx.h"
 
+
+/**
+ * igt_spin_factory_t:
+ * @ctx_id: GEM context handle
+ * @ctx: intel_ctx_t context wrapper
+ * @dependency: GEM object to depend on
+ * @engine: Flags describing the engine to execute on
+ * @flags: Set of IGT_SPIN_* flags
+ * @fence: In-fence to wait on
+ *
+ * A factory struct which contains creation parameters for an igt_spin_t.
+ */
+typedef struct igt_spin_factory {
+	uint32_t ctx_id;
+	const intel_ctx_t *ctx;
+	uint32_t dependency;
+	unsigned int engine;
+	unsigned int flags;
+	int fence;
+	uint64_t ahnd;
+} igt_spin_factory_t;
+
 typedef struct igt_spin {
 	struct igt_list_head link;
 
@@ -60,28 +82,9 @@ typedef struct igt_spin {
 #define SPIN_CLFLUSH (1 << 0)
 
 	uint64_t ahnd;
+	struct igt_spin_factory opts;
 } igt_spin_t;
 
-/**
- * igt_spin_factory_t:
- * @ctx_id: GEM context handle
- * @ctx: intel_ctx_t context wrapper
- * @dependency: GEM object to depend on
- * @engine: Flags describing the engine to execute on
- * @flags: Set of IGT_SPIN_* flags
- * @fence: In-fence to wait on
- *
- * A factory struct which contains creation parameters for an igt_spin_t.
- */
-typedef struct igt_spin_factory {
-	uint32_t ctx_id;
-	const intel_ctx_t *ctx;
-	uint32_t dependency;
-	unsigned int engine;
-	unsigned int flags;
-	int fence;
-	uint64_t ahnd;
-} igt_spin_factory_t;
 
 #define IGT_SPIN_FENCE_IN      (1 << 0)
 #define IGT_SPIN_FENCE_SUBMIT  (1 << 1)
-- 
2.25.1



More information about the igt-dev mailing list