<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 03/05/18 18:18, Tvrtko Ursulin
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:9f4e64f5-b962-44c6-b1e1-70bddacfd872@linux.intel.com">
      <blockquote type="cite" style="color: #000000;">  +int
        intel_lr_context_set_sseu(struct i915_gem_context *ctx,
        <br>
        +                  struct intel_engine_cs *engine,
        <br>
        +                  struct i915_gem_context_sseu *sseu)
        <br>
        +{
        <br>
        +    struct drm_i915_private *dev_priv = ctx->i915;
        <br>
        +    struct intel_context *ce;
        <br>
        +    enum intel_engine_id id;
        <br>
        +    int ret;
        <br>
        +
        <br>
        +    lockdep_assert_held(&dev_priv->drm.struct_mutex);
        <br>
        +
        <br>
        +    if (memcmp(sseu, &ctx->engine[engine->id].sseu,
        sizeof(*sseu)) == 0)
        <br>
        +        return 0;
        <br>
        +
        <br>
        +    /*
        <br>
        +     * We can only program this on render ring.
        <br>
        +     */
        <br>
        +    ce = &ctx->engine[RCS];
        <br>
        +
        <br>
        +    if (ce->pin_count) { /* Assume that the context is
        active! */
        <br>
        +        ret = i915_gem_switch_to_kernel_context(dev_priv);
        <br>
        +        if (ret)
        <br>
        +            return ret;
        <br>
        +
        <br>
        +        ret = i915_gem_wait_for_idle(dev_priv,
        <br>
        +                         I915_WAIT_INTERRUPTIBLE |
        <br>
        +                         I915_WAIT_LOCKED);
        <br>
      </blockquote>
      <br>
      Could we consider the alternative of only allowing this to be
      configured on context create? That way we would not need to idle
      the GPU every time userspace decides to fiddle with it. It is
      unprivileged so quite an easy way for random app to ruin GPU
      performance for everyone.
      <br>
      <br>
      Regards,
      <br>
      <br>
      Tvrtko
    </blockquote>
    <p><br>
    </p>
    I'm pretty sure Dmitry wants dynamic configurations.<br>
    <br>
    Dmitry?<br>
  </body>
</html>