Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-24 Thread Ben Widawsky
On 17-07-19 10:34:14, Tvrtko Ursulin wrote: Hi Ben, On 18/07/2017 15:36, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Enables other i915 components to enable and disable the facility as needed. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_engine_cs.c | 53 ++

Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-20 Thread Tvrtko Ursulin
On 19/07/2017 12:04, Chris Wilson wrote: [snip] Long term though having a global static key is going to be a nasty wart. Joonas will definitely ask the question how much will it cost us to use an engine->bool and what we can do to minimise that cost. Why you think it is nasty? Sounds pretty

Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-19 Thread Chris Wilson
Quoting Tvrtko Ursulin (2017-07-19 10:30:13) > > On 18/07/2017 16:22, Chris Wilson wrote: > > Quoting Tvrtko Ursulin (2017-07-18 15:36:16) > >> +u64 intel_engine_get_current_busy_ns(struct intel_engine_cs *engine) > >> +{ > >> + unsigned long flags; > >> + u64 total; > >> + > >> +

Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-19 Thread Tvrtko Ursulin
Hi Ben, On 18/07/2017 15:36, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Enables other i915 components to enable and disable the facility as needed. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_engine_cs.c | 53 + drivers/gpu/drm/i915/intel

Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-19 Thread Tvrtko Ursulin
On 18/07/2017 16:22, Chris Wilson wrote: > Quoting Tvrtko Ursulin (2017-07-18 15:36:16) >> +u64 intel_engine_get_current_busy_ns(struct intel_engine_cs *engine) >> +{ >> + unsigned long flags; >> + u64 total; >> + >> + spin_lock_irqsave(&engine->stats.lock, flags); >> + >> +

Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-18 Thread Chris Wilson
Quoting Tvrtko Ursulin (2017-07-18 15:36:16) > From: Tvrtko Ursulin > > Enables other i915 components to enable and disable > the facility as needed. > > Signed-off-by: Tvrtko Ursulin > --- > drivers/gpu/drm/i915/intel_engine_cs.c | 53 > + > drivers/gpu/drm/i

Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-18 Thread Chris Wilson
Quoting Tvrtko Ursulin (2017-07-18 15:36:16) > +int intel_enable_engine_stats(struct drm_i915_private *dev_priv) > +{ > + if (!i915.enable_execlists) > + return -ENODEV; > + > + mutex_lock(&i915_engine_stats_mutex); > + if (i915_engine_stats_ref++ == 0) { > +

Re: [Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-18 Thread Chris Wilson
Quoting Tvrtko Ursulin (2017-07-18 15:36:16) > +u64 intel_engine_get_current_busy_ns(struct intel_engine_cs *engine) > +{ > + unsigned long flags; > + u64 total; > + > + spin_lock_irqsave(&engine->stats.lock, flags); > + > + total = engine->stats.total; > + > + /* > +

[Intel-gfx] [RFC 12/14] drm/i915: Interface for controling engine stats collection

2017-07-18 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Enables other i915 components to enable and disable the facility as needed. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_engine_cs.c | 53 + drivers/gpu/drm/i915/intel_ringbuffer.h | 5 2 files changed, 58 insertions(+