int size = width * height;
uint32_t *vaddr;
- drm_intel_bo_map(bo, true);
+ do_or_die(drm_intel_bo_map(bo, true));
vaddr = bo->virtual;
while (size--)
*vaddr++ = val;
int size = width * height;
uint32_t *vaddr;
- drm_intel_bo_map(bo, false);
+ do_or_die(drm_intel_bo_map(bo, false));
vaddr = bo->virtual;
while (size--)
assert(*vaddr++ == val);
int num_buffers = 128, max;
drm_intel_bo *src[128], *dst[128], *dummy = NULL;
int width = 512, height = 512;
- int fd;
- int i;
+ int i, loop, fd;
drmtest_subtest_init(argc, argv);
}
/* try to overwrite the source values */
+ drmtest_fork_signal_helper();
if (drmtest_run_subtest("overwrite-source")) {
- for (i = 0; i < num_buffers; i++)
- intel_copy_bo(batch, dst[i], src[i], width, height);
- for (i = num_buffers; i--; )
- set_bo(src[i], 0xdeadbeef, width, height);
- for (i = 0; i < num_buffers; i++)
- cmp_bo(dst[i], i, width, height);
+ for (loop = 0; loop < 10; loop++) {
+ for (i = 0; i < num_buffers; i++)
+ intel_copy_bo(batch, dst[i], src[i], width, height);
+ for (i = num_buffers; i--; )
+ set_bo(src[i], 0xdeadbeef, width, height);
+ for (i = 0; i < num_buffers; i++)
+ cmp_bo(dst[i], i, width, height);
+ }
}
/* try to read the results before the copy completes */
if (drmtest_run_subtest("early-read")) {
- for (i = num_buffers; i--; )
- set_bo(src[i], 0xdeadbeef, width, height);
- for (i = 0; i < num_buffers; i++)
- intel_copy_bo(batch, dst[i], src[i], width, height);
- for (i = num_buffers; i--; )
- cmp_bo(dst[i], 0xdeadbeef, width, height);
+ for (loop = 0; loop < 10; loop++) {
+ for (i = num_buffers; i--; )
+ set_bo(src[i], 0xdeadbeef, width, height);
+ for (i = 0; i < num_buffers; i++)
+ intel_copy_bo(batch, dst[i], src[i], width, height);
+ for (i = num_buffers; i--; )
+ cmp_bo(dst[i], 0xdeadbeef, width, height);
+ }
}
/* and finally try to trick the kernel into loosing the pending write */
if (drmtest_run_subtest("gpu-read-after-write")) {
- for (i = num_buffers; i--; )
- set_bo(src[i], 0xabcdabcd, width, height);
- for (i = 0; i < num_buffers; i++)
- intel_copy_bo(batch, dst[i], src[i], width, height);
- for (i = num_buffers; i--; )
- intel_copy_bo(batch, dummy, dst[i], width, height);
- for (i = num_buffers; i--; )
- cmp_bo(dst[i], 0xabcdabcd, width, height);
+ for (loop = 0; loop < 10; loop++) {
+ for (i = num_buffers; i--; )
+ set_bo(src[i], 0xabcdabcd, width, height);
+ for (i = 0; i < num_buffers; i++)
+ intel_copy_bo(batch, dst[i], src[i], width, height);
+ for (i = num_buffers; i--; )
+ intel_copy_bo(batch, dummy, dst[i], width, height);
+ for (i = num_buffers; i--; )
+ cmp_bo(dst[i], 0xabcdabcd, width, height);
+ }
}
+ drmtest_fork_signal_helper();
return 0;
}
/* gtt map doesn't have a write parameter, so just keep the mapping
* around (to avoid the set_domain with the gtt write domain set) and
* manually tell the kernel when we start access the gtt. */
- drm_intel_gem_bo_map_gtt(bo);
+ do_or_die(drm_intel_gem_bo_map_gtt(bo));
set_bo(bo, val, width, height);
int num_buffers = 128, max;
drm_intel_bo *src[128], *dst[128], *dummy = NULL;
int width = 512, height = 512;
- int fd;
- int i;
+ int fd, loop, i;
drmtest_subtest_init(argc, argv);
}
/* try to overwrite the source values */
+ drmtest_fork_signal_helper();
if (drmtest_run_subtest("overwrite-source")) {
- for (i = 0; i < num_buffers; i++)
- intel_copy_bo(batch, dst[i], src[i], width, height);
- for (i = num_buffers; i--; )
- set_bo(src[i], 0xdeadbeef, width, height);
- for (i = 0; i < num_buffers; i++)
- cmp_bo(dst[i], i, width, height);
+ for (loop = 0; loop < 10; loop++) {
+ for (i = 0; i < num_buffers; i++)
+ intel_copy_bo(batch, dst[i], src[i], width, height);
+ for (i = num_buffers; i--; )
+ set_bo(src[i], 0xdeadbeef, width, height);
+ for (i = 0; i < num_buffers; i++)
+ cmp_bo(dst[i], i, width, height);
+ }
}
/* try to read the results before the copy completes */
if (drmtest_run_subtest("early-read")) {
- for (i = num_buffers; i--; )
- set_bo(src[i], 0xdeadbeef, width, height);
- for (i = 0; i < num_buffers; i++)
- intel_copy_bo(batch, dst[i], src[i], width, height);
- for (i = num_buffers; i--; )
- cmp_bo(dst[i], 0xdeadbeef, width, height);
+ for (loop = 0; loop < 10; loop++) {
+ for (i = num_buffers; i--; )
+ set_bo(src[i], 0xdeadbeef, width, height);
+ for (i = 0; i < num_buffers; i++)
+ intel_copy_bo(batch, dst[i], src[i], width, height);
+ for (i = num_buffers; i--; )
+ cmp_bo(dst[i], 0xdeadbeef, width, height);
+ }
}
/* and finally try to trick the kernel into loosing the pending write */
if (drmtest_run_subtest("gpu-read-after-write")) {
- for (i = num_buffers; i--; )
- set_bo(src[i], 0xabcdabcd, width, height);
- for (i = 0; i < num_buffers; i++)
- intel_copy_bo(batch, dst[i], src[i], width, height);
- for (i = num_buffers; i--; )
- intel_copy_bo(batch, dummy, dst[i], width, height);
- for (i = num_buffers; i--; )
- cmp_bo(dst[i], 0xabcdabcd, width, height);
+ for (loop = 0; loop < 10; loop++) {
+ for (i = num_buffers; i--; )
+ set_bo(src[i], 0xabcdabcd, width, height);
+ for (i = 0; i < num_buffers; i++)
+ intel_copy_bo(batch, dst[i], src[i], width, height);
+ for (i = num_buffers; i--; )
+ intel_copy_bo(batch, dummy, dst[i], width, height);
+ for (i = num_buffers; i--; )
+ cmp_bo(dst[i], 0xabcdabcd, width, height);
+ }
}
+ drmtest_stop_signal_helper();
return 0;
}