mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-09 00:46:17 +00:00
tests/gem_gtt_concurrent_blit: convert to subtest infrastructure
Same treatment as for gem_cpu_concurrent_blit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
2a9e128b18
commit
a2778575d5
@ -18,6 +18,7 @@ TESTS_progs_M = \
|
|||||||
gem_cpu_concurrent_blit \
|
gem_cpu_concurrent_blit \
|
||||||
gem_cs_tlb \
|
gem_cs_tlb \
|
||||||
gem_flink \
|
gem_flink \
|
||||||
|
gem_gtt_concurrent_blit \
|
||||||
flip_test \
|
flip_test \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
@ -25,7 +26,6 @@ TESTS_progs = \
|
|||||||
getversion \
|
getversion \
|
||||||
getclient \
|
getclient \
|
||||||
getstats \
|
getstats \
|
||||||
gem_gtt_concurrent_blit \
|
|
||||||
gem_exec_nop \
|
gem_exec_nop \
|
||||||
gem_exec_big \
|
gem_exec_big \
|
||||||
gem_exec_blt \
|
gem_exec_blt \
|
||||||
|
@ -96,11 +96,13 @@ main(int argc, char **argv)
|
|||||||
drm_intel_bufmgr *bufmgr;
|
drm_intel_bufmgr *bufmgr;
|
||||||
struct intel_batchbuffer *batch;
|
struct intel_batchbuffer *batch;
|
||||||
int num_buffers = 128, max;
|
int num_buffers = 128, max;
|
||||||
drm_intel_bo *src[128], *dst[128], *dummy;
|
drm_intel_bo *src[128], *dst[128], *dummy = NULL;
|
||||||
int width = 512, height = 512;
|
int width = 512, height = 512;
|
||||||
int fd;
|
int fd;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
drmtest_subtest_init(argc, argv);
|
||||||
|
|
||||||
fd = drm_open_any();
|
fd = drm_open_any();
|
||||||
|
|
||||||
max = gem_aperture_size (fd) / (1024 * 1024) / 2;
|
max = gem_aperture_size (fd) / (1024 * 1024) / 2;
|
||||||
@ -111,35 +113,45 @@ main(int argc, char **argv)
|
|||||||
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
|
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
|
||||||
batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
|
batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
|
||||||
|
|
||||||
for (i = 0; i < num_buffers; i++) {
|
if (!drmtest_only_list_subtests()) {
|
||||||
src[i] = create_bo(bufmgr, i, width, height);
|
for (i = 0; i < num_buffers; i++) {
|
||||||
dst[i] = create_bo(bufmgr, ~i, width, height);
|
src[i] = create_bo(bufmgr, i, width, height);
|
||||||
|
dst[i] = create_bo(bufmgr, ~i, width, height);
|
||||||
|
}
|
||||||
|
dummy = create_bo(bufmgr, 0, width, height);
|
||||||
}
|
}
|
||||||
dummy = create_bo(bufmgr, 0, width, height);
|
|
||||||
|
|
||||||
/* try to overwrite the source values */
|
/* try to overwrite the source values */
|
||||||
for (i = 0; i < num_buffers; i++)
|
if (drmtest_run_subtest("overwrite-source")) {
|
||||||
intel_copy_bo(batch, dst[i], src[i], width, height);
|
for (i = 0; i < num_buffers; i++)
|
||||||
for (i = num_buffers; i--; )
|
intel_copy_bo(batch, dst[i], src[i], width, height);
|
||||||
set_bo(src[i], 0xdeadbeef, width, height);
|
for (i = num_buffers; i--; )
|
||||||
for (i = 0; i < num_buffers; i++)
|
set_bo(src[i], 0xdeadbeef, width, height);
|
||||||
cmp_bo(dst[i], i, 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 */
|
/* try to read the results before the copy completes */
|
||||||
for (i = 0; i < num_buffers; i++)
|
if (drmtest_run_subtest("early-read")) {
|
||||||
intel_copy_bo(batch, dst[i], src[i], width, height);
|
for (i = num_buffers; i--; )
|
||||||
for (i = num_buffers; i--; )
|
set_bo(src[i], 0xdeadbeef, width, height);
|
||||||
cmp_bo(dst[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 */
|
/* and finally try to trick the kernel into loosing the pending write */
|
||||||
for (i = num_buffers; i--; )
|
if (drmtest_run_subtest("gpu-read-after-write")) {
|
||||||
set_bo(src[i], 0xabcdabcd, width, height);
|
for (i = num_buffers; i--; )
|
||||||
for (i = 0; i < num_buffers; i++)
|
set_bo(src[i], 0xabcdabcd, width, height);
|
||||||
intel_copy_bo(batch, dst[i], src[i], width, height);
|
for (i = 0; i < num_buffers; i++)
|
||||||
for (i = num_buffers; i--; )
|
intel_copy_bo(batch, dst[i], src[i], width, height);
|
||||||
intel_copy_bo(batch, dummy, dst[i], width, height);
|
for (i = num_buffers; i--; )
|
||||||
for (i = num_buffers; i--; )
|
intel_copy_bo(batch, dummy, dst[i], width, height);
|
||||||
cmp_bo(dst[i], 0xabcdabcd, width, height);
|
for (i = num_buffers; i--; )
|
||||||
|
cmp_bo(dst[i], 0xabcdabcd, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user