From: Mika Kahola <mika.kahola@intel.com>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/3] drm/i915: Update CDCLK_FREQ register on BDW after changing cdclk frequency
Date: Wed, 27 Apr 2016 11:19:27 +0300 [thread overview]
Message-ID: <1461745167.30256.4.camel@sorvi> (raw)
In-Reply-To: <1461689194-6079-2-git-send-email-ville.syrjala@linux.intel.com>
Indeed, BSpec says that this register should be programmed by CD clock
minus one.
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
On Tue, 2016-04-26 at 19:46 +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Update CDCLK_FREQ on BDW after changing the cdclk frequency. Not sure
> if this is a late addition to the spec, or if I simply overlooked this
> step when writing the original code.
>
> This is what Bspec has to say about CDCLK_FREQ:
> "Program this field to the CD clock frequency minus one. This is used to
> generate a divided down clock for miscellaneous timers in display."
>
> And the "Broadwell Sequences for Changing CD Clock Frequency" section
> clarifies this further:
> "For CD clock 337.5 MHz, program 337 decimal.
> For CD clock 450 MHz, program 449 decimal.
> For CD clock 540 MHz, program 539 decimal.
> For CD clock 675 MHz, program 674 decimal."
>
> Cc: stable@vger.kernel.org
> Cc: Mika Kahola <mika.kahola@intel.com>
> Fixes: b432e5cfd5e9 ("drm/i915: BDW clock change support")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_reg.h | 2 ++
> drivers/gpu/drm/i915/intel_display.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 03264fd30fdd..41c9ae03652b 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -7484,6 +7484,8 @@ enum skl_disp_power_wells {
> #define TRANS_CLK_SEL_DISABLED (0x0<<29)
> #define TRANS_CLK_SEL_PORT(x) (((x)+1)<<29)
>
> +#define CDCLK_FREQ _MMIO(0x46200)
> +
> #define _TRANSA_MSA_MISC 0x60410
> #define _TRANSB_MSA_MISC 0x61410
> #define _TRANSC_MSA_MISC 0x62410
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 929fd93b3e5d..ea55dd331fac 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9647,6 +9647,8 @@ static void broadwell_set_cdclk(struct drm_device *dev, int cdclk)
> sandybridge_pcode_write(dev_priv, HSW_PCODE_DE_WRITE_FREQ_REQ, data);
> mutex_unlock(&dev_priv->rps.hw_lock);
>
> + I915_WRITE(CDCLK_FREQ, DIV_ROUND_CLOSEST(cdclk, 1000) - 1);
> +
> intel_update_cdclk(dev);
>
> WARN(cdclk != dev_priv->cdclk_freq,
--
Mika Kahola - Intel OTC
prev parent reply other threads:[~2016-04-27 8:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1461689194-6079-1-git-send-email-ville.syrjala@linux.intel.com>
2016-04-26 16:46 ` [PATCH 1/3] drm/i915: Update CDCLK_FREQ register on BDW after changing cdclk frequency ville.syrjala
2016-04-27 8:19 ` Mika Kahola [this message]
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=1461745167.30256.4.camel@sorvi \
--to=mika.kahola@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.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 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).