From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 1/7] drm/i915: Refactor gmch hpd irq handling Date: Mon, 31 Mar 2014 19:35:24 +0300 Message-ID: <20140331163524.GX21652@intel.com> References: <1396279290-29435-1-git-send-email-ville.syrjala@linux.intel.com> <1396279290-29435-2-git-send-email-ville.syrjala@linux.intel.com> <20140331154928.GD7314@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id C23066E35E for ; Mon, 31 Mar 2014 09:36:18 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140331154928.GD7314@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Mar 31, 2014 at 04:49:28PM +0100, Chris Wilson wrote: > On Mon, Mar 31, 2014 at 06:21:24PM +0300, ville.syrjala@linux.intel.com w= rote: > > From: Ville Syrj=E4l=E4 > > = > > Pull all the gmch platform hotplug interrupt handling into one > > function. > > = > > Signed-off-by: Ville Syrj=E4l=E4 > > --- > > drivers/gpu/drm/i915/i915_irq.c | 71 +++++++++++++++++++--------------= -------- > > 1 file changed, 32 insertions(+), 39 deletions(-) > > = > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i91= 5_irq.c > > index 0858189..6d26719 100644 > > --- a/drivers/gpu/drm/i915/i915_irq.c > > +++ b/drivers/gpu/drm/i915/i915_irq.c > > @@ -1647,6 +1647,34 @@ static void valleyview_pipestat_irq_handler(stru= ct drm_device *dev, u32 iir) > > gmbus_irq_handler(dev); > > } > > = > > +static void i9xx_hpd_irq_handler(struct drm_device *dev, u32 iir) > > +{ > > + drm_i915_private_t *dev_priv =3D dev->dev_private; > > + u32 hotplug_status; > > + > > + if ((iir & I915_DISPLAY_PORT_INTERRUPT) =3D=3D 0) > > + return; > > + > > + hotplug_status =3D I915_READ(PORT_HOTPLUG_STAT); > > + > > + if (IS_G4X(dev)) { > > + u32 hotplug_trigger =3D hotplug_status & HOTPLUG_INT_STATUS_G4X; > > + > > + intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_g4x); > > + } else { > > + u32 hotplug_trigger =3D hotplug_status & HOTPLUG_INT_STATUS_I915; > > + > > + intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_i915); > > + } > > + > > + if ((IS_G4X(dev) || IS_VALLEYVIEW(dev)) && > > + hotplug_status & DP_AUX_CHANNEL_MASK_INT_STATUS_G4X) > > + dp_aux_irq_handler(dev); > > + > > + I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); > > + POSTING_READ(PORT_HOTPLUG_STAT); > > +} > = > Hmm, after some thought I am in favour of the function as a readibility > improvement. However, I would prefer to have the iir check inlined > into the caller. I had it like that originally, but I moved it into the function when I realized all the callers have the exact same check, and it looked a bit out of place next to the other "sub" irq handlers which do the IIR checks themselves. But I'm not really attached to the idea, so I can change it back if that's the consensus. -- = Ville Syrj=E4l=E4 Intel OTC