[Intel-gfx] [PATCH 21/21] drm/i915: Mark up Ironlake ips with rpm wakerefs

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 14 16:57:11 UTC 2019


Quoting Mika Kuoppala (2019-01-14 15:01:59)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> >  unsigned long i915_chipset_val(struct drm_i915_private *dev_priv)
> >  {
> > -     unsigned long val;
> > +     intel_wakeref_t wakeref;
> > +     unsigned long val = 0;
> >  
> >       if (!IS_GEN(dev_priv, 5))
> >               return 0;
> >  
> > -     spin_lock_irq(&mchdev_lock);
> > -
> > -     val = __i915_chipset_val(dev_priv);
> > -
> > -     spin_unlock_irq(&mchdev_lock);
> > +     with_intel_runtime_pm(dev_priv, wakeref) {
> > +             spin_lock_irq(&mchdev_lock);
> 
> This lock is now much more ips lock than mchdev_lock.
> Name should reflect that, so ips_lock?

ips is a user, the mch is the device. The interface is yucky, so best
forget and move on, honestly.

[snip]

> > -     return ret;
> > +     drm_dev_put(&i915->drm);
> 
> mchdev_put() would read better.

Nah. mchdev_get() returns a new reference to the underlying device. From
that moment on, it's just a regular device reference. We are not
operating on the singleton itself.
-Chris


More information about the Intel-gfx mailing list