From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 02/11] drm/i915; Extract intel_hpd_enabled_irqs()
Date: Wed, 19 Aug 2015 20:02:50 +0300 [thread overview]
Message-ID: <20150819170250.GT5176@intel.com> (raw)
In-Reply-To: <CA+gsUGT+XcUyLQH2=siuGLKi4G7k_UGtrm22pP41cux4t-6qcQ@mail.gmail.com>
On Mon, Aug 17, 2015 at 05:06:17PM -0300, Paulo Zanoni wrote:
> 2015-08-12 12:44 GMT-03:00 <ville.syrjala@linux.intel.com>:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Eliminate a bunch of duplicated code that calculates the currently
> > enabled HPD interrupt bits.
>
> Nice one! I see this one also depends on a patch that's not merged
> yet, so I'm not sure if I should wait for it to be merged before
> continuing the review, or if you plan to send a version rebased just
> on -nightly.
I rebased it on top of nightly before I sent it. I guess some patches
got dropped from nightly.
>
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_irq.c | 43 ++++++++++++++++++++---------------------
> > 1 file changed, 21 insertions(+), 22 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index 8485bea..de0edbd 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -3002,27 +3002,34 @@ static void cherryview_irq_preinstall(struct drm_device *dev)
> > vlv_display_irq_reset(dev_priv);
> > }
> >
> > +static u32 intel_hpd_enabled_irqs(struct drm_device *dev,
> > + const u32 hpd[HPD_NUM_PINS])
> > +{
> > + struct drm_i915_private *dev_priv = to_i915(dev);
> > + struct intel_encoder *encoder;
> > + u32 enabled_irqs = 0;
> > +
> > + for_each_intel_encoder(dev, encoder)
> > + if (dev_priv->hotplug.stats[encoder->hpd_pin].state == HPD_ENABLED)
> > + enabled_irqs |= hpd[encoder->hpd_pin];
> > +
> > + return enabled_irqs;
> > +}
> > +
> > static void ibx_hpd_irq_setup(struct drm_device *dev)
> > {
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > - struct intel_encoder *intel_encoder;
> > - u32 hotplug_irqs, hotplug, enabled_irqs = 0;
> > + u32 hotplug_irqs, hotplug, enabled_irqs;
> >
> > if (HAS_PCH_IBX(dev)) {
> > hotplug_irqs = SDE_HOTPLUG_MASK;
> > - for_each_intel_encoder(dev, intel_encoder)
> > - if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state == HPD_ENABLED)
> > - enabled_irqs |= hpd_ibx[intel_encoder->hpd_pin];
> > + enabled_irqs = intel_hpd_enabled_irqs(dev, hpd_ibx);
> > } else if (HAS_PCH_SPT(dev)) {
> > hotplug_irqs = SDE_HOTPLUG_MASK_SPT;
> > - for_each_intel_encoder(dev, intel_encoder)
> > - if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state == HPD_ENABLED)
> > - enabled_irqs |= hpd_spt[intel_encoder->hpd_pin];
> > + enabled_irqs = intel_hpd_enabled_irqs(dev, hpd_spt);
> > } else {
> > hotplug_irqs = SDE_HOTPLUG_MASK_CPT;
> > - for_each_intel_encoder(dev, intel_encoder)
> > - if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state == HPD_ENABLED)
> > - enabled_irqs |= hpd_cpt[intel_encoder->hpd_pin];
> > + enabled_irqs = intel_hpd_enabled_irqs(dev, hpd_cpt);
> > }
> >
> > ibx_display_interrupt_update(dev_priv, hotplug_irqs, enabled_irqs);
> > @@ -3051,15 +3058,10 @@ static void ibx_hpd_irq_setup(struct drm_device *dev)
> > static void bxt_hpd_irq_setup(struct drm_device *dev)
> > {
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > - struct intel_encoder *intel_encoder;
> > - u32 hotplug_port = 0;
> > + u32 hotplug_port;
> > u32 hotplug_ctrl;
> >
> > - for_each_intel_encoder(dev, intel_encoder) {
> > - if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state
> > - == HPD_ENABLED)
> > - hotplug_port |= hpd_bxt[intel_encoder->hpd_pin];
> > - }
> > + hotplug_port = intel_hpd_enabled_irqs(dev, hpd_bxt);
> >
> > hotplug_ctrl = I915_READ(BXT_HOTPLUG_CTL) & ~BXT_HOTPLUG_CTL_MASK;
> >
> > @@ -3935,7 +3937,6 @@ static int i965_irq_postinstall(struct drm_device *dev)
> > static void i915_hpd_irq_setup(struct drm_device *dev)
> > {
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > - struct intel_encoder *intel_encoder;
> > u32 hotplug_en;
> >
> > assert_spin_locked(&dev_priv->irq_lock);
> > @@ -3944,9 +3945,7 @@ static void i915_hpd_irq_setup(struct drm_device *dev)
> > hotplug_en &= ~HOTPLUG_INT_EN_MASK;
> > /* Note HDMI and DP share hotplug bits */
> > /* enable bits are the same for all generations */
> > - for_each_intel_encoder(dev, intel_encoder)
> > - if (dev_priv->hotplug.stats[intel_encoder->hpd_pin].state == HPD_ENABLED)
> > - hotplug_en |= hpd_mask_i915[intel_encoder->hpd_pin];
> > + hotplug_en |= intel_hpd_enabled_irqs(dev, hpd_mask_i915);
> > /* Programming the CRT detection parameters tends
> > to generate a spurious hotplug event about three
> > seconds later. So just do it once.
> > --
> > 2.4.6
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
>
> --
> Paulo Zanoni
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-08-19 17:03 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 15:44 [PATCH 00/11] drm/i915: Port A HPD and other HPD cleanups ville.syrjala
2015-08-12 15:44 ` [PATCH 01/11] drm/i915: Clean up various HPD defines ville.syrjala
2015-08-17 19:51 ` Paulo Zanoni
2015-08-26 18:23 ` Paulo Zanoni
2015-08-12 15:44 ` [PATCH 02/11] drm/i915; Extract intel_hpd_enabled_irqs() ville.syrjala
2015-08-17 20:06 ` Paulo Zanoni
2015-08-19 17:02 ` Ville Syrjälä [this message]
2015-08-26 18:30 ` Paulo Zanoni
2015-08-12 15:44 ` [PATCH 03/11] drm/i915: Factor out ilk_update_display_irq() ville.syrjala
2015-08-26 18:46 ` Paulo Zanoni
2015-08-12 15:44 ` [PATCH 04/11] drm/i915: Add HAS_PCH_LPT_LP() macro ville.syrjala
2015-08-26 18:58 ` Paulo Zanoni
2015-08-27 16:32 ` Ville Syrjälä
2015-08-12 15:44 ` [PATCH 05/11] drm/i915: Rename BXT PORTA HPD defines ville.syrjala
2015-08-26 19:13 ` Paulo Zanoni
2015-08-26 19:43 ` Ville Syrjälä
2015-08-26 21:59 ` Runyan, Arthur J
2015-08-27 15:50 ` Ville Syrjälä
2015-08-27 19:34 ` Runyan, Arthur J
2015-08-27 19:52 ` Ville Syrjälä
2015-08-27 16:39 ` Ville Syrjälä
2015-08-12 15:44 ` [PATCH 06/11] drm/i915: Introduce spt_irq_handler() ville.syrjala
2015-08-26 21:44 ` Paulo Zanoni
2015-08-27 7:38 ` Jani Nikula
2015-08-27 16:13 ` Ville Syrjälä
2015-08-27 17:52 ` Ville Syrjälä
2015-08-12 15:44 ` [PATCH 07/11] drm/i915: Add port A HPD support for ILK/SNB ville.syrjala
2015-08-27 18:24 ` Paulo Zanoni
2015-08-12 15:44 ` [PATCH 08/11] drm/i915: Add port A HPD support for IVB/HSW ville.syrjala
2015-08-14 9:17 ` Daniel Vetter
2015-08-27 18:30 ` Paulo Zanoni
2015-08-12 15:44 ` [PATCH 09/11] drm/i915: LPT:LP needs port A HPD enabled in both north and south ville.syrjala
2015-08-27 18:40 ` Paulo Zanoni
2015-08-12 15:44 ` [PATCH 10/11] drm/i915: Add port A HPD support for BDW ville.syrjala
2015-08-27 19:29 ` Paulo Zanoni
2015-08-27 19:51 ` Ville Syrjälä
2015-08-12 15:44 ` [PATCH 11/11] drm/i915: Add port A HPD support for SPT ville.syrjala
2015-08-27 20:26 ` Paulo Zanoni
2015-08-19 18:13 ` [PATCH 12/11] drm/i915: Reinitialize HPD after runtime D3 ville.syrjala
2015-08-27 20:36 ` Paulo Zanoni
2015-08-19 19:11 ` [PATCH 00/11] drm/i915: Port A HPD and other HPD cleanups Ville Syrjälä
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=20150819170250.GT5176@intel.com \
--to=ville.syrjala@linux.intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.