From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Fix ICL+ HDMI clock readout
Date: Mon, 3 Sep 2018 22:21:30 -0700 [thread overview]
Message-ID: <20180904052130.GB2316@intel.com> (raw)
In-Reply-To: <20180903142841.14627-1-ville.syrjala@linux.intel.com>
On Mon, Sep 03, 2018 at 05:28:41PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Copy the 38.4 vs. 19.2 MHz ref clock exception from the dpll
> mgr into the clock readout function as well.
>
> v2: Refactor the code into a common function
> s/is_icl/gen11+/ (Rodrigo)
neat
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107722
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> #v1
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 2 +-
> drivers/gpu/drm/i915/intel_dpll_mgr.c | 23 +++++++++++++++--------
> drivers/gpu/drm/i915/intel_dpll_mgr.h | 1 +
> 3 files changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index f3b115ce4029..3e64488a2b0a 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1414,7 +1414,7 @@ static int cnl_calc_wrpll_link(struct drm_i915_private *dev_priv,
> break;
> }
>
> - ref_clock = dev_priv->cdclk.hw.ref;
> + ref_clock = cnl_hdmi_pll_ref_clock(dev_priv);
>
> dco_freq = (cfgcr0 & DPLL_CFGCR0_DCO_INTEGER_MASK) * ref_clock;
>
> diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> index 04d41bc1a4bb..e6cac9225536 100644
> --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> @@ -2212,6 +2212,20 @@ static void cnl_wrpll_params_populate(struct skl_wrpll_params *params,
> params->dco_fraction = dco & 0x7fff;
> }
>
> +int cnl_hdmi_pll_ref_clock(struct drm_i915_private *dev_priv)
> +{
> + int ref_clock = dev_priv->cdclk.hw.ref;
> +
> + /*
> + * For ICL+, the spec states: if reference frequency is 38.4,
> + * use 19.2 because the DPLL automatically divides that by 2.
> + */
> + if (INTEL_GEN(dev_priv) >= 11 && ref_clock == 38400)
> + ref_clock = 19200;
> +
> + return ref_clock;
> +}
> +
> static bool
> cnl_ddi_calculate_wrpll(int clock,
> struct drm_i915_private *dev_priv,
> @@ -2251,14 +2265,7 @@ cnl_ddi_calculate_wrpll(int clock,
>
> cnl_wrpll_get_multipliers(best_div, &pdiv, &qdiv, &kdiv);
>
> - ref_clock = dev_priv->cdclk.hw.ref;
> -
> - /*
> - * For ICL, the spec states: if reference frequency is 38.4, use 19.2
> - * because the DPLL automatically divides that by 2.
> - */
> - if (IS_ICELAKE(dev_priv) && ref_clock == 38400)
> - ref_clock = 19200;
> + ref_clock = cnl_hdmi_pll_ref_clock(dev_priv);
>
> cnl_wrpll_params_populate(wrpll_params, best_dco, ref_clock, pdiv, qdiv,
> kdiv);
> diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.h b/drivers/gpu/drm/i915/intel_dpll_mgr.h
> index 7e522cf4f13f..bf0de8a4dc63 100644
> --- a/drivers/gpu/drm/i915/intel_dpll_mgr.h
> +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.h
> @@ -344,5 +344,6 @@ void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv,
> struct intel_dpll_hw_state *hw_state);
> int icl_calc_dp_combo_pll_link(struct drm_i915_private *dev_priv,
> uint32_t pll_id);
> +int cnl_hdmi_pll_ref_clock(struct drm_i915_private *dev_priv);
>
> #endif /* _INTEL_DPLL_MGR_H_ */
> --
> 2.16.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-09-04 5:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 15:32 [PATCH] drm/i915: Fix ICL HDMI clock readout Ville Syrjala
2018-08-28 17:26 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-08-28 20:36 ` [PATCH] " Rodrigo Vivi
2018-08-30 15:48 ` Ville Syrjälä
2018-08-30 19:09 ` Rodrigo Vivi
2018-08-28 21:07 ` ✓ Fi.CI.IGT: success for " Patchwork
2018-09-03 14:28 ` [PATCH v2] drm/i915: Fix ICL+ " Ville Syrjala
2018-09-04 5:21 ` Rodrigo Vivi [this message]
2018-09-04 13:26 ` Ville Syrjälä
2018-09-03 15:10 ` ✓ Fi.CI.BAT: success for drm/i915: Fix ICL HDMI clock readout (rev2) Patchwork
2018-09-03 21:56 ` ✓ Fi.CI.IGT: " Patchwork
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=20180904052130.GB2316@intel.com \
--to=rodrigo.vivi@intel.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.