intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
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 04/11] drm/i915: Add HAS_PCH_LPT_LP() macro
Date: Thu, 27 Aug 2015 19:32:47 +0300	[thread overview]
Message-ID: <20150827163247.GL5176@intel.com> (raw)
In-Reply-To: <CA+gsUGQ8W2skZQYgk2URewVs6WMGepta6VU6CQJAsErnnb5_-A@mail.gmail.com>

On Wed, Aug 26, 2015 at 03:58:11PM -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>
> >
> > Make LPT:LP checks look neater by wrapping the details in a
> > new HAS_PCH_LPT_LP() macro.
> 
> This has the potential to be confusing since HAS_PCH_LPT() is also
> true for cases where HAS_PCH_LPT_LP() is true. Maybe we could rename
> the macro in some way that it wouldn't be HAS_PCH_XXX in order to
> reduce the probability of confusion? But I can't think of any
> suggestions...

We could rename HAS_PCH_LPT to HAS_PCH_LPT_LP_OR_H but that's just too
ugly IMO. I guess it might be clearer if we also had HAS_PCH_LPT_H but
since we have not use for both adding one is a bit dubious. So no nice
ideas here either.

> 
> Anyway, the patch is technically correct, so I'll let the decision to
> you and Daniel.
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h      |  1 +
> >  drivers/gpu/drm/i915/intel_display.c | 13 +++++--------
> >  drivers/gpu/drm/i915/intel_pm.c      |  4 ++--
> >  3 files changed, 8 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 55611d8..4e391dd 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -2573,6 +2573,7 @@ struct drm_i915_cmd_table {
> >  #define INTEL_PCH_TYPE(dev) (__I915__(dev)->pch_type)
> >  #define HAS_PCH_SPT(dev) (INTEL_PCH_TYPE(dev) == PCH_SPT)
> >  #define HAS_PCH_LPT(dev) (INTEL_PCH_TYPE(dev) == PCH_LPT)
> > +#define HAS_PCH_LPT_LP(dev) (__I915__(dev)->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE)
> >  #define HAS_PCH_CPT(dev) (INTEL_PCH_TYPE(dev) == PCH_CPT)
> >  #define HAS_PCH_IBX(dev) (INTEL_PCH_TYPE(dev) == PCH_IBX)
> >  #define HAS_PCH_NOP(dev) (INTEL_PCH_TYPE(dev) == PCH_NOP)
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 4b3012b..97c6368 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -8381,8 +8381,7 @@ static void lpt_enable_clkout_dp(struct drm_device *dev, bool with_spread,
> >
> >         if (WARN(with_fdi && !with_spread, "FDI requires downspread\n"))
> >                 with_spread = true;
> > -       if (WARN(dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE &&
> > -                with_fdi, "LP PCH doesn't have FDI\n"))
> > +       if (WARN(HAS_PCH_LPT_LP(dev) && with_fdi, "LP PCH doesn't have FDI\n"))
> >                 with_fdi = false;
> >
> >         mutex_lock(&dev_priv->sb_lock);
> > @@ -8405,8 +8404,7 @@ static void lpt_enable_clkout_dp(struct drm_device *dev, bool with_spread,
> >                 }
> >         }
> >
> > -       reg = (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) ?
> > -              SBI_GEN0 : SBI_DBUFF0;
> > +       reg = HAS_PCH_LPT_LP(dev) ? SBI_GEN0 : SBI_DBUFF0;
> >         tmp = intel_sbi_read(dev_priv, reg, SBI_ICLK);
> >         tmp |= SBI_GEN0_CFG_BUFFENABLE_DISABLE;
> >         intel_sbi_write(dev_priv, reg, tmp, SBI_ICLK);
> > @@ -8422,8 +8420,7 @@ static void lpt_disable_clkout_dp(struct drm_device *dev)
> >
> >         mutex_lock(&dev_priv->sb_lock);
> >
> > -       reg = (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) ?
> > -              SBI_GEN0 : SBI_DBUFF0;
> > +       reg = HAS_PCH_LPT_LP(dev) ? SBI_GEN0 : SBI_DBUFF0;
> >         tmp = intel_sbi_read(dev_priv, reg, SBI_ICLK);
> >         tmp &= ~SBI_GEN0_CFG_BUFFENABLE_DISABLE;
> >         intel_sbi_write(dev_priv, reg, tmp, SBI_ICLK);
> > @@ -9435,7 +9432,7 @@ void hsw_enable_pc8(struct drm_i915_private *dev_priv)
> >
> >         DRM_DEBUG_KMS("Enabling package C8+\n");
> >
> > -       if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
> > +       if (HAS_PCH_LPT_LP(dev)) {
> >                 val = I915_READ(SOUTH_DSPCLK_GATE_D);
> >                 val &= ~PCH_LP_PARTITION_LEVEL_DISABLE;
> >                 I915_WRITE(SOUTH_DSPCLK_GATE_D, val);
> > @@ -9455,7 +9452,7 @@ void hsw_disable_pc8(struct drm_i915_private *dev_priv)
> >         hsw_restore_lcpll(dev_priv);
> >         lpt_init_pch_refclk(dev);
> >
> > -       if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
> > +       if (HAS_PCH_LPT_LP(dev)) {
> >                 val = I915_READ(SOUTH_DSPCLK_GATE_D);
> >                 val |= PCH_LP_PARTITION_LEVEL_DISABLE;
> >                 I915_WRITE(SOUTH_DSPCLK_GATE_D, val);
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index fff0c226..ea49661 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -6588,7 +6588,7 @@ static void lpt_init_clock_gating(struct drm_device *dev)
> >          * TODO: this bit should only be enabled when really needed, then
> >          * disabled when not needed anymore in order to save power.
> >          */
> > -       if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE)
> > +       if (HAS_PCH_LPT_LP(dev))
> >                 I915_WRITE(SOUTH_DSPCLK_GATE_D,
> >                            I915_READ(SOUTH_DSPCLK_GATE_D) |
> >                            PCH_LP_PARTITION_LEVEL_DISABLE);
> > @@ -6603,7 +6603,7 @@ static void lpt_suspend_hw(struct drm_device *dev)
> >  {
> >         struct drm_i915_private *dev_priv = dev->dev_private;
> >
> > -       if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
> > +       if (HAS_PCH_LPT_LP(dev)) {
> >                 uint32_t val = I915_READ(SOUTH_DSPCLK_GATE_D);
> >
> >                 val &= ~PCH_LP_PARTITION_LEVEL_DISABLE;
> > --
> > 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

  reply	other threads:[~2015-08-27 16:33 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ä
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ä [this message]
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=20150827163247.GL5176@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).