[PATCH 21/24] drm/i915: unify PM interrupt preinstall sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 28, 2013 at 10:26:37AM -0700, Ben Widawsky wrote:
> On Wed, Jun 12, 2013 at 01:37:23PM +0200, Daniel Vetter wrote:
> > Since the addition of VECS we have a slightly different enable
> > sequence for PM interrupts on ivb/hsw vs snb and vlv. Usually that
> > will end up in hard to track down surprises.
> > 
> > Hence unifiy things and since we have copies of this code in 3 places
> > now, extract it into its own little helper.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > ---
> >  drivers/gpu/drm/i915/i915_irq.c | 40 +++++++++++++++++-----------------------
> >  1 file changed, 17 insertions(+), 23 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index b680e1c..954d8f8 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -2486,17 +2486,9 @@ static void ibx_irq_preinstall(struct drm_device *dev)
> >  	POSTING_READ(SDEIER);
> >  }
> >  
> > -/* drm_dma.h hooks
> > -*/
> > -static void ironlake_irq_preinstall(struct drm_device *dev)
> > +static void gen5_gt_irq_preinstall(struct drm_device *dev)
> >  {
> > -	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
> > -
> > -	atomic_set(&dev_priv->irq_received, 0);
> > -
> > -	I915_WRITE(HWSTAM, 0xeffe);
> > -
> > -	/* XXX hotplug from PCH */
> > +	struct drm_i915_private *dev_priv = dev->dev_private;
> >  
> >  	I915_WRITE(DEIMR, 0xffffffff);
> >  	I915_WRITE(DEIER, 0x0);
> > @@ -2506,6 +2498,19 @@ static void ironlake_irq_preinstall(struct drm_device *dev)
> >  	I915_WRITE(GTIMR, 0xffffffff);
> >  	I915_WRITE(GTIER, 0x0);
> >  	POSTING_READ(GTIER);
> > +}
> > +
> > +/* drm_dma.h hooks
> > +*/
> > +static void ironlake_irq_preinstall(struct drm_device *dev)
> > +{
> > +	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
> > +
> > +	atomic_set(&dev_priv->irq_received, 0);
> > +
> > +	I915_WRITE(HWSTAM, 0xeffe);
> > +
> > +	gen5_gt_irq_preinstall(dev);
> >  
> >  	ibx_irq_preinstall(dev);
> >  }
> > @@ -2524,15 +2529,7 @@ static void ivybridge_irq_preinstall(struct drm_device *dev)
> >  	I915_WRITE(DEIER, 0x0);
> >  	POSTING_READ(DEIER);
> >  
> > -	/* and GT */
> > -	I915_WRITE(GTIMR, 0xffffffff);
> > -	I915_WRITE(GTIER, 0x0);
> > -	POSTING_READ(GTIER);
> > -
> > -	/* Power management */
> > -	I915_WRITE(GEN6_PMIMR, 0xffffffff);
> > -	I915_WRITE(GEN6_PMIER, 0x0);
> > -	POSTING_READ(GEN6_PMIER);
> > +	gen5_gt_irq_preinstall(dev);
> >  
> >  	ibx_irq_preinstall(dev);
> 
> I lost what happened to

Have been lost, thanks for spotting this.
-Daniel

> > -     I915_WRITE(GEN6_PMIMR, 0xffffffff);
> > -     I915_WRITE(GEN6_PMIER, 0x0);
> > -     POSTING_READ(GEN6_PMIER);
> 
> 
> >  }
> > @@ -2551,10 +2548,7 @@ static void valleyview_irq_preinstall(struct drm_device *dev)
> >  	I915_WRITE(RING_IMR(GEN6_BSD_RING_BASE), 0);
> >  	I915_WRITE(RING_IMR(BLT_RING_BASE), 0);
> >  
> > -	/* and GT */
> > -	I915_WRITE(GTIMR, 0xffffffff);
> > -	I915_WRITE(GTIER, 0x0);
> > -	POSTING_READ(GTIER);
> > +	gen5_gt_irq_preinstall(dev);
> >  
> >  	I915_WRITE(DPINVGTT, 0xff);
> >  
> > -- 
> > 1.8.1.4
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ben Widawsky, Intel Open Source Technology Center

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux