public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: unify PM interrupt preinstall sequence
Date: Wed, 10 Jul 2013 22:21:19 +0200	[thread overview]
Message-ID: <20130710202119.GJ6143@phenom.ffwll.local> (raw)
In-Reply-To: <CA+gsUGRBxwvfU_RNxGreFcHDf7o8X+X4WQGm77cnm3b34dJG2Q@mail.gmail.com>

On Wed, Jul 10, 2013 at 05:05:07PM -0300, Paulo Zanoni wrote:
> 2013/7/9 Daniel Vetter <daniel.vetter@ffwll.ch>:
> > 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.
> >
> > v3: Rebase on top of the retained double-GTIIR clearing. Also
> > resurrect the masking/disabling of the gen6+ PM interrupts as spotted
> > by Ben Widaswky.
> >
> > v4: Move the DE interrupt reset code out of gen5_gt_irq_preinstall
> > back to ironlake_irq_preinstall where it really belongs. Spotted by
> > Paulo.
> >
> > Cc: Paulo Zanoni <przanoni@gmail.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/i915/i915_irq.c | 39 +++++++++++++++++++++------------------
> >  1 file changed, 21 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index cf1a21a..d5c3bef 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -2583,6 +2583,23 @@ static void ibx_irq_preinstall(struct drm_device *dev)
> >         POSTING_READ(SDEIER);
> >  }
> >
> > +static void gen5_gt_irq_preinstall(struct drm_device *dev)
> > +{
> > +       struct drm_i915_private *dev_priv = dev->dev_private;
> > +
> > +       /* and GT */
> > +       I915_WRITE(GTIMR, 0xffffffff);
> > +       I915_WRITE(GTIER, 0x0);
> > +       POSTING_READ(GTIER);
> > +
> > +       if (INTEL_INFO(dev)->gen >= 6) {
> > +               /* and GT */
> 
> This comment should be /* Power management */, but it's completely
> useless, so you could kill it and also the /* and GT */ above.

Oh, I tend to ignore old comments freely if the contradict reality. I'll
update the patch and rip the all out (there's also similarly misleading
comments in the upper-level preinstall functions).

> > +               I915_WRITE(GEN6_PMIMR, 0xffffffff);
> > +               I915_WRITE(GEN6_PMIER, 0x0);
> > +               POSTING_READ(GEN6_PMIER);
> > +       }
> > +}
> > +
> >  /* drm_dma.h hooks
> >  */
> >  static void ironlake_irq_preinstall(struct drm_device *dev)
> > @@ -2593,16 +2610,11 @@ static void ironlake_irq_preinstall(struct drm_device *dev)
> >
> >         I915_WRITE(HWSTAM, 0xeffe);
> >
> > -       /* XXX hotplug from PCH */
> > -
> >         I915_WRITE(DEIMR, 0xffffffff);
> >         I915_WRITE(DEIER, 0x0);
> >         POSTING_READ(DEIER);
> >
> > -       /* and GT */
> > -       I915_WRITE(GTIMR, 0xffffffff);
> > -       I915_WRITE(GTIER, 0x0);
> > -       POSTING_READ(GTIER);
> > +       gen5_gt_irq_preinstall(dev);
> 
> With this, we're now initializing GEN6_PM* on SandyBridge since it
> uses ironlake_irq_preinstall. That sounds like a good thing. We could
> either mention this in the commit message or do it in a separate
> patch.
> 
> 
> >
> >         ibx_irq_preinstall(dev);
> >  }
> > @@ -2621,15 +2633,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);
> >  }
> > @@ -2650,9 +2654,8 @@ static void valleyview_irq_preinstall(struct drm_device *dev)
> >         /* and GT */
> >         I915_WRITE(GTIIR, I915_READ(GTIIR));
> >         I915_WRITE(GTIIR, I915_READ(GTIIR));
> > -       I915_WRITE(GTIMR, 0xffffffff);
> > -       I915_WRITE(GTIER, 0x0);
> > -       POSTING_READ(GTIER);
> > +
> > +       gen5_gt_irq_preinstall(dev);
> 
> Valleyview is Gen 7, right? So now we're also initializing GEN6_PMI*
> on it. So same comments from SNB apply here. Maybe you should change
> the commit title to "Initialize the PM interrupts on SNB and VLV".

Hm, that's actually the change I wanted to do to. Note that on SNB/VLV we
already initialize those interrupts in the gen6_enable_rps/vlv_enable_rps
functions. But unifying things completely takes a bit more than just one
patch.

