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 /lib | |
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 'lib')
-rw-r--r-- | lib/drmtest.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lib/drmtest.h b/lib/drmtest.h index 624abb2db..b6874117e 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -37,6 +37,8 @@ #include "xf86drm.h" #include "xf86drmMode.h" #include "intel_batchbuffer.h" +#include "intel_chipset.h" +#include "intel_gpu_tools.h" drm_intel_bo * gem_handle_to_libdrm_bo(drm_intel_bufmgr *bufmgr, int fd, const char *name, uint32_t handle); @@ -54,7 +56,7 @@ bool gem_has_bsd(int fd); bool gem_has_blt(int fd); bool gem_has_vebox(int fd); int gem_get_num_rings(int fd); -void gem_check_caching(int fd); + void gem_set_caching(int fd, uint32_t handle, int caching); uint32_t gem_get_caching(int fd, uint32_t handle); uint32_t gem_flink(int fd, uint32_t handle); @@ -106,6 +108,35 @@ void drmtest_success(void); void drmtest_fail(int exitcode) __attribute__((noreturn)); int drmtest_retval(void); +/* check functions which auto-skip tests by calling drmtest_skip() */ +void gem_check_caching(int fd); +static inline bool gem_check_vebox(int fd) +{ + if (gem_has_vebox(fd)) + return true; + + drmtest_skip(); + return false; +} + +static inline bool gem_check_bsd(int fd) +{ + if (HAS_BSD_RING(intel_get_drm_devid(fd))) + return true; + + drmtest_skip(); + return false; +} + +static inline bool gem_check_blt(int fd) +{ + if (HAS_BLT_RING(intel_get_drm_devid(fd))) + return true; + + drmtest_skip(); + return false; +} + /* helpers to automatically reduce test runtime in simulation */ bool drmtest_run_in_simulation(void); #define SLOW_QUICK(slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow)) |