[igt-dev] [PATCH i-g-t 7/9] tests/perf_pmu: Always skip missing engines

Tvrtko Ursulin tursulin at ursulin.net
Fri Feb 2 18:37:52 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Always skip missing engines to make tests skips very early and avoid
losing time in tests which need to do setups or waits before they would
otherwise detect this.

To ensure PMU is rejecting opening missing engines we will add an explicit
test later.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 tests/perf_pmu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index de0a1c7d936c..d654ece63bb7 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -155,6 +155,8 @@ single(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
 	uint64_t val;
 	int fd;
 
+	gem_require_engine(gem_fd, e->class, e->instance);
+
 	fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
 
 	if (flags & TEST_BUSY)
@@ -184,6 +186,8 @@ busy_start(int gem_fd, const struct intel_execution_engine2 *e)
 	uint64_t val;
 	int fd;
 
+	gem_require_engine(gem_fd, e->class, e->instance);
+
 	/*
 	 * Defeat the busy stats delayed disable, we need to guarantee we are
 	 * the first user.
@@ -225,6 +229,8 @@ busy_double_start(int gem_fd, const struct intel_execution_engine2 *e)
 	uint32_t ctx;
 	int fd;
 
+	gem_require_engine(gem_fd, e->class, e->instance);
+
 	ctx = gem_context_create(gem_fd);
 
 	/*
@@ -308,6 +314,8 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 	igt_spin_t *spin;
 	unsigned int busy_idx, i;
 
+	gem_require_engine(gem_fd, e->class, e->instance);
+
 	i = 0;
 	fd[0] = -1;
 	for_each_engine_class_instance(fd, e_) {
@@ -483,6 +491,8 @@ no_sema(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
 	uint64_t val[2][2];
 	int fd;
 
+	gem_require_engine(gem_fd, e->class, e->instance);
+
 	fd = open_group(I915_PMU_ENGINE_SEMA(e->class, e->instance), -1);
 	open_group(I915_PMU_ENGINE_WAIT(e->class, e->instance), fd);
 
@@ -530,6 +540,7 @@ sema_wait(int gem_fd, const struct intel_execution_engine2 *e,
 	int fd;
 
 	igt_require(intel_gen(intel_get_drm_devid(gem_fd)) >= 8);
+	gem_require_engine(gem_fd, e->class, e->instance);
 
 	/**
 	 * Setup up a batchbuffer with a polling semaphore wait command which
@@ -688,6 +699,7 @@ event_wait(int gem_fd, const struct intel_execution_engine2 *e)
 	devid = intel_get_drm_devid(gem_fd);
 	igt_require(intel_gen(devid) >= 7);
 	igt_skip_on(IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid));
+	gem_require_engine(gem_fd, e->class, e->instance);
 
 	kmstest_set_vt_graphics_mode();
 	igt_display_init(&data.display, gem_fd);
@@ -804,6 +816,8 @@ multi_client(int gem_fd, const struct intel_execution_engine2 *e)
 	uint64_t val[2];
 	int fd[2];
 
+	gem_require_engine(gem_fd, e->class, e->instance);
+
 	gem_quiescent_gpu(gem_fd);
 
 	fd[0] = open_pmu(config);
-- 
2.14.1



More information about the igt-dev mailing list