[Intel-gfx] [PATCH 2/6] drm/i915: Allow clients to query own per-engine busyness

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 19 21:08:21 UTC 2018


Quoting Tvrtko Ursulin (2018-01-19 13:45:24)
> +       case I915_CONTEXT_GET_ENGINE_BUSY:
> +               engine = intel_engine_lookup_user(i915, args->class,
> +                                                 args->instance);
> +               if (!engine) {
> +                       ret = -EINVAL;
> +                       break;
> +               }
> +
> +               ce = &ctx->engine[engine->id];
> +               if (!READ_ONCE(ce->stats.enabled)) {
> +                       ret = i915_mutex_lock_interruptible(dev);
> +                       if (!ret)
> +                               break;
> +
> +                       if (!ce->stats.enabled) {
> +                               ret = intel_enable_engine_stats(engine);

* Blink.

This caught me by surprise. (Other than struct_mutex) Not too offensive,
but surprising. At the very least call out to a function to handle the
request. Where did args->class, args->instance come from? You surely
didn't extend the ioctl struct just for that?
-Chris


More information about the Intel-gfx mailing list