diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2017-12-08 15:37:25 +0000 |
---|---|---|
committer | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2017-12-08 17:22:46 +0000 |
commit | 1d31c2c53f048e9469589390dfa0a88d4cfd266d (patch) | |
tree | 1c5de3fd34caaf25e3cdab3087de74c3e96bb1da /tests/perf.c | |
parent | 4dce16890fd3c9894f8b855a85fd169bf7faead2 (diff) |
tests/perf: skip config tests on older kernels
We mostly run tests on the most recent kernels but those are failing
on < 4.14.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/perf.c')
-rw-r--r-- | tests/perf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/perf.c b/tests/perf.c index 969b8c74..a173680c 100644 --- a/tests/perf.c +++ b/tests/perf.c @@ -3964,6 +3964,17 @@ static void i915_perf_remove_config(int fd, uint64_t config_id) &config_id), 0); } +static bool has_i915_perf_userspace_config(int fd) +{ + uint64_t config = 0; + int ret = igt_ioctl(fd, DRM_IOCTL_I915_PERF_REMOVE_CONFIG, &config); + igt_assert_eq(ret, -1); + + igt_debug("errno=%i\n", errno); + + return errno != EINVAL; +} + static void test_invalid_create_userspace_config(void) { @@ -3973,6 +3984,8 @@ test_invalid_create_userspace_config(void) uint32_t mux_regs[] = { 0x9888 /* NOA_WRITE */, 0x0 }; uint32_t invalid_mux_regs[] = { 0x12345678 /* invalid register */, 0x0 }; + igt_require(has_i915_perf_userspace_config(drm_fd)); + memset(&config, 0, sizeof(config)); /* invalid uuid */ @@ -4032,6 +4045,8 @@ test_invalid_remove_userspace_config(void) uint64_t config_id, wrong_config_id = 999999999; char path[512]; + igt_require(has_i915_perf_userspace_config(drm_fd)); + snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); /* Destroy previous configuration if present */ @@ -4090,6 +4105,8 @@ test_create_destroy_userspace_config(void) }; char path[512]; + igt_require(has_i915_perf_userspace_config(drm_fd)); + snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); /* Destroy previous configuration if present */ @@ -4170,6 +4187,8 @@ test_whitelisted_registers_userspace_config(void) 0xe65c }; + igt_require(has_i915_perf_userspace_config(drm_fd)); + snprintf(path, sizeof(path), "/sys/class/drm/card%d/metrics/%s/id", card, uuid); if (try_read_u64_file(path, &config_id)) |