[PATCH igt 3/3] igt/perf_pmu: Idle the GPU before starting to measure busyness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure the HW is idle before we start sampling the GPU for busyness.
If we do not rest for long enough between tests, we may carry the
sampling over.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
---
 tests/perf_pmu.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 7fd1506e..9057a1d7 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -137,6 +137,9 @@ single(int gem_fd, const struct intel_execution_engine2 *e, bool busy)
 	uint64_t val;
 	int fd;
 
+	/* Ensure the HW is idle before being BUSY measurements */
+	gem_quiescent_gpu(gem_fd);
+
 	fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
 
 	if (busy) {
@@ -187,6 +190,9 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 	igt_spin_t *spin;
 	unsigned int busy_idx, i;
 
+	/* Ensure the HW is idle before being BUSY measurements */
+	gem_quiescent_gpu(gem_fd);
+
 	i = 0;
 	fd[0] = -1;
 	for_each_engine_class_instance(fd, e_) {
@@ -232,6 +238,9 @@ most_busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 	igt_spin_t *spin[num_engines];
 	unsigned int idle_idx, i;
 
+	/* Ensure the HW is idle before being BUSY measurements */
+	gem_quiescent_gpu(gem_fd);
+
 	gem_require_engine(gem_fd, e->class, e->instance);
 
 	i = 0;
@@ -287,6 +296,9 @@ all_busy_check_all(int gem_fd, const unsigned int num_engines)
 	igt_spin_t *spin[num_engines];
 	unsigned int i;
 
+	/* Ensure the HW is idle before being BUSY measurements */
+	gem_quiescent_gpu(gem_fd);
+
 	i = 0;
 	fd[0] = -1;
 	for_each_engine_class_instance(fd, e) {
@@ -624,6 +636,9 @@ multi_client(int gem_fd, const struct intel_execution_engine2 *e)
 	uint64_t val[2];
 	int fd[2];
 
+	/* Ensure the HW is idle before being BUSY measurements */
+	gem_quiescent_gpu(gem_fd);
+
 	fd[0] = open_pmu(config);
 
 	/*
@@ -739,6 +754,9 @@ static void cpu_hotplug(int gem_fd)
 	uint64_t val, ref;
 	int fd;
 
+	/* Ensure the HW is idle before being BUSY measurements */
+	gem_quiescent_gpu(gem_fd);
+
 	igt_require(cpu0_hotplug_support());
 
 	fd = perf_i915_open(I915_PMU_ENGINE_BUSY(I915_ENGINE_CLASS_RENDER, 0));
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux