[Intel-gfx] [RFC 3/4] drm/i915/perf: handle interrupts from the OA unit

Chris Wilson chris at chris-wilson.co.uk
Wed Dec 19 18:26:22 UTC 2018


Quoting Lionel Landwerlin (2018-12-19 18:03:26)
> On 19/12/2018 16:19, Chris Wilson wrote:
> > Quoting Lionel Landwerlin (2018-12-19 14:37:46)
> >>   static void free_oa_config(struct drm_i915_private *dev_priv,
> >> @@ -1852,6 +1854,13 @@ static void gen7_oa_enable(struct i915_perf_stream *stream)
> >>           */
> >>          gen7_init_oa_buffer(dev_priv);
> >>   
> >> +       if (stream->oa_interrupt_monitor) {
> >> +               spin_lock(&dev_priv->irq_lock);
> > Doesn't look like you are already in interrupt context, so spin_lock_irq()
> > required for dev_priv->irq_lock.
> > -Chris
> >
> Thanks a lot Chris, will fix.
> Any comment on the atomic counter? Does that look like a bad design/idea?

It's not illogical, but conceivably you don't need one at all. You just
use the wakeup from the interrupt as a kick to check buffer status, that
should be cheap enough to not worry about short-circuiting the half-full
interrupt check (and even if we do wakeup twice within the same
half-full period, there may be a few results to move along). Without
adding a hrtimer, there should not be many spurious wakeups to soak up
the cpu.
-Chris


More information about the Intel-gfx mailing list