tests/gem_ringfill: convert to subtest infrastructure

This commit is contained in:
Daniel Vetter 2012-11-28 13:08:20 +01:00
parent 046b149b18
commit ca2851f827
2 changed files with 10 additions and 4 deletions

View File

@ -21,6 +21,7 @@ TESTS_progs_M = \
gem_gtt_concurrent_blit \ gem_gtt_concurrent_blit \
gem_mmap_gtt \ gem_mmap_gtt \
gem_partial_pwrite_pread \ gem_partial_pwrite_pread \
gem_ringfill \
flip_test \ flip_test \
$(NULL) $(NULL)
@ -34,7 +35,6 @@ TESTS_progs = \
gem_exec_bad_domains \ gem_exec_bad_domains \
gem_exec_faulting_reloc \ gem_exec_faulting_reloc \
gem_readwrite \ gem_readwrite \
gem_ringfill \
gem_mmap \ gem_mmap \
gem_mmap_offset_exhaustion \ gem_mmap_offset_exhaustion \
gem_hangcheck_forcewake \ gem_hangcheck_forcewake \

View File

@ -55,6 +55,7 @@ struct bo {
}; };
static const int width = 512, height = 512; static const int width = 512, height = 512;
static bool skipped_all = true;
static void create_bo(drm_intel_bufmgr *bufmgr, static void create_bo(drm_intel_bufmgr *bufmgr,
struct bo *b, struct bo *b,
@ -122,6 +123,7 @@ static int check_ring(drm_intel_bufmgr *bufmgr,
int i; int i;
snprintf(output, 100, "filling %s ring: ", ring); snprintf(output, 100, "filling %s ring: ", ring);
skipped_all = false;
create_bo(bufmgr, &bo, ring); create_bo(bufmgr, &bo, ring);
@ -203,13 +205,16 @@ int main(int argc, char **argv)
render_copyfunc_t copy; render_copyfunc_t copy;
int fd, fails = 0; int fd, fails = 0;
drmtest_subtest_init(argc, argv);
fd = drm_open_any(); fd = drm_open_any();
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
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));
fails += check_ring(bufmgr, batch, "blt", blt_copy); if (drmtest_run_subtest("blitter"))
fails += check_ring(bufmgr, batch, "blt", blt_copy);
/* Strictly only required on architectures with a separate BLT ring, /* Strictly only required on architectures with a separate BLT ring,
* but lets stress everybody. * but lets stress everybody.
@ -221,7 +226,8 @@ int main(int argc, char **argv)
copy = gen3_render_copyfunc; copy = gen3_render_copyfunc;
else if (IS_GEN6(batch->devid)) else if (IS_GEN6(batch->devid))
copy = gen6_render_copyfunc; copy = gen6_render_copyfunc;
if (copy)
if (drmtest_run_subtest("render") && copy)
fails += check_ring(bufmgr, batch, "render", copy); fails += check_ring(bufmgr, batch, "render", copy);
intel_batchbuffer_free(batch); intel_batchbuffer_free(batch);
@ -229,5 +235,5 @@ int main(int argc, char **argv)
close(fd); close(fd);
return fails != 0; return skipped_all ? 77 : fails != 0;
} }