mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-13 02:46:23 +00:00
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>
This commit is contained in:
parent
2e526ae9cd
commit
9fd6e07369
@ -220,7 +220,7 @@ static int get_object_count(void)
|
|||||||
FILE *file;
|
FILE *file;
|
||||||
int ret, scanned;
|
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");
|
file = igt_debugfs_fopen("i915_gem_objects", "r");
|
||||||
|
|
||||||
@ -262,6 +262,7 @@ static void test_reimport_close_race(void)
|
|||||||
* up the counts */
|
* up the counts */
|
||||||
fake = drm_open_any();
|
fake = drm_open_any();
|
||||||
|
|
||||||
|
gem_quiescent_gpu(fake);
|
||||||
obj_count = get_object_count();
|
obj_count = get_object_count();
|
||||||
|
|
||||||
num_threads = sysconf(_SC_NPROCESSORS_ONLN);
|
num_threads = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
@ -293,6 +294,7 @@ static void test_reimport_close_race(void)
|
|||||||
close(fds[0]);
|
close(fds[0]);
|
||||||
close(fds[1]);
|
close(fds[1]);
|
||||||
|
|
||||||
|
gem_quiescent_gpu(fake);
|
||||||
obj_count = get_object_count() - obj_count;
|
obj_count = get_object_count() - obj_count;
|
||||||
|
|
||||||
igt_info("leaked %i objects\n", obj_count);
|
igt_info("leaked %i objects\n", obj_count);
|
||||||
@ -352,6 +354,7 @@ static void test_export_close_race(void)
|
|||||||
* up the counts */
|
* up the counts */
|
||||||
fake = drm_open_any();
|
fake = drm_open_any();
|
||||||
|
|
||||||
|
gem_quiescent_gpu(fake);
|
||||||
obj_count = get_object_count();
|
obj_count = get_object_count();
|
||||||
|
|
||||||
fd = drm_open_any();
|
fd = drm_open_any();
|
||||||
@ -374,6 +377,7 @@ static void test_export_close_race(void)
|
|||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
gem_quiescent_gpu(fake);
|
||||||
obj_count = get_object_count() - obj_count;
|
obj_count = get_object_count() - obj_count;
|
||||||
|
|
||||||
igt_info("leaked %i objects\n", obj_count);
|
igt_info("leaked %i objects\n", obj_count);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user