diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-07-31 16:53:06 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2018-08-01 22:02:20 -0700 |
commit | 7e908c13f380c34b16b9bfae28cd39a7295e237f (patch) | |
tree | 3bf0ac35f3abba1fc3353486fa267bfb828d2ce7 | |
parent | 263ca16e4d8909f475d32a28fc0e5972bac214fb (diff) |
Follow kernel's resource streamer removal
Resource streamer is being removed from all GENs, so rewrite the tests
so to loop over all engines and set the expected return in case the platform has
resource streamer. This makes it compatible with both old and new
kernels (thanks Chris).
v2: let one test per ring rather than just one test
v3: check what the kernel returns for
I915_HAS_RESOURCE_STREAMER to decide what we expect as return value
from the the batch submission (suggested by Chris)
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r-- | tests/gem_exec_params.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c index 04c21c05..49c56a8d 100644 --- a/tests/gem_exec_params.c +++ b/tests/gem_exec_params.c @@ -87,6 +87,17 @@ static bool has_exec_batch_first(int fd) return val > 0; } +static bool has_resource_streamer(int fd) +{ + int val = -1; + struct drm_i915_getparam gp = { + .param = I915_PARAM_HAS_RESOURCE_STREAMER, + .value = &val, + }; + ioctl(fd, DRM_IOCTL_I915_GETPARAM , &gp); + return val > 0; +} + static void test_batch_first(int fd) { const int gen = intel_gen(intel_get_drm_devid(fd)); @@ -374,28 +385,18 @@ igt_main execbuf.num_cliprects = 0; } - igt_subtest("rs-invalid-on-bsd-ring") { - igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8); - execbuf.flags = I915_EXEC_BSD | LOCAL_I915_EXEC_RESOURCE_STREAMER; - RUN_FAIL(EINVAL); - } - - igt_subtest("rs-invalid-on-blt-ring") { - igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8); - execbuf.flags = I915_EXEC_BLT | LOCAL_I915_EXEC_RESOURCE_STREAMER; - RUN_FAIL(EINVAL); - } + igt_subtest("rs-invalid") { + bool has_rs = has_resource_streamer(fd); + unsigned int engine; - igt_subtest("rs-invalid-on-vebox-ring") { - igt_require(IS_HASWELL(devid) || intel_gen(devid) >= 8); - execbuf.flags = I915_EXEC_VEBOX | LOCAL_I915_EXEC_RESOURCE_STREAMER; - RUN_FAIL(EINVAL); - } + for_each_engine(fd, engine) { + int expect = -EINVAL; + if (has_rs && (engine == 0 || engine == I915_EXEC_RENDER)) + expect = 0; - igt_subtest("rs-invalid-gen") { - igt_require(!IS_HASWELL(devid) && intel_gen(devid) < 8); - execbuf.flags = I915_EXEC_RENDER | LOCAL_I915_EXEC_RESOURCE_STREAMER; - RUN_FAIL(EINVAL); + execbuf.flags = engine | LOCAL_I915_EXEC_RESOURCE_STREAMER; + igt_assert_eq(__gem_execbuf(fd, &execbuf), expect); + } } igt_subtest("invalid-fence-in") { |