All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 08/10] drm/i915: Refactor LPT-H VGA dotclock disabling
Date: Wed, 2 Dec 2015 14:56:01 -0200	[thread overview]
Message-ID: <CA+gsUGQvub9tK91BSLvupm8Zp_6nVKnSwWu1wT05D-vHNc=djQ@mail.gmail.com> (raw)
In-Reply-To: <1448975321-20192-9-git-send-email-ville.syrjala@linux.intel.com>

2015-12-01 11:08 GMT-02:00  <ville.syrjala@linux.intel.com>:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Extract the LPT-H VGA dotclock disable to a separate function in
> anticipation of further use.
>
> While at it move the sb_lock locking inwards when enabling the VGA
> dotclock, as it's only needed to protect the sideband accesses.
>
> Also toss out the PIXCLK_GATE_GATE nop define and just use 0.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h      |  1 -
>  drivers/gpu/drm/i915/intel_display.c | 34 ++++++++++++++++++++--------------
>  2 files changed, 20 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index fcc819f400a6..3a9819735833 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -7342,7 +7342,6 @@ enum skl_disp_power_wells {
>  /* LPT PIXCLK_GATE */
>  #define PIXCLK_GATE                    _MMIO(0xC6020)
>  #define  PIXCLK_GATE_UNGATE            (1<<0)
> -#define  PIXCLK_GATE_GATE              (0<<0)

I actually liked the #define...

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

>
>  /* SPLL */
>  #define SPLL_CTL                       _MMIO(0x46020)
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 1dc125b6dcdc..322a35c67870 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3938,6 +3938,21 @@ static int intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
>         return 0;
>  }
>
> +static void lpt_disable_iclkip(struct drm_i915_private *dev_priv)
> +{
> +       u32 temp;
> +
> +       I915_WRITE(PIXCLK_GATE, 0);
> +
> +       mutex_lock(&dev_priv->sb_lock);
> +
> +       temp = intel_sbi_read(dev_priv, SBI_SSCCTL6, SBI_ICLK);
> +       temp |= SBI_SSCCTL_DISABLE;
> +       intel_sbi_write(dev_priv, SBI_SSCCTL6, temp, SBI_ICLK);
> +
> +       mutex_unlock(&dev_priv->sb_lock);
> +}
> +
>  /* Program iCLKIP clock to the desired frequency */
>  static void lpt_program_iclkip(struct drm_crtc *crtc)
>  {
> @@ -3947,18 +3962,7 @@ static void lpt_program_iclkip(struct drm_crtc *crtc)
>         u32 divsel, phaseinc, auxdiv, phasedir = 0;
>         u32 temp;
>
> -       mutex_lock(&dev_priv->sb_lock);
> -
> -       /* It is necessary to ungate the pixclk gate prior to programming
> -        * the divisors, and gate it back when it is done.
> -        */
> -       I915_WRITE(PIXCLK_GATE, PIXCLK_GATE_GATE);
> -
> -       /* Disable SSCCTL */
> -       intel_sbi_write(dev_priv, SBI_SSCCTL6,
> -                       intel_sbi_read(dev_priv, SBI_SSCCTL6, SBI_ICLK) |
> -                               SBI_SSCCTL_DISABLE,
> -                       SBI_ICLK);
> +       lpt_disable_iclkip(dev_priv);
>
>         /* 20MHz is a corner case which is out of range for the 7-bit divisor */
>         if (clock == 20000) {
> @@ -3998,6 +4002,8 @@ static void lpt_program_iclkip(struct drm_crtc *crtc)
>                         phasedir,
>                         phaseinc);
>
> +       mutex_lock(&dev_priv->sb_lock);
> +
>         /* Program SSCDIVINTPHASE6 */
>         temp = intel_sbi_read(dev_priv, SBI_SSCDIVINTPHASE6, SBI_ICLK);
>         temp &= ~SBI_SSCDIVINTPHASE_DIVSEL_MASK;
> @@ -4019,12 +4025,12 @@ static void lpt_program_iclkip(struct drm_crtc *crtc)
>         temp &= ~SBI_SSCCTL_DISABLE;
>         intel_sbi_write(dev_priv, SBI_SSCCTL6, temp, SBI_ICLK);
>
> +       mutex_unlock(&dev_priv->sb_lock);
> +
>         /* Wait for initialization time */
>         udelay(24);
>
>         I915_WRITE(PIXCLK_GATE, PIXCLK_GATE_UNGATE);
> -
> -       mutex_unlock(&dev_priv->sb_lock);
>  }
>
>  static void ironlake_pch_transcoder_set_timings(struct intel_crtc *crtc,
> --
> 2.4.10
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-02 16:56 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 13:08 [PATCH 00/10] HSW/BDW PCH modeset fixes and stuff ville.syrjala
2015-12-01 13:08 ` [PATCH 01/10] drm/i915: Don't register the CRT connector when it's fused off ville.syrjala
2015-12-01 19:05   ` Paulo Zanoni
2015-12-01 19:18     ` Ville Syrjälä
2015-12-01 21:28   ` [PATCH v2 01/10] drm/i915: Don't register the CRT connector when it's fused off on LPT-H ville.syrjala
2015-12-01 13:08 ` [PATCH 02/10] drm/i915: Don't register CRT connectro when DDI E can't be used ville.syrjala
2015-12-01 19:13   ` Paulo Zanoni
2015-12-01 21:29   ` [PATCH v2 02/10] drm/i915: Don't register CRT connector " ville.syrjala
2015-12-01 13:08 ` [PATCH 03/10] drm/i915: Check VBT for CRT port presence on HSW/BDW ville.syrjala
2015-12-01 13:41   ` Chris Wilson
2015-12-01 13:57     ` Ville Syrjälä
2015-12-01 14:06       ` Chris Wilson
2015-12-01 14:19         ` Ville Syrjälä
2015-12-01 16:07   ` [PATCH v2 " ville.syrjala
2015-12-01 18:15     ` Ville Syrjälä
2015-12-01 19:28     ` Paulo Zanoni
2015-12-01 19:40       ` Ville Syrjälä
2015-12-01 21:31     ` [PATCH v3 " ville.syrjala
2015-12-01 13:08 ` [PATCH 04/10] drm/i915: Add "missing" break to haswell_get_ddi_pll() ville.syrjala
2015-12-01 19:34   ` Paulo Zanoni
2015-12-01 19:45     ` Ville Syrjälä
2015-12-01 21:32   ` [PATCH v2 " ville.syrjala
2015-12-02  9:29     ` Ville Syrjälä
2015-12-01 13:08 ` [PATCH 05/10] drm/i915: Disable CLKOUT_DP bending on LPT/WPT as needed ville.syrjala
2015-12-02 13:35   ` Paulo Zanoni
2015-12-03 10:03     ` Ville Syrjälä
2015-12-03 11:16       ` Paulo Zanoni
2015-12-04 20:19   ` [PATCH v2 " ville.syrjala
2015-12-07 16:54     ` Paulo Zanoni
2015-12-01 13:08 ` [PATCH 06/10] drm/i915: Round to closest when computing the VGA dotclock for LPT-H ville.syrjala
2015-12-02 13:45   ` Paulo Zanoni
2015-12-04 20:20   ` [PATCH v2 " ville.syrjala
2015-12-01 13:08 ` [PATCH 07/10] drm/i915: Disable FDI after the CRT port on LPT-H ville.syrjala
2015-12-02 14:01   ` Paulo Zanoni
2015-12-03 10:14     ` Ville Syrjälä
2015-12-04 20:20   ` [PATCH v2 " ville.syrjala
2015-12-07 17:51     ` Paulo Zanoni
2015-12-07 18:57       ` Ville Syrjälä
2015-12-08 14:04         ` Ville Syrjälä
2015-12-08 14:05     ` [PATCH] " ville.syrjala
2015-12-01 13:08 ` [PATCH 08/10] drm/i915: Refactor LPT-H VGA dotclock disabling ville.syrjala
2015-12-02 16:56   ` Paulo Zanoni [this message]
2015-12-03 10:15     ` Ville Syrjälä
2015-12-04 20:21   ` [PATCH v2 " ville.syrjala
2015-12-01 13:08 ` [PATCH 09/10] drm/i915: Disable LPT-H VGA dotclock during crtc disable ville.syrjala
2015-12-02 17:02   ` Paulo Zanoni
2015-12-03 10:29     ` Ville Syrjälä
2015-12-04 20:22   ` [PATCH v2 " ville.syrjala
2015-12-01 13:08 ` [PATCH 10/10] drm/i915: Leave FDI running after failed link training on LPT-H ville.syrjala
2015-12-02 17:16   ` Paulo Zanoni
2015-12-03 10:30     ` Ville Syrjälä
2015-12-04 10:09   ` Daniel Vetter
2015-12-04 11:59     ` Ville Syrjälä
2015-12-04 20:22   ` [PATCH v2 " ville.syrjala
2015-12-08 14:32 ` [PATCH 00/10] HSW/BDW PCH modeset fixes and stuff 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='CA+gsUGQvub9tK91BSLvupm8Zp_6nVKnSwWu1wT05D-vHNc=djQ@mail.gmail.com' \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.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.