Do you have a proposal for an improved commit message? I kinda run low on
ideas atm ..

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

  reply	other threads:[~2013-07-10 20:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04 21:35 [PATCH 00/14] irq locking review v2 Daniel Vetter
2013-07-04 21:35 ` [PATCH 01/14] drm/i915: extract ibx_display_interrupt_update Daniel Vetter
2013-07-08 14:38   ` Paulo Zanoni
2013-07-09 15:21     ` Daniel Vetter
2013-07-04 21:35 ` [PATCH 02/14] drm/i915: improve SERR_INT clearing for fifo underrun reporting Daniel Vetter
2013-07-08 16:46   ` Paulo Zanoni
2013-07-09 20:58     ` [PATCH] " Daniel Vetter
2013-07-09 22:26       ` Paulo Zanoni
2013-07-10  6:30         ` Daniel Vetter
2013-07-10 19:45           ` Paulo Zanoni
2013-07-04 21:35 ` [PATCH 03/14] drm/i915: improve GEN7_ERR_INT " Daniel Vetter
2013-07-09 20:59   ` [PATCH] " Daniel Vetter
2013-07-10 19:47     ` Paulo Zanoni
2013-07-10 20:22       ` Daniel Vetter
2013-07-04 21:35 ` [PATCH 04/14] drm/i915: kill lpt pch transcoder->crtc mapping code for fifo underruns Daniel Vetter
2013-07-08 16:54   ` Paulo Zanoni
2013-07-04 21:35 ` [PATCH 05/14] drm/i915: irq handlers don't need interrupt-safe spinlocks Daniel Vetter
2013-07-04 21:35 ` [PATCH 06/14] drm/i915: streamline hsw_pm_irq_handler Daniel Vetter
2013-07-04 21:35 ` [PATCH 07/14] drm/i915: queue work outside spinlock in hsw_pm_irq_handler Daniel Vetter
2013-07-04 21:35 ` [PATCH 08/14] drm/i915: kill dev_priv->rps.lock Daniel Vetter
2013-07-04 21:35 ` [PATCH 09/14] drm/i915: unify ring irq refcounts (again) Daniel Vetter
2013-07-04 21:35 ` [PATCH 10/14] drm/i915: don't enable PM_VEBOX_CS_ERROR_INTERRUPT Daniel Vetter
2013-07-11 12:37   ` Daniel Vetter
2013-07-04 21:35 ` [PATCH 11/14] drm/i915: unify PM interrupt preinstall sequence Daniel Vetter
2013-07-08 17:06   ` Paulo Zanoni
2013-07-09 15:55     ` Daniel Vetter
2013-07-09 21:00     ` [PATCH] " Daniel Vetter
2013-07-10 20:05       ` Paulo Zanoni
2013-07-10 20:21         ` Daniel Vetter [this message]
2013-07-10 20:52           ` Paulo Zanoni
2013-07-04 21:35 ` [PATCH 12/14] drm/i915: unify GT/PM irq postinstall code Daniel Vetter
2013-07-10 20:48   ` Paulo Zanoni
2013-07-11  6:13     ` Daniel Vetter
2013-07-12 20:43       ` [PATCH 1/3] drm/i915: unify PM interrupt preinstall sequence Daniel Vetter
2013-07-12 20:43         ` [PATCH 2/3] drm/i915: unify GT/PM irq postinstall code Daniel Vetter
2013-07-14 20:55           ` Ben Widawsky
2013-07-14 21:31             ` Daniel Vetter
2013-07-14 21:40               ` Ben Widawsky
2013-07-15  0:13               ` Ben Widawsky
2013-07-16  6:17                 ` Daniel Vetter
2013-07-12 20:43         ` [PATCH 3/3] drm/i915: extract rps interrupt enable/disable helpers Daniel Vetter
2013-07-14 21:06           ` Ben Widawsky
2013-07-14 21:35             ` Daniel Vetter
2013-07-15 16:39               ` Ben Widawsky
2013-07-14 20:43         ` [PATCH 1/3] drm/i915: unify PM interrupt preinstall sequence Ben Widawsky
2013-07-04 21:35 ` [PATCH 13/14] drm/i915: extract rps interrupt enable/disable helpers Daniel Vetter
2013-07-10 21:12   ` Paulo Zanoni
2013-07-11  6:20     ` Daniel Vetter
2013-07-04 21:35 ` [PATCH 14/14] drm/i915: simplify rps interrupt enabling/disabling sequence Daniel Vetter
2013-07-16  6:19   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130710202119.GJ6143@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=przanoni@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox