[PATCH] Revert "tests: save GPU engine information more properly"

Peter Senna Tschudin me at petersenna.com
Fri Mar 22 16:49:40 UTC 2024


This reverts commit 93c5ec210 that was intended to fix:
 https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/147

Reverting this patch fixes the following tests:
 - gem_exec_capture at many-4k-incremental
 - gem_exec_capture at many-4k-zero

I could not reproduce issue 147, even when taking 9e635a1c5029 into
account. I tested it on an N3150 and I could not trigger the issue
trough the kms_busy test. I tested with 6.8.0-next-20240320, 5.14.18,
and 5.10.16.

Tested on an i53210M and on an N3150.

Signed-off-by: Peter Senna Tschudin <peter.senna at gmail.com>
---
 lib/i915/gem_engine_topology.c | 12 ++++++------
 lib/i915/gem_engine_topology.h |  2 +-
 tests/intel/gem_exec_capture.c |  2 +-
 tests/intel/gem_reset_stats.c  |  2 +-
 tests/intel/i915_hangman.c     |  2 +-
 tests/intel/kms_busy.c         |  2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index afb576afb..7c6cd9ba9 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -571,23 +571,23 @@ void gem_engine_properties_configure(int fd, struct gem_engine_properties *param
 	int ret;
 	struct gem_engine_properties write = *params;
 
-	ret = gem_engine_property_scanf(fd, write.engine.name,
+	ret = gem_engine_property_scanf(fd, write.engine->name,
 					"heartbeat_interval_ms",
 					"%d", &params->heartbeat_interval);
 	igt_assert_eq(ret, 1);
 
-	ret = gem_engine_property_printf(fd, write.engine.name,
+	ret = gem_engine_property_printf(fd, write.engine->name,
 					 "heartbeat_interval_ms", "%d",
 					 write.heartbeat_interval);
 	igt_assert_lt(0, ret);
 
 	if (gem_scheduler_has_preemption(fd)) {
-		ret = gem_engine_property_scanf(fd, write.engine.name,
+		ret = gem_engine_property_scanf(fd, write.engine->name,
 						"preempt_timeout_ms",
 						"%d", &params->preempt_timeout);
 		igt_assert_eq(ret, 1);
 
-		ret = gem_engine_property_printf(fd, write.engine.name,
+		ret = gem_engine_property_printf(fd, write.engine->name,
 						 "preempt_timeout_ms", "%d",
 						 write.preempt_timeout);
 		igt_assert_lt(0, ret);
@@ -598,13 +598,13 @@ void gem_engine_properties_restore(int fd, const struct gem_engine_properties *s
 {
 	int ret;
 
-	ret = gem_engine_property_printf(fd, saved->engine.name,
+	ret = gem_engine_property_printf(fd, saved->engine->name,
 					 "heartbeat_interval_ms", "%d",
 					 saved->heartbeat_interval);
 	igt_assert_lt(0, ret);
 
 	if (gem_scheduler_has_preemption(fd)) {
-		ret = gem_engine_property_printf(fd, saved->engine.name,
+		ret = gem_engine_property_printf(fd, saved->engine->name,
 						 "preempt_timeout_ms", "%d",
 						 saved->preempt_timeout);
 		igt_assert_lt(0, ret);
diff --git a/lib/i915/gem_engine_topology.h b/lib/i915/gem_engine_topology.h
index 9eb9d5ddc..89642c317 100644
--- a/lib/i915/gem_engine_topology.h
+++ b/lib/i915/gem_engine_topology.h
@@ -122,7 +122,7 @@ struct intel_execution_engine2 gem_eb_flags_to_engine(unsigned int flags);
 	     intel_next_engine(&i__##e__))
 
 struct gem_engine_properties {
-	struct intel_execution_engine2 engine;
+	const struct intel_execution_engine2 *engine;
 	int preempt_timeout;
 	int heartbeat_interval;
 };
diff --git a/tests/intel/gem_exec_capture.c b/tests/intel/gem_exec_capture.c
index 57b178f3e..c99c83853 100644
--- a/tests/intel/gem_exec_capture.c
+++ b/tests/intel/gem_exec_capture.c
@@ -264,7 +264,7 @@ configure_hangs(int fd, const struct intel_execution_engine2 *e, int ctxt_id)
 	struct gem_engine_properties props;
 
 	/* Ensure fast hang detection */
-	props.engine = *e;
+	props.engine = e;
 	props.preempt_timeout = 250;
 	props.heartbeat_interval = 500;
 	gem_engine_properties_configure(fd, &props);
diff --git a/tests/intel/gem_reset_stats.c b/tests/intel/gem_reset_stats.c
index 18875a530..826836acb 100644
--- a/tests/intel/gem_reset_stats.c
+++ b/tests/intel/gem_reset_stats.c
@@ -1006,7 +1006,7 @@ static void test_shared_reset_domain(const intel_ctx_cfg_t *base_cfg,
 
 	sync_gpu();
 
-	params.engine = *e;
+	params.engine = e;
 	params.preempt_timeout = 1;
 	params.heartbeat_interval = 250;
 	gem_engine_properties_configure(device, &params);
diff --git a/tests/intel/i915_hangman.c b/tests/intel/i915_hangman.c
index 47bc4cdd2..d1164ec55 100644
--- a/tests/intel/i915_hangman.c
+++ b/tests/intel/i915_hangman.c
@@ -591,7 +591,7 @@ igt_main
 		gem_require_mmap_device_coherent(device);
 
 		for_each_physical_engine(device, e) {
-			saved_params[num_engines].engine = *e;
+			saved_params[num_engines].engine = e;
 			saved_params[num_engines].preempt_timeout = 500;
 			saved_params[num_engines].heartbeat_interval = 1000;
 			gem_engine_properties_configure(device, saved_params + num_engines++);
diff --git a/tests/intel/kms_busy.c b/tests/intel/kms_busy.c
index 004d9ee6e..ed2b35235 100644
--- a/tests/intel/kms_busy.c
+++ b/tests/intel/kms_busy.c
@@ -390,7 +390,7 @@ static void gpu_engines_init_timeouts(int fd, int max_engines,
 	for_each_physical_engine(fd, e) {
 		igt_assert(*num_engines < max_engines);
 
-		props[*num_engines].engine = *e;
+		props[*num_engines].engine = e;
 		props[*num_engines].preempt_timeout = 0;
 		props[*num_engines].heartbeat_interval = 250;
 
-- 
2.44.0



More information about the Intel-gfx-trybot mailing list