From 2e526ae9cd05f4f2c2e166071b78c68564e191aa Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 12 Apr 2015 13:32:17 +0100 Subject: [PATCH] igt/gem_flink_race: Explicitly quiesce the GPU before counting objects By explicitly quiescing the GPU we force it to a known and ideally identical state when counting objects. In particular, this should make the batch-pool status the same and not cause us to detect a negative leak. Signed-off-by: Chris Wilson --- tests/gem_flink_race.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c index 6ef15f36..889cb1be 100644 --- a/tests/gem_flink_race.c +++ b/tests/gem_flink_race.c @@ -56,12 +56,13 @@ static int get_object_count(void) FILE *file; int scanned, ret; - igt_drop_caches_set(DROP_RETIRE); + igt_drop_caches_set(DROP_RETIRE | DROP_ACTIVE); file = igt_debugfs_fopen("i915_gem_objects", "r"); scanned = fscanf(file, "%i objects", &ret); igt_assert_eq(scanned, 1); + igt_debug("Reports %d objects\n", ret); return ret; } @@ -165,6 +166,7 @@ static void test_flink_close(void) * up the counts */ fake = drm_open_any(); + gem_quiescent_gpu(fake); obj_count = get_object_count(); num_threads = sysconf(_SC_NPROCESSORS_ONLN); @@ -190,6 +192,7 @@ static void test_flink_close(void) close(fd); + gem_quiescent_gpu(fake); obj_count = get_object_count() - obj_count; igt_info("leaked %i objects\n", obj_count);