diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-22 17:33:40 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-22 17:45:06 +0000 |
commit | 5b675f7b2f6487548a91c01eb9a7e36e808617b4 (patch) | |
tree | 8812e54f7fc5467635b7e9aaf1ccc503d3c87014 /tests/gem_concurrent_all.c | |
parent | e0ee36141ed1747f68580559a7cbfbeba902f05c (diff) |
lib: Refactor common detection of missed interrupts
As we have the same function in a few places to read the
debugfs/i915_ring_missed_irq file, move it to the core.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_concurrent_all.c')
-rw-r--r-- | tests/gem_concurrent_all.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index 9fcced73..cc0e4565 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -755,26 +755,6 @@ static struct igt_hang_ring rcs_hang(void) return igt_hang_ring(fd, I915_EXEC_RENDER); } -static void check_gpu(void) -{ - unsigned missed_irq = 0; - FILE *file; - - gem_quiescent_gpu(fd); - - file = igt_debugfs_fopen("i915_ring_missed_irq", "r"); - if (file) { - fscanf(file, "%x", &missed_irq); - fclose(file); - } - file = igt_debugfs_fopen("i915_ring_missed_irq", "w"); - if (file) { - fwrite("0\n", 1, 2, file); - fclose(file); - } - igt_assert_eq(missed_irq, 0); -} - static void do_basic0(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) @@ -1135,7 +1115,7 @@ static void run_single(struct buffers *buffers, do_hang do_hang_func) { do_test_func(buffers, do_copy_func, do_hang_func); - check_gpu(); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } static void run_interruptible(struct buffers *buffers, @@ -1146,7 +1126,7 @@ static void run_interruptible(struct buffers *buffers, for (pass = 0; pass < 10; pass++) do_test_func(buffers, do_copy_func, do_hang_func); pass = 0; - check_gpu(); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } static void __run_forked(struct buffers *buffers, @@ -1177,7 +1157,7 @@ static void __run_forked(struct buffers *buffers, } igt_waitchildren(); - check_gpu(); + igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); num_buffers = old_num_buffers; } @@ -1473,6 +1453,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + intel_detect_and_clear_missed_interrupts(fd); devid = intel_get_drm_devid(fd); gen = intel_gen(devid); rendercopy = igt_get_render_copyfunc(devid); |