diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2016-12-14 15:39:40 +0000 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2017-01-30 15:08:52 +0000 |
commit | 92b5ed31ce763f90dfdf6bf26d02642ea573799f (patch) | |
tree | 6cc1fcf0126b90024980474fdc834ffaf4824880 | |
parent | ba237f97c9632234b4f161c1bbca8a26477b06eb (diff) |
gem_exec_params: Tests for engine features
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
-rw-r--r-- | tests/gem_exec_params.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c index f9a20541..98b77a80 100644 --- a/tests/gem_exec_params.c +++ b/tests/gem_exec_params.c @@ -45,6 +45,9 @@ #define LOCAL_I915_EXEC_BSD_RING1 (1<<13) #define LOCAL_I915_EXEC_BSD_RING2 (2<<13) #define LOCAL_I915_EXEC_RESOURCE_STREAMER (1<<15) +#define LOCAL_I915_EXEC_ENGINE_CAP_SHIFT (18) +#define LOCAL_I915_EXEC_ENGINE_CAP_MASK (15 << LOCAL_I915_EXEC_ENGINE_CAP_SHIFT) +#define LOCAL_I915_EXEC_NEED_BSD_HEVC (1 << LOCAL_I915_EXEC_ENGINE_CAP_SHIFT) static bool has_ring(int fd, unsigned ring_exec_flags) { @@ -241,11 +244,27 @@ igt_main /* HANDLE_LUT and NO_RELOC are already exercised by gem_exec_lut_handle */ + igt_subtest("bsd2-no-hevc") { + igt_require(gem_has_bsd2(fd)); + execbuf.flags = I915_EXEC_BSD | LOCAL_I915_EXEC_NEED_BSD_HEVC; + RUN_FAIL(EINVAL); + } + + igt_subtest("invalid-engine-feature") { + execbuf.flags = LOCAL_I915_EXEC_NEED_BSD_HEVC << 1; + RUN_FAIL(EINVAL); + } + + igt_subtest("invalid-engine-features") { + execbuf.flags = LOCAL_I915_EXEC_ENGINE_CAP_MASK; + RUN_FAIL(EINVAL); + } + igt_subtest("invalid-flag") { /* NOTE: This test intentionally exercise the next available * flag. Don't "fix" this testcase without adding the required * tests for the new flag first. */ - execbuf.flags = I915_EXEC_RENDER | (LOCAL_I915_EXEC_RESOURCE_STREAMER << 1); + execbuf.flags = I915_EXEC_RENDER | ((1 << 21) << 1); RUN_FAIL(EINVAL); } |