diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/drv_hangman.c | 2 | ||||
-rw-r--r-- | tests/gem_busy.c | 179 | ||||
-rw-r--r-- | tests/gem_concurrent_all.c | 42 | ||||
-rw-r--r-- | tests/gem_ctx_exec.c | 2 | ||||
-rw-r--r-- | tests/gem_eio.c | 2 | ||||
-rw-r--r-- | tests/gem_pread_after_blit.c | 10 | ||||
-rw-r--r-- | tests/gem_reloc_vs_gpu.c | 10 | ||||
-rw-r--r-- | tests/gem_reset_stats.c | 4 | ||||
-rw-r--r-- | tests/gem_ringfill.c | 2 | ||||
-rw-r--r-- | tests/gem_softpin.c | 2 | ||||
-rw-r--r-- | tests/kms_flip.c | 8 | ||||
-rw-r--r-- | tests/kms_pipe_crc_basic.c | 2 |
12 files changed, 138 insertions, 127 deletions
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c index 4af031ea..953a4c61 100644 --- a/tests/drv_hangman.c +++ b/tests/drv_hangman.c @@ -139,7 +139,7 @@ const uint32_t *batch; static uint64_t submit_hang(int fd, unsigned ring_id) { uint64_t offset; - igt_hang_ring_t hang; + igt_hang_t hang; hang = igt_hang_ctx(fd, 0, ring_id, HANG_ALLOW_CAPTURE, &offset); diff --git a/tests/gem_busy.c b/tests/gem_busy.c index 10cb1ad4..9f93097f 100644 --- a/tests/gem_busy.c +++ b/tests/gem_busy.c @@ -604,90 +604,97 @@ igt_main fd = drm_open_driver_master(DRIVER_INTEL); } - igt_fixture { - igt_fork_hang_detector(fd); - } - for (e = intel_execution_engines; e->name; e++) { - igt_subtest_group { - igt_subtest_f("%sbusy-%s", - e->exec_id == 0 ? "basic-" : "", - e->name) { - igt_require(gem_has_ring(fd, e->exec_id | e->flags)); - gem_quiescent_gpu(fd); - basic(fd, e->exec_id | e->flags, 0); - } - } - } - igt_subtest_group { - int gen = 0; - igt_fixture { - igt_require(has_extended_busy_ioctl(fd)); - gem_require_mmap_wc(fd); - gen = intel_gen(intel_get_drm_devid(fd)); + igt_fork_hang_detector(fd); } for (e = intel_execution_engines; e->name; e++) { - /* default exec-id is purely symbolic */ - if (e->exec_id == 0) - continue; - - igt_subtest_f("extended-%s", e->name) { - gem_require_ring(fd, e->exec_id | e->flags); - igt_skip_on_f(gen == 6 && - e->exec_id == I915_EXEC_BSD, - "MI_STORE_DATA broken on gen6 bsd\n"); - gem_quiescent_gpu(fd); - one(fd, e->exec_id, e->flags, 0); - gem_quiescent_gpu(fd); + igt_subtest_group { + igt_subtest_f("%sbusy-%s", + e->exec_id == 0 ? "basic-" : "", + e->name) { + igt_require(gem_has_ring(fd, e->exec_id | e->flags)); + gem_quiescent_gpu(fd); + basic(fd, e->exec_id | e->flags, 0); + } } } - for (e = intel_execution_engines; e->name; e++) { - /* default exec-id is purely symbolic */ - if (e->exec_id == 0) - continue; + igt_subtest_group { + int gen = 0; - igt_subtest_f("extended-parallel-%s", e->name) { - gem_require_ring(fd, e->exec_id | e->flags); - igt_skip_on_f(gen == 6 && - e->exec_id == I915_EXEC_BSD, - "MI_STORE_DATA broken on gen6 bsd\n"); - gem_quiescent_gpu(fd); - one(fd, e->exec_id, e->flags, PARALLEL); - gem_quiescent_gpu(fd); + igt_fixture { + igt_require(has_extended_busy_ioctl(fd)); + gem_require_mmap_wc(fd); + gen = intel_gen(intel_get_drm_devid(fd)); } - } - } - igt_subtest_group { - igt_fixture { - igt_require(has_extended_busy_ioctl(fd)); - igt_require(has_semaphores(fd)); + for (e = intel_execution_engines; e->name; e++) { + /* default exec-id is purely symbolic */ + if (e->exec_id == 0) + continue; + + igt_subtest_f("extended-%s", e->name) { + gem_require_ring(fd, e->exec_id | e->flags); + igt_skip_on_f(gen == 6 && + e->exec_id == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + gem_quiescent_gpu(fd); + one(fd, e->exec_id, e->flags, 0); + gem_quiescent_gpu(fd); + } + } + + for (e = intel_execution_engines; e->name; e++) { + /* default exec-id is purely symbolic */ + if (e->exec_id == 0) + continue; + + igt_subtest_f("extended-parallel-%s", e->name) { + gem_require_ring(fd, e->exec_id | e->flags); + igt_skip_on_f(gen == 6 && + e->exec_id == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + gem_quiescent_gpu(fd); + one(fd, e->exec_id, e->flags, PARALLEL); + gem_quiescent_gpu(fd); + } + } } - for (e = intel_execution_engines; e->name; e++) { - /* default exec-id is purely symbolic */ - if (e->exec_id == 0) - continue; + igt_subtest_group { + igt_fixture { + igt_require(has_extended_busy_ioctl(fd)); + igt_require(has_semaphores(fd)); + } + + for (e = intel_execution_engines; e->name; e++) { + /* default exec-id is purely symbolic */ + if (e->exec_id == 0) + continue; - igt_subtest_f("extended-semaphore-%s", e->name) - semaphore(fd, e->exec_id, e->flags); + igt_subtest_f("extended-semaphore-%s", e->name) + semaphore(fd, e->exec_id, e->flags); + } } - } - igt_subtest_group { igt_subtest("close-race") close_race(fd); - } - igt_fixture { - igt_stop_hang_detector(); + igt_fixture { + igt_stop_hang_detector(); + } } - for (e = intel_execution_engines; e->name; e++) { - igt_subtest_group { + igt_subtest_group { + igt_hang_t hang; + + igt_fixture { + hang = igt_allow_hang(fd, 0, 0); + } + + for (e = intel_execution_engines; e->name; e++) { igt_subtest_f("%shang-%s", e->exec_id == 0 ? "basic-" : "", e->name) { @@ -696,32 +703,36 @@ igt_main basic(fd, e->exec_id | e->flags, HANG); } } - } - - igt_subtest_group { - int gen = 0; - igt_fixture { - igt_require(has_extended_busy_ioctl(fd)); - gem_require_mmap_wc(fd); - gen = intel_gen(intel_get_drm_devid(fd)); - } + igt_subtest_group { + int gen = 0; - for (e = intel_execution_engines; e->name; e++) { - /* default exec-id is purely symbolic */ - if (e->exec_id == 0) - continue; + igt_fixture { + igt_require(has_extended_busy_ioctl(fd)); + gem_require_mmap_wc(fd); + gen = intel_gen(intel_get_drm_devid(fd)); + } - igt_subtest_f("extended-hang-%s", e->name) { - gem_require_ring(fd, e->exec_id | e->flags); - igt_skip_on_f(gen == 6 && - e->exec_id == I915_EXEC_BSD, - "MI_STORE_DATA broken on gen6 bsd\n"); - gem_quiescent_gpu(fd); - one(fd, e->exec_id, e->flags, HANG); - gem_quiescent_gpu(fd); + for (e = intel_execution_engines; e->name; e++) { + /* default exec-id is purely symbolic */ + if (e->exec_id == 0) + continue; + + igt_subtest_f("extended-hang-%s", e->name) { + gem_require_ring(fd, e->exec_id | e->flags); + igt_skip_on_f(gen == 6 && + e->exec_id == I915_EXEC_BSD, + "MI_STORE_DATA broken on gen6 bsd\n"); + gem_quiescent_gpu(fd); + one(fd, e->exec_id, e->flags, HANG); + gem_quiescent_gpu(fd); + } } } + + igt_fixture { + igt_disallow_hang(fd, hang); + } } igt_fixture { diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index fcf590ef..1c920d6f 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -856,7 +856,7 @@ static void buffers_fini(struct buffers *b) } typedef void (*do_copy)(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src); -typedef struct igt_hang_ring (*do_hang)(void); +typedef igt_hang_t (*do_hang)(void); static void render_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src) { @@ -940,27 +940,27 @@ static void wc_copy_bo(struct buffers *b, drm_intel_bo *dst, drm_intel_bo *src) munmap(s, size); } -static struct igt_hang_ring no_hang(void) +static igt_hang_t no_hang(void) { - return (struct igt_hang_ring){0, 0}; + return (igt_hang_t){0, 0}; } -static struct igt_hang_ring bcs_hang(void) +static igt_hang_t bcs_hang(void) { return igt_hang_ring(fd, I915_EXEC_BLT); } -static struct igt_hang_ring rcs_hang(void) +static igt_hang_t rcs_hang(void) { return igt_hang_ring(fd, I915_EXEC_RENDER); } -static struct igt_hang_ring all_hang(void) +static igt_hang_t all_hang(void) { uint32_t bbe = MI_BATCH_BUFFER_END; struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 obj; - struct igt_hang_ring hang; + igt_hang_t hang; unsigned engine; memset(&obj, 0, sizeof(obj)); @@ -992,7 +992,7 @@ static void do_basic0(struct buffers *buffers, buffers->mode->set_bo(buffers, buffers->src[0], 0xdeadbeef); for (int i = 0; i < buffers->count; i++) { - struct igt_hang_ring hang = do_hang_func(); + igt_hang_t hang = do_hang_func(); do_copy_func(buffers, buffers->dst[i], buffers->src[0]); buffers->mode->cmp_bo(buffers, buffers->dst[i], 0xdeadbeef); @@ -1008,7 +1008,7 @@ static void do_basic1(struct buffers *buffers, gem_quiescent_gpu(fd); for (int i = 0; i < buffers->count; i++) { - struct igt_hang_ring hang = do_hang_func(); + igt_hang_t hang = do_hang_func(); buffers->mode->set_bo(buffers, buffers->src[i], i); buffers->mode->set_bo(buffers, buffers->dst[i], ~i); @@ -1025,7 +1025,7 @@ static void do_basicN(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; gem_quiescent_gpu(fd); @@ -1051,7 +1051,7 @@ static void do_overwrite_source(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1075,7 +1075,7 @@ static void do_overwrite_source_read(struct buffers *buffers, int do_rcs) { const int half = buffers->count/2; - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1119,7 +1119,7 @@ static void do_overwrite_source__rev(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1141,7 +1141,7 @@ static void do_overwrite_source__one(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; gem_quiescent_gpu(fd); buffers->mode->set_bo(buffers, buffers->src[0], 0); @@ -1159,7 +1159,7 @@ static void do_intermix(struct buffers *buffers, int do_rcs) { const int half = buffers->count/2; - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1213,7 +1213,7 @@ static void do_early_read(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1231,7 +1231,7 @@ static void do_read_read_bcs(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1252,7 +1252,7 @@ static void do_write_read_bcs(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1272,7 +1272,7 @@ static void do_read_read_rcs(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1293,7 +1293,7 @@ static void do_write_read_rcs(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); @@ -1313,7 +1313,7 @@ static void do_gpu_read_after_write(struct buffers *buffers, do_copy do_copy_func, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; int i; gem_quiescent_gpu(fd); diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c index 93f5b971..542ebc3b 100644 --- a/tests/gem_ctx_exec.c +++ b/tests/gem_ctx_exec.c @@ -201,7 +201,7 @@ igt_main * the last context is leaked at every reset. */ for (i = 0; i < 20; i++) { - igt_hang_ring_t hang = igt_hang_ring(fd, I915_EXEC_RENDER); + igt_hang_t hang = igt_hang_ring(fd, I915_EXEC_RENDER); igt_assert(exec(fd, handle, I915_EXEC_RENDER, 0) == 0); igt_assert(exec(fd, handle, I915_EXEC_RENDER, ctx_id) == 0); igt_post_hang_ring(fd, hang); diff --git a/tests/gem_eio.c b/tests/gem_eio.c index ab3facc7..9376e79e 100644 --- a/tests/gem_eio.c +++ b/tests/gem_eio.c @@ -136,7 +136,7 @@ static int __gem_wait(int fd, uint32_t handle, int64_t timeout) static void test_wait(int fd) { - igt_hang_ring_t hang; + igt_hang_t hang; /* If the request we wait on completes due to a hang (even for * that request), the user expects the return value to 0 (success). diff --git a/tests/gem_pread_after_blit.c b/tests/gem_pread_after_blit.c index a85bab14..79ad8bc7 100644 --- a/tests/gem_pread_after_blit.c +++ b/tests/gem_pread_after_blit.c @@ -118,14 +118,14 @@ verify_small_read(drm_intel_bo *bo, uint32_t val) } } -typedef struct igt_hang_ring (*do_hang)(int fd); +typedef igt_hang_t (*do_hang)(int fd); -static struct igt_hang_ring no_hang(int fd) +static igt_hang_t no_hang(int fd) { - return (struct igt_hang_ring){0}; + return (igt_hang_t){0}; } -static struct igt_hang_ring bcs_hang(int fd) +static igt_hang_t bcs_hang(int fd) { return igt_hang_ring(fd, batch->gen >= 6 ? I915_EXEC_BLT : I915_EXEC_DEFAULT); } @@ -136,7 +136,7 @@ static void do_test(int fd, int cache_level, drm_intel_bo *tmp[2], int loop, do_hang do_hang_func) { - struct igt_hang_ring hang; + igt_hang_t hang; if (cache_level != -1) { gem_set_caching(fd, tmp[0]->handle, cache_level); diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c index b11b4285..e327a08b 100644 --- a/tests/gem_reloc_vs_gpu.c +++ b/tests/gem_reloc_vs_gpu.c @@ -184,18 +184,18 @@ static void reloc_and_emit(int fd, drm_intel_bo *target_bo, bool faulting_reloc) gem_close(fd, handle_relocs); } -static struct igt_hang_ring no_hang(int fd) +static igt_hang_t no_hang(int fd) { - return (struct igt_hang_ring){0}; + return (igt_hang_t){0}; } -static struct igt_hang_ring bcs_hang(int fd) +static igt_hang_t bcs_hang(int fd) { return igt_hang_ring(fd, I915_EXEC_BLT); } static void do_test(int fd, bool faulting_reloc, - struct igt_hang_ring (*do_hang)(int fd)) + igt_hang_t (*do_hang)(int fd)) { uint32_t tiling_mode = I915_TILING_X; unsigned long pitch, act_size; @@ -214,7 +214,7 @@ static void do_test(int fd, bool faulting_reloc, create_special_bo(); for (i = 0; i < NUM_TARGET_BOS; i++) { - struct igt_hang_ring hang; + igt_hang_t hang; pc_target_bo[i] = drm_intel_bo_alloc(bufmgr, "special batch", 4096, 4096); emit_dummy_load(pitch); diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c index 3b4974f9..3de74af1 100644 --- a/tests/gem_reset_stats.c +++ b/tests/gem_reset_stats.c @@ -156,7 +156,7 @@ static void inject_hang(int fd, uint32_t ctx, const struct intel_execution_engine *e, unsigned flags) { - igt_hang_ring_t hang; + igt_hang_t hang; clock_gettime(CLOCK_MONOTONIC, &ts_injected); @@ -547,7 +547,7 @@ static void test_close_pending_fork(const struct intel_execution_engine *e, const bool reverse) { int fd = drm_open_driver(DRIVER_INTEL); - igt_hang_ring_t hang; + igt_hang_t hang; int pid; assert_reset_status(fd, fd, 0, RS_NO_ERROR); diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c index e503913d..8047042b 100644 --- a/tests/gem_ringfill.c +++ b/tests/gem_ringfill.c @@ -88,7 +88,7 @@ static void run_test(int fd, unsigned ring, unsigned flags) struct drm_i915_gem_exec_object2 obj[2]; struct drm_i915_gem_relocation_entry reloc[1024]; struct drm_i915_gem_execbuffer2 execbuf; - struct igt_hang_ring hang; + igt_hang_t hang; uint32_t *batch, *b; int i; diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c index a6d4274c..cac46694 100644 --- a/tests/gem_softpin.c +++ b/tests/gem_softpin.c @@ -348,7 +348,7 @@ static void test_evict_hang(int fd) const uint32_t bbe = MI_BATCH_BUFFER_END; struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_exec_object2 object; - igt_hang_ring_t hang; + igt_hang_t hang; uint64_t expected; memset(&object, 0, sizeof(object)); diff --git a/tests/kms_flip.c b/tests/kms_flip.c index d33a4c47..065ad66f 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -790,12 +790,12 @@ static void set_y_tiling(struct test_output *o, int fb_idx) drmFree(r); } -static igt_hang_ring_t hang_gpu(int fd) +static igt_hang_t hang_gpu(int fd) { return igt_hang_ring(fd, I915_EXEC_DEFAULT); } -static void unhang_gpu(int fd, igt_hang_ring_t hang) +static void unhang_gpu(int fd, igt_hang_t hang) { igt_post_hang_ring(fd, hang); } @@ -842,7 +842,7 @@ static unsigned int run_test_step(struct test_output *o) bool do_vblank; struct vblank_reply vbl_reply; unsigned int target_seq; - igt_hang_ring_t hang; + igt_hang_t hang; target_seq = o->vblank_state.seq_step; /* Absolute waits only works once we have a frame counter. */ @@ -1253,7 +1253,7 @@ static unsigned int wait_for_events(struct test_output *o) static unsigned event_loop(struct test_output *o, unsigned duration_ms) { unsigned long start, end; - igt_hang_ring_t hang; + igt_hang_t hang; int count = 0; memset(&hang, 0, sizeof(hang)); diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c index 4de53bc7..2d2f2d69 100644 --- a/tests/kms_pipe_crc_basic.c +++ b/tests/kms_pipe_crc_basic.c @@ -229,7 +229,7 @@ igt_main } igt_subtest_f("hang-read-crc-pipe-%c", 'A'+i) { - igt_hang_ring_t hang = + igt_hang_t hang = igt_hang_ring(data.drm_fd, I915_EXEC_RENDER); test_read_crc(&data, i, 0); igt_post_hang_ring(data.drm_fd, hang); |