[Intel-gfx] [PATCH 5/7] drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only)

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 14 13:33:12 UTC 2018


Quoting Tvrtko Ursulin (2018-12-14 12:34:47)
> +static int get_sseu(struct i915_gem_context *ctx,
> +                   struct drm_i915_gem_context_param *args)
> +{
> +       struct drm_i915_gem_context_param_sseu user_sseu;
> +       struct intel_engine_cs *engine;
> +       struct intel_context *ce;
> +       int ret;
> +
> +       if (args->size == 0)
> +               goto out;
> +       else if (args->size < sizeof(user_sseu))
> +               return -EINVAL;
> +
> +       if (copy_from_user(&user_sseu, u64_to_user_ptr(args->value),
> +                          sizeof(user_sseu)))
> +               return -EFAULT;
> +
> +       if (user_sseu.rsvd1 || user_sseu.rsvd2)
> +               return -EINVAL;

I'd vote for s/rsvd2/flags/ straight away as already I can suggest we
allow for USE_CTX_ENGINE to swap class/instance for engine-id so that we
can set rpcs for, and not least, a virtual engine.

> +
> +       engine = intel_engine_lookup_user(ctx->i915,
> +                                         user_sseu.class,
> +                                         user_sseu.instance);
> +       if (!engine)
> +               return -EINVAL;
-Chris


More information about the Intel-gfx mailing list