diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-12 11:03:29 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-12 11:17:58 +0200 |
commit | 7847ea2965e548f7f68c6d7a88499bdb255a697f (patch) | |
tree | ab57251355f10ec894647eb4bb258b87e152928f /tests | |
parent | 7553ad6e10f76aa703359a10e08138e14501d54d (diff) |
tests: use drmtest_skip to check for rings
To simplify things add a set of gem_check_<ring> functions which take
care of this. Since I've opted for static inlines drmtest.h grew a few
more header includes which was a neat opportunity to dump a few redundant
#defines.
This kills all the skipped_all hand-rolled logic we have.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gem_bad_length.c | 2 | ||||
-rw-r--r-- | tests/gem_cs_tlb.c | 12 | ||||
-rw-r--r-- | tests/gem_ctx_bad_exec.c | 1 | ||||
-rw-r--r-- | tests/gem_ctx_exec.c | 1 | ||||
-rw-r--r-- | tests/gem_dummy_reloc_loop.c | 8 | ||||
-rw-r--r-- | tests/gem_exec_big.c | 1 | ||||
-rw-r--r-- | tests/gem_exec_lut_handle.c | 1 | ||||
-rw-r--r-- | tests/gem_exec_nop.c | 13 | ||||
-rw-r--r-- | tests/gem_lut_handle.c | 1 | ||||
-rw-r--r-- | tests/gem_pwrite.c | 1 | ||||
-rw-r--r-- | tests/gem_write_read_ring_switch.c | 6 | ||||
-rw-r--r-- | tests/prime_self_import.c | 2 | ||||
-rw-r--r-- | tests/testdisplay.c | 2 |
13 files changed, 15 insertions, 36 deletions
diff --git a/tests/gem_bad_length.c b/tests/gem_bad_length.c index bb8b6b86..2d5f977a 100644 --- a/tests/gem_bad_length.c +++ b/tests/gem_bad_length.c @@ -40,8 +40,6 @@ #include "i915_drm.h" #include "drmtest.h" -#define MI_BATCH_BUFFER_END (0xA<<23) - /* * Testcase: Minmal bo_create and batchbuffer exec * diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c index 081b6f24..0378fdb9 100644 --- a/tests/gem_cs_tlb.c +++ b/tests/gem_cs_tlb.c @@ -55,7 +55,6 @@ #define LOCAL_I915_EXEC_VEBOX (4<<0) #define BATCH_SIZE (1024*1024) -bool skipped_all = true; static int exec(int fd, uint32_t handle, int split, uint64_t *gtt_ofs, unsigned ring_id) @@ -104,7 +103,6 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name) int i; sprintf(buf, "testing %s cs tlb coherency: ", ring_name); - skipped_all = false; /* Shut up gcc, too stupid. */ batch_ptr_old = NULL; @@ -149,13 +147,11 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name) int main(int argc, char **argv) { int fd; - uint32_t devid; drmtest_subtest_init(argc, argv); drmtest_skip_on_simulation(); fd = drm_open_any(); - devid = intel_get_drm_devid(fd); if (!drmtest_only_list_subtests()) { /* This test is very sensitive to residual gtt_mm noise from previous @@ -168,18 +164,18 @@ int main(int argc, char **argv) run_on_ring(fd, I915_EXEC_RENDER, "render"); drmtest_subtest_block("bsd") - if (HAS_BSD_RING(devid)) + if (gem_check_bsd(fd)) run_on_ring(fd, I915_EXEC_BSD, "bsd"); drmtest_subtest_block("blt") - if (HAS_BLT_RING(devid)) + if (gem_check_blt(fd)) run_on_ring(fd, I915_EXEC_BLT, "blt"); drmtest_subtest_block("vebox") - if (gem_has_vebox(fd)) + if (gem_check_vebox(fd)) run_on_ring(fd, LOCAL_I915_EXEC_VEBOX, "vebox"); close(fd); - return skipped_all ? 77 : 0; + return drmtest_retval(); } diff --git a/tests/gem_ctx_bad_exec.c b/tests/gem_ctx_bad_exec.c index f6463aca..b7e5db03 100644 --- a/tests/gem_ctx_bad_exec.c +++ b/tests/gem_ctx_bad_exec.c @@ -104,7 +104,6 @@ static int exec(int fd, uint32_t handle, int ring, int ctx_id) return ret; } -#define MI_BATCH_BUFFER_END (0xA<<23) int main(int argc, char *argv[]) { uint32_t handle; diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c index 84681103..3a5fec5f 100644 --- a/tests/gem_ctx_exec.c +++ b/tests/gem_ctx_exec.c @@ -115,7 +115,6 @@ static int exec(int fd, uint32_t handle, int ring, int ctx_id) return ret; } -#define MI_BATCH_BUFFER_END (0xA<<23) int main(int argc, char *argv[]) { uint32_t handle; diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c index 7cffbbea..2d0a2450 100644 --- a/tests/gem_dummy_reloc_loop.c +++ b/tests/gem_dummy_reloc_loop.c @@ -167,7 +167,7 @@ int main(int argc, char **argv) } drmtest_subtest_block("bsd") { - if (HAS_BSD_RING(devid)) { + if (gem_check_bsd(fd)) { sleep(2); printf("running dummy loop on bsd\n"); dummy_reloc_loop(I915_EXEC_BSD); @@ -176,7 +176,7 @@ int main(int argc, char **argv) } drmtest_subtest_block("blt") { - if (HAS_BLT_RING(devid)) { + if (gem_check_blt(fd)) { sleep(2); printf("running dummy loop on blt\n"); dummy_reloc_loop(I915_EXEC_BLT); @@ -185,7 +185,7 @@ int main(int argc, char **argv) } drmtest_subtest_block("vebox") { - if (gem_has_vebox(fd)) { + if (gem_check_vebox(fd)) { sleep(2); printf("running dummy loop on vebox\n"); dummy_reloc_loop(LOCAL_I915_EXEC_VEBOX); @@ -208,5 +208,5 @@ int main(int argc, char **argv) close(fd); - return 0; + return drmtest_retval(); } diff --git a/tests/gem_exec_big.c b/tests/gem_exec_big.c index 9dddfac5..b67aba15 100644 --- a/tests/gem_exec_big.c +++ b/tests/gem_exec_big.c @@ -49,7 +49,6 @@ #include "i915_drm.h" #include "drmtest.h" -#define MI_BATCH_BUFFER_END (0xA<<23) #define BATCH_SIZE (1024*1024) static int exec(int fd, uint32_t handle, uint32_t reloc_ofs) diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c index 54ed3ddc..8ea889aa 100644 --- a/tests/gem_exec_lut_handle.c +++ b/tests/gem_exec_lut_handle.c @@ -40,7 +40,6 @@ #include "i915_drm.h" #include "drmtest.h" -#define MI_BATCH_BUFFER_END (0xA<<23) #define BATCH_SIZE (1024*1024) #define LOCAL_I915_EXEC_NO_RELOC (1<<11) diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c index ca1f5809..688da21e 100644 --- a/tests/gem_exec_nop.c +++ b/tests/gem_exec_nop.c @@ -44,7 +44,6 @@ #include "intel_gpu_tools.h" #define LOCAL_I915_EXEC_VEBOX (4<<0) -bool skipped_all = true; static double elapsed(const struct timeval *start, const struct timeval *end, @@ -94,8 +93,6 @@ static void loop(int fd, uint32_t handle, unsigned ring_id, const char *ring_nam { int count; - skipped_all = false; - for (count = 1; count <= SLOW_QUICK(1<<17, 1<<4); count <<= 1) { struct timeval start, end; @@ -113,13 +110,11 @@ int main(int argc, char **argv) { uint32_t batch[2] = {MI_BATCH_BUFFER_END}; uint32_t handle; - uint32_t devid; int fd; drmtest_subtest_init(argc, argv); fd = drm_open_any(); - devid = intel_get_drm_devid(fd); handle = gem_create(fd, 4096); gem_write(fd, handle, 0, batch, sizeof(batch)); @@ -128,20 +123,20 @@ int main(int argc, char **argv) loop(fd, handle, I915_EXEC_RENDER, "render"); drmtest_subtest_block("bsd") - if (HAS_BSD_RING(devid)) + if (gem_check_blt(fd)) loop(fd, handle, I915_EXEC_BSD, "bsd"); drmtest_subtest_block("blt") - if (HAS_BLT_RING(devid)) + if (gem_check_blt(fd)) loop(fd, handle, I915_EXEC_BLT, "blt"); drmtest_subtest_block("vebox") - if (gem_has_vebox(fd)) + if (gem_check_vebox(fd)) loop(fd, handle, LOCAL_I915_EXEC_VEBOX, "vebox"); gem_close(fd, handle); close(fd); - return skipped_all ? 77 : 0; + return drmtest_retval(); } diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c index f3e57341..1b7974b5 100644 --- a/tests/gem_lut_handle.c +++ b/tests/gem_lut_handle.c @@ -40,7 +40,6 @@ #include "i915_drm.h" #include "drmtest.h" -#define MI_BATCH_BUFFER_END (0xA<<23) #define BATCH_SIZE (1024*1024) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) diff --git a/tests/gem_pwrite.c b/tests/gem_pwrite.c index bceba28e..64da9ed4 100644 --- a/tests/gem_pwrite.c +++ b/tests/gem_pwrite.c @@ -49,7 +49,6 @@ #define BLT_WRITE_RGB (1<<20) #define BLT_SRC_TILED (1<<15) #define BLT_DST_TILED (1<<11) -#define MI_BATCH_BUFFER_END (0xA<<23) static void do_gem_write(int fd, uint32_t handle, void *buf, int len, int loops) { diff --git a/tests/gem_write_read_ring_switch.c b/tests/gem_write_read_ring_switch.c index 211b5300..bd50520c 100644 --- a/tests/gem_write_read_ring_switch.c +++ b/tests/gem_write_read_ring_switch.c @@ -151,11 +151,11 @@ static int has_ring(int ring) { switch (ring) { case I915_EXEC_RENDER: /* test only makes sense with separate blitter */ - return HAS_BLT_RING(intel_get_drm_devid(fd)); + return gem_check_blt(fd); case I915_EXEC_BSD: - return HAS_BSD_RING(intel_get_drm_devid(fd)); + return gem_check_bsd(fd); case LOCAL_I915_EXEC_VEBOX: - return gem_has_vebox(fd); + return gem_check_vebox(fd); default: return 0; } diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c index 1bd0bb50..8b0a1980 100644 --- a/tests/prime_self_import.c +++ b/tests/prime_self_import.c @@ -51,8 +51,6 @@ #define BO_SIZE (16*1024) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - static char counter; volatile int pls_die = 0; diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 3781612e..06dd0e3e 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -86,8 +86,6 @@ int plane_width, plane_height; static const uint32_t SPRITE_COLOR_KEY = 0x00aaaaaa; uint32_t *fb_ptr; -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - /* * Mode setting with the kernel interfaces is a bit of a chore. * First you have to find the connector in question and make sure the |