diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-22 15:24:54 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-02-22 15:28:33 +0000 |
commit | 9518cb59abe35143f15abac2b7ffdb99820ef53c (patch) | |
tree | 6840ce3c318a831bedecb33cae004fcdf5d3f40f | |
parent | af0e1c583e4235028a750551b4637c79ff482b30 (diff) |
igt: Start marking up GEM tests that require an alive GPU to function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
50 files changed, 72 insertions, 5 deletions
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index cd0c24ba..2d1be49b 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -1480,6 +1480,17 @@ void gem_require_caching(int fd) errno = 0; } +void igt_require_gem(int fd) +{ + int err; + + err = 0; + if (ioctl(fd, DRM_IOCTL_I915_GEM_THROTTLE)) + err = -errno; + + igt_require_f(err == 0, "Unresponsive i915/GEM device\n"); +} + bool gem_has_ring(int fd, unsigned ring) { struct drm_i915_gem_execbuffer2 execbuf; diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h index 64628df7..cf33da87 100644 --- a/lib/ioctl_wrappers.h +++ b/lib/ioctl_wrappers.h @@ -148,6 +148,7 @@ void gem_sw_finish(int fd, uint32_t handle); bool gem_bo_busy(int fd, uint32_t handle); /* feature test helpers */ +void igt_require_gem(int fd); bool gem_has_llc(int fd); bool gem_has_bsd(int fd); bool gem_has_blt(int fd); diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c index cafdf4c1..ca6c7c1e 100644 --- a/tests/drv_hangman.c +++ b/tests/drv_hangman.c @@ -242,6 +242,7 @@ igt_main int idx; device = drm_open_driver(DRIVER_INTEL); + igt_require_gem(device); sysfs = igt_sysfs_open(device, &idx); igt_assert(sysfs != -1); } diff --git a/tests/drv_missed_irq.c b/tests/drv_missed_irq.c index 2766c346..896f1c59 100644 --- a/tests/drv_missed_irq.c +++ b/tests/drv_missed_irq.c @@ -125,6 +125,7 @@ igt_simple_main bind_to_cpu(0); fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); gem_require_mmap_wc(fd); igt_fork_hang_detector(fd); diff --git a/tests/gem_busy.c b/tests/gem_busy.c index 39360109..06cc3a0b 100644 --- a/tests/gem_busy.c +++ b/tests/gem_busy.c @@ -514,6 +514,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); igt_require(can_store_dword_imm(fd)); } diff --git a/tests/gem_close_race.c b/tests/gem_close_race.c index 05e95547..3e1eb9ee 100644 --- a/tests/gem_close_race.c +++ b/tests/gem_close_race.c @@ -215,6 +215,7 @@ igt_main int fd; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); devid = intel_get_drm_devid(fd); has_64bit_relocations = intel_gen(devid) >= 8; diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index 66250849..6ec461d3 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -1833,6 +1833,7 @@ igt_main allow_unlimited_files(); fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); intel_detect_and_clear_missed_interrupts(fd); devid = intel_get_drm_devid(fd); gen = intel_gen(devid); diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c index 4e4458d2..2d4f90e8 100644 --- a/tests/gem_cpu_reloc.c +++ b/tests/gem_cpu_reloc.c @@ -247,6 +247,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); } igt_subtest("basic") { diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c index fd9bb793..9f445d52 100644 --- a/tests/gem_cs_prefetch.c +++ b/tests/gem_cs_prefetch.c @@ -94,6 +94,7 @@ static void can_test_ring(unsigned ring) /* Dance to avoid dying with master open */ close(master); + igt_require_gem(fd); gem_require_ring(fd, ring); gem_require_store_dword(fd, ring); close(fd); diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c index 0338a1e0..2ddb52a3 100644 --- a/tests/gem_cs_tlb.c +++ b/tests/gem_cs_tlb.c @@ -145,8 +145,10 @@ igt_main igt_skip_on_simulation(); - igt_fixture + igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); + } for (e = intel_execution_engines; e->name; e++) igt_subtest_f("%s%s", e->exec_id ? "" : "basic-", e->name) diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c index b779ea74..aa4534ea 100644 --- a/tests/gem_ctx_create.c +++ b/tests/gem_ctx_create.c @@ -308,6 +308,7 @@ igt_main unsigned engine; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); memset(&create, 0, sizeof(create)); igt_require(__gem_context_create(fd, &create) == 0); diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c index 342f8e93..ad39d5ed 100644 --- a/tests/gem_ctx_exec.c +++ b/tests/gem_ctx_exec.c @@ -158,6 +158,7 @@ igt_main igt_fixture { fd = drm_open_driver_render(DRIVER_INTEL); + igt_require_gem(fd); handle = gem_create(fd, 4096); diff --git a/tests/gem_ctx_switch.c b/tests/gem_ctx_switch.c index 00122806..80ebce5d 100644 --- a/tests/gem_ctx_switch.c +++ b/tests/gem_ctx_switch.c @@ -151,6 +151,8 @@ igt_main const uint32_t bbe = MI_BATCH_BUFFER_END; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); + light = gem_create(fd, 4096); gem_write(fd, light, 0, &bbe, sizeof(bbe)); diff --git a/tests/gem_evict_alignment.c b/tests/gem_evict_alignment.c index bdbb1540..a5dfd0d9 100644 --- a/tests/gem_evict_alignment.c +++ b/tests/gem_evict_alignment.c @@ -195,6 +195,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); } igt_subtest("minor-normal") { diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c index 591b478b..2f93cde1 100644 --- a/tests/gem_evict_everything.c +++ b/tests/gem_evict_everything.c @@ -182,6 +182,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); size = 1024 * 1024; count = 3*gem_aperture_size(fd) / size / 4; diff --git a/tests/gem_exec_alignment.c b/tests/gem_exec_alignment.c index 0549af33..a10571c9 100644 --- a/tests/gem_exec_alignment.c +++ b/tests/gem_exec_alignment.c @@ -199,8 +199,10 @@ igt_main { int fd = -1; - igt_fixture + igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); + } igt_subtest("single") /* basic! */ single(fd); diff --git a/tests/gem_exec_async.c b/tests/gem_exec_async.c index 5b379cdf..d054fd43 100644 --- a/tests/gem_exec_async.c +++ b/tests/gem_exec_async.c @@ -196,6 +196,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); gem_require_mmap_wc(fd); igt_require(has_async_execbuf(fd)); igt_fork_hang_detector(fd); diff --git a/tests/gem_exec_bad_domains.c b/tests/gem_exec_bad_domains.c index 45ea8bad..9a7487e3 100644 --- a/tests/gem_exec_bad_domains.c +++ b/tests/gem_exec_bad_domains.c @@ -153,6 +153,7 @@ igt_main { igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c index 3eaf0935..2f057ef0 100644 --- a/tests/gem_exec_basic.c +++ b/tests/gem_exec_basic.c @@ -106,6 +106,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); igt_fork_hang_detector(fd); } diff --git a/tests/gem_exec_big.c b/tests/gem_exec_big.c index f9f60bae..a15672f6 100644 --- a/tests/gem_exec_big.c +++ b/tests/gem_exec_big.c @@ -204,6 +204,8 @@ igt_simple_main int fd; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); + use_64bit_relocs = intel_gen(intel_get_drm_devid(fd)) >= 8; max = 3 * gem_aperture_size(fd) / 4; diff --git a/tests/gem_exec_create.c b/tests/gem_exec_create.c index 25926150..28479a9d 100644 --- a/tests/gem_exec_create.c +++ b/tests/gem_exec_create.c @@ -152,6 +152,7 @@ igt_main igt_fixture { device = drm_open_driver(DRIVER_INTEL); + igt_require_gem(device); igt_fork_hang_detector(device); } diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c index c17ce2da..6b05e43f 100644 --- a/tests/gem_exec_faulting_reloc.c +++ b/tests/gem_exec_faulting_reloc.c @@ -172,6 +172,7 @@ static void run(int object_size) int ring; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); devid = intel_get_drm_devid(fd); handle = gem_create(fd, 4096); src = gem_create(fd, object_size); diff --git a/tests/gem_exec_fence.c b/tests/gem_exec_fence.c index ddc5e7f2..357ef19f 100644 --- a/tests/gem_exec_fence.c +++ b/tests/gem_exec_fence.c @@ -318,6 +318,7 @@ igt_main igt_fixture { i915 = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(i915); igt_require(gem_has_exec_fence(i915)); gem_require_mmap_wc(i915); diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c index 4b51fbb0..5982c712 100644 --- a/tests/gem_exec_flush.c +++ b/tests/gem_exec_flush.c @@ -583,6 +583,7 @@ igt_main igt_fixture { igt_require(igt_setup_clflush()); fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); gem_require_mmap_wc(fd); gen = intel_gen(intel_get_drm_devid(fd)); igt_require(can_store_dword_imm(gen)); diff --git a/tests/gem_exec_gttfill.c b/tests/gem_exec_gttfill.c index 6ab88b15..f9a061eb 100644 --- a/tests/gem_exec_gttfill.c +++ b/tests/gem_exec_gttfill.c @@ -223,6 +223,7 @@ igt_main igt_fixture { device = drm_open_driver(DRIVER_INTEL); + igt_require_gem(device); igt_require(can_store_dword_imm(device)); igt_fork_hang_detector(device); } diff --git a/tests/gem_exec_latency.c b/tests/gem_exec_latency.c index 6e6cc57b..823bf538 100644 --- a/tests/gem_exec_latency.c +++ b/tests/gem_exec_latency.c @@ -394,6 +394,7 @@ igt_main igt_fixture { intel_register_access_init(intel_get_pci_device(), false); device = drm_open_driver(DRIVER_INTEL); + igt_require_gem(device); print_welcome(device); } diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c index 09b55b9e..9793133c 100644 --- a/tests/gem_exec_lut_handle.c +++ b/tests/gem_exec_lut_handle.c @@ -104,6 +104,7 @@ igt_simple_main igt_skip_on_simulation(); fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); memset(gem_exec, 0, sizeof(gem_exec)); for (n = 0; n < MAX_NUM_EXEC; n++) diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c index 0d7a4d06..5a2f1b93 100644 --- a/tests/gem_exec_nop.c +++ b/tests/gem_exec_nop.c @@ -451,6 +451,7 @@ igt_main const uint32_t bbe = MI_BATCH_BUFFER_END; device = drm_open_driver(DRIVER_INTEL); + igt_require_gem(device); print_welcome(device); handle = gem_create(device, 4096); diff --git a/tests/gem_exec_parallel.c b/tests/gem_exec_parallel.c index 3be5017a..baed76ab 100644 --- a/tests/gem_exec_parallel.c +++ b/tests/gem_exec_parallel.c @@ -269,6 +269,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); igt_fork_hang_detector(fd); } diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c index fbc0ab30..07bea924 100644 --- a/tests/gem_exec_params.c +++ b/tests/gem_exec_params.c @@ -84,6 +84,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); devid = intel_get_drm_devid(fd); diff --git a/tests/gem_exec_parse.c b/tests/gem_exec_parse.c index ea39c481..ff438b25 100644 --- a/tests/gem_exec_parse.c +++ b/tests/gem_exec_parse.c @@ -424,6 +424,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); parser_version = command_parser_version(fd); igt_require(parser_version != -1); diff --git a/tests/gem_exec_reloc.c b/tests/gem_exec_reloc.c index e79a5ecd..152f606a 100644 --- a/tests/gem_exec_reloc.c +++ b/tests/gem_exec_reloc.c @@ -556,8 +556,10 @@ igt_main uint64_t size; int fd = -1; - igt_fixture + igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); + } for (f = flags; f->name; f++) { igt_hang_t hang; diff --git a/tests/gem_exec_reuse.c b/tests/gem_exec_reuse.c index f0323c8b..cdfa9783 100644 --- a/tests/gem_exec_reuse.c +++ b/tests/gem_exec_reuse.c @@ -151,6 +151,7 @@ igt_main allow_unlimited_files(); no.fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(no.fd); igt_fork_hang_detector(no.fd); diff --git a/tests/gem_exec_schedule.c b/tests/gem_exec_schedule.c index b3f61fea..168faaab 100644 --- a/tests/gem_exec_schedule.c +++ b/tests/gem_exec_schedule.c @@ -457,6 +457,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); gem_require_mmap_wc(fd); igt_fork_hang_detector(fd); } diff --git a/tests/gem_exec_store.c b/tests/gem_exec_store.c index 08248966..1a92c932 100644 --- a/tests/gem_exec_store.c +++ b/tests/gem_exec_store.c @@ -220,6 +220,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); igt_require(can_store_dword_imm(fd)); igt_fork_hang_detector(fd); diff --git a/tests/gem_exec_suspend.c b/tests/gem_exec_suspend.c index c250761e..db5f6f1d 100644 --- a/tests/gem_exec_suspend.c +++ b/tests/gem_exec_suspend.c @@ -259,6 +259,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); igt_require(can_store_dword_imm(fd)); igt_fork_hang_detector(fd); diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c index 7f8f568f..cac3fedd 100644 --- a/tests/gem_exec_whisper.c +++ b/tests/gem_exec_whisper.c @@ -547,6 +547,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); igt_require(can_store_dword_imm(fd)); print_welcome(fd); diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c index 2966bc92..e403a491 100644 --- a/tests/gem_fenced_exec_thrash.c +++ b/tests/gem_fenced_exec_thrash.c @@ -221,6 +221,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); num_fences = gem_available_fences(fd); igt_assert(num_fences > 4); devid = intel_get_drm_devid(fd); diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c index 2fb487d7..a3dbfad4 100644 --- a/tests/gem_gtt_hog.c +++ b/tests/gem_gtt_hog.c @@ -160,6 +160,7 @@ igt_simple_main /* check for an intel gpu before goint nuts. */ int fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); close(fd); igt_skip_on_simulation(); diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c index aa72db17..f9364b23 100644 --- a/tests/gem_reloc_overflow.c +++ b/tests/gem_reloc_overflow.c @@ -371,6 +371,7 @@ igt_main size_t reloc_size; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); devid = intel_get_drm_devid(fd); /* Create giant reloc buffer area. */ diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c index ef898231..fa4d9aa3 100644 --- a/tests/gem_reloc_vs_gpu.c +++ b/tests/gem_reloc_vs_gpu.c @@ -301,6 +301,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); /* disable reuse, otherwise the test fails */ //drm_intel_bufmgr_gem_enable_reuse(bufmgr); diff --git a/tests/gem_request_retire.c b/tests/gem_request_retire.c index 88b41d41..6c0251c0 100644 --- a/tests/gem_request_retire.c +++ b/tests/gem_request_retire.c @@ -226,6 +226,7 @@ int main(int argc, char **argv) igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); igt_assert(fd >= 0); } diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c index 9c547ee5..ab5bedb3 100644 --- a/tests/gem_ring_sync_loop.c +++ b/tests/gem_ring_sync_loop.c @@ -95,6 +95,7 @@ igt_simple_main int fd; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); intel_detect_and_clear_missed_interrupts(fd); sync_loop(fd); diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c index 8e221cf8..4057ec2f 100644 --- a/tests/gem_ringfill.c +++ b/tests/gem_ringfill.c @@ -261,6 +261,7 @@ igt_main int gen; fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); igt_require(can_store_dword_imm(fd)); gen = intel_gen(intel_get_drm_devid(fd)); if (gen > 3 && gen < 6) { /* ctg and ilk need secure batches */ diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c index 7678acfe..1facd5b7 100644 --- a/tests/gem_softpin.c +++ b/tests/gem_softpin.c @@ -481,6 +481,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); igt_require(gem_has_softpin(fd)); } diff --git a/tests/gem_streaming_writes.c b/tests/gem_streaming_writes.c index 2b35410c..c27e7fa7 100644 --- a/tests/gem_streaming_writes.c +++ b/tests/gem_streaming_writes.c @@ -374,8 +374,10 @@ igt_main { int fd, sync; - igt_fixture + igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); + } for (sync = 2; sync--; ) { igt_subtest_f("cpu%s", sync ? "-sync":"") diff --git a/tests/gem_sync.c b/tests/gem_sync.c index 33d356ad..a1abc67c 100644 --- a/tests/gem_sync.c +++ b/tests/gem_sync.c @@ -729,6 +729,7 @@ igt_main igt_fixture { fd = drm_open_driver(DRIVER_INTEL); + igt_require_gem(fd); print_welcome(fd); igt_fork_hang_detector(fd); diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c index 0912be03..61e7632f 100644 --- a/tests/gem_userptr_blits.c +++ b/tests/gem_userptr_blits.c @@ -1285,6 +1285,7 @@ int main(int argc, char **argv) igt_fixture { fd = drm_open_driver(DRIVER_INTEL); igt_assert(fd >= 0); + igt_require_gem(fd); size = sizeof(linear); diff --git a/tests/prime_busy.c b/tests/prime_busy.c index c7ff8720..f0c8740a 100644 --- a/tests/prime_busy.c +++ b/tests/prime_busy.c @@ -231,8 +231,10 @@ igt_main igt_skip_on_simulation(); - igt_fixture + igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(fd); + } igt_subtest_group { const struct mode { diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c index 5f8a4dd5..44e5c65a 100644 --- a/tests/prime_vgem.c +++ b/tests/prime_vgem.c @@ -740,6 +740,7 @@ igt_main igt_require(has_prime_export(vgem)); i915 = drm_open_driver_master(DRIVER_INTEL); + igt_require_gem(i915); igt_require(has_prime_import(i915)); gem_require_mmap_wc(i915); gen = intel_gen(intel_get_drm_devid(i915)); |