mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 17:36:11 +00:00
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 <chris@chris-wilson.co.uk>
This commit is contained in:
parent
007ff02cbc
commit
2e526ae9cd
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user