summaryrefslogtreecommitdiff
path: root/tests/prime_self_import.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-04-13 10:48:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-04-13 10:49:47 +0100
commit9fd6e07369837ee268097e7aae4c8dea05431fa1 (patch)
tree784826571f2ba132bf17a7158febdd96c765c3aa /tests/prime_self_import.c
parent2e526ae9cd05f4f2c2e166071b78c68564e191aa (diff)
igt/prime_self_import: Ensure driver state is consistent between counts
Similar to gem_flink_race, we need to make sure that when we count objects, the driver is in an identical state. We do this by flushing all work before counting. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90003 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/prime_self_import.c')
-rw-r--r--tests/prime_self_import.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 20eb1150..4fd372d9 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -220,7 +220,7 @@ static int get_object_count(void)
FILE *file;
int ret, scanned;
- igt_drop_caches_set(DROP_RETIRE);
+ igt_drop_caches_set(DROP_RETIRE | DROP_ACTIVE);
file = igt_debugfs_fopen("i915_gem_objects", "r");
@@ -262,6 +262,7 @@ static void test_reimport_close_race(void)
* up the counts */
fake = drm_open_any();
+ gem_quiescent_gpu(fake);
obj_count = get_object_count();
num_threads = sysconf(_SC_NPROCESSORS_ONLN);
@@ -293,6 +294,7 @@ static void test_reimport_close_race(void)
close(fds[0]);
close(fds[1]);
+ gem_quiescent_gpu(fake);
obj_count = get_object_count() - obj_count;
igt_info("leaked %i objects\n", obj_count);
@@ -352,6 +354,7 @@ static void test_export_close_race(void)
* up the counts */
fake = drm_open_any();
+ gem_quiescent_gpu(fake);
obj_count = get_object_count();
fd = drm_open_any();
@@ -374,6 +377,7 @@ static void test_export_close_race(void)
close(fd);
+ gem_quiescent_gpu(fake);
obj_count = get_object_count() - obj_count;
igt_info("leaked %i objects\n", obj_count);