diff options
Diffstat (limited to 'tests/gem_storedw_loop_blt.c')
-rw-r--r-- | tests/gem_storedw_loop_blt.c | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/tests/gem_storedw_loop_blt.c b/tests/gem_storedw_loop_blt.c index 1be05ec0..84f9e28c 100644 --- a/tests/gem_storedw_loop_blt.c +++ b/tests/gem_storedw_loop_blt.c @@ -79,12 +79,9 @@ store_dword_loop(int divider) drm_intel_bo_map(target_buffer, 0); buf = target_buffer->virtual; - if (buf[0] != val) { - fprintf(stderr, - "value mismatch: cur 0x%08x, stored 0x%08x\n", - buf[0], val); - igt_fail(-1); - } + igt_assert_f(buf[0] == val, + "value mismatch: cur 0x%08x, stored 0x%08x\n", + buf[0], val); drm_intel_bo_unmap(target_buffer); @@ -105,47 +102,27 @@ int main(int argc, char **argv) int fd; int devid; - if (argc != 1) { - fprintf(stderr, "usage: %s\n", argv[0]); - igt_fail(-1); - } - fd = drm_open_any(); devid = intel_get_drm_devid(fd); has_ppgtt = gem_uses_aliasing_ppgtt(fd); - if (IS_GEN2(devid) || IS_GEN3(devid) || IS_GEN4(devid) || IS_GEN5(devid)) { - - fprintf(stderr, "MI_STORE_DATA can only use GTT address on gen4+/g33 and " - "needs snoopable mem on pre-gen6\n"); - return 77; - } + igt_skip_on_f(intel_gen(devid) < 6, + "MI_STORE_DATA can only use GTT address on gen4+/g33 and " + "needs snoopable mem on pre-gen6\n"); /* This only works with ppgtt */ - if (!has_ppgtt) { - fprintf(stderr, "no ppgtt detected, which is required\n"); - return 77; - } + igt_require(has_ppgtt); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - if (!bufmgr) { - fprintf(stderr, "failed to init libdrm\n"); - igt_fail(-1); - } + igt_assert(bufmgr); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, devid); - if (!batch) { - fprintf(stderr, "failed to create batch buffer\n"); - igt_fail(-1); - } + igt_assert(batch); target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096); - if (!target_buffer) { - fprintf(stderr, "failed to alloc target buffer\n"); - igt_fail(-1); - } + igt_assert(target_buffer); store_dword_loop(1); store_dword_loop(2); |