[Intel-gfx] [PATCH i-g-t v6] lib/igt_gt: Allow non-default contexts to hang non-render rings

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 12 23:29:07 UTC 2017


Quoting Vinay Belgaumkar (2017-10-13 00:22:17)
> +static bool has_ctx_exec(int fd, unsigned ring, uint32_t ctx)
> +{
> +       struct drm_i915_gem_execbuffer2 execbuf;
> +       struct drm_i915_gem_exec_object2 exec;
> +
> +       /* silly ABI, the kernel thinks everyone who has BSD also has BSD2 */
> +       if ((ring & ~(3<<13)) == I915_EXEC_BSD) {
> +               if (ring & (3 << 13) && !gem_has_bsd2(fd))
> +                       return false;
> +       }
> +
> +       memset(&exec, 0, sizeof(exec));
> +       memset(&execbuf, 0, sizeof(execbuf));
> +       execbuf.buffers_ptr = to_user_pointer(&exec);
> +       execbuf.buffer_count = 1;
> +       execbuf.flags = ring;
> +       execbuf.rsvd1 = ctx;
> +       /*
> +        * If context submission is not allowed, this will return EINVAL
> +        * Otherwise, this will return ENOENT on account of no gem obj
> +        * being submitted
> +        */
> +       return (__gem_execbuf(fd, &execbuf) == -ENOENT);

Is return (a function)? Brackets shouldn't be used to confused the
unsuspecting reader. ;)
-Chris


More information about the Intel-gfx mailing list