[Intel-gfx] [PATCH] tests/gem_exec_params: check invalid flags for Resource Streamer
Daniel Vetter
daniel at ffwll.ch
Tue May 19 02:40:23 PDT 2015
On Tue, May 19, 2015 at 11:30:44AM +0300, Abdiel Janulgue wrote:
> Make sure resource streamer flags works only in correct ring in
> addition to checking next flag after the RS boundary fails.
>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
> ---
> tests/gem_exec_params.c | 21 ++++++++++++++++++++-
> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
> index 54f0dc3..08ee330 100644
> --- a/tests/gem_exec_params.c
> +++ b/tests/gem_exec_params.c
> @@ -48,6 +48,7 @@
> #define LOCAL_I915_EXEC_BSD_MASK (3<<13)
> #define LOCAL_I915_EXEC_BSD_RING1 (1<<13)
> #define LOCAL_I915_EXEC_BSD_RING2 (2<<13)
> +#define LOCAL_I915_EXEC_RESOURCE_STREAMER (1<<16)
>
> struct drm_i915_gem_execbuffer2 execbuf;
> struct drm_i915_gem_exec_object2 gem_exec[1];
> @@ -220,7 +221,7 @@ igt_main
> /* HANDLE_LUT and NO_RELOC are already exercised by gem_exec_lut_handle */
>
> igt_subtest("invalid-flag") {
> - execbuf.flags = I915_EXEC_RENDER | (I915_EXEC_HANDLE_LUT << 1);
> + execbuf.flags = I915_EXEC_RENDER | (LOCAL_I915_EXEC_RESOURCE_STREAMER << 1);
> RUN_FAIL(EINVAL);
> }
>
> @@ -234,6 +235,24 @@ 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-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);
> + }
Please also add some checks to make sure we reject RS on pre-hsw on the
render ring. lgtm otherwise.
Cheers, Daniel
> +
> #define DIRT(name) \
> igt_subtest(#name "-dirt") { \
> execbuf.flags = 0; \
> --
> 1.9.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list