public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/8] drm/i915/skl: Deinit/init the display at suspend/resume
Date: Wed, 6 May 2015 14:10:36 +0300	[thread overview]
Message-ID: <20150506111036.GP18908@intel.com> (raw)
In-Reply-To: <20150505185602.GN18908@intel.com>

On Tue, May 05, 2015 at 09:56:02PM +0300, Ville Syrjälä wrote:
> On Thu, Apr 30, 2015 at 04:39:21PM +0100, Damien Lespiau wrote:
> > +static void
> > +skl_dpll0_enable(struct drm_i915_private *dev_priv, unsigned int required_vco)
> > +{
> > +	unsigned int min_freq;
> > +	u32 val;
> > +
> > +	/* select the minimum CDCLK before enabling DPLL 0 */
> > +	val = I915_READ(CDCLK_CTL);
> > +	val &= ~CDCLK_FREQ_SEL_MASK | ~CDCLK_FREQ_DECIMAL_MASK;
> > +	val |= CDCLK_FREQ_337_308;
> > +
> > +	if (required_vco == 8640)
> > +		min_freq = 308570;
> > +	else
> > +		min_freq = 337500;
> > +
> > +	val = CDCLK_FREQ_337_308 | skl_cdlck_decimal(min_freq);
> > +
> > +	I915_WRITE(CDCLK_CTL, val);
> > +	POSTING_READ(CDCLK_CTL);
> > +
> > +	/*
> > +	 * We always enable DPLL0 with the lowest link rate possible, but still
> > +	 * taking into account the VCO required to operate the eDP panel at the
> > +	 * desired frequency. The usual DP link rates operate with a VCO of
> > +	 * 8100 while the eDP 1.4 alternate link rates need a VCO of 8640.
> > +	 * The modeset code is responsible for the selection of the exact link
> > +	 * rate later on, with the constraint of choosing a frequency that
> > +	 * works with required_vco.
> > +	 */
> > +	val = I915_READ(DPLL_CTRL1);
> > +
> > +	val &= ~(DPLL_CTRL1_HDMI_MODE(0) | DPLL_CTRL1_SSC(0) |
> > +		 DPLL_CTRL1_LINK_RATE_MASK(0));
> > +	val |= DPLL_CTRL1_OVERRIDE(0);
> > +	if (required_vco == 8640)
> > +		val |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_1080, 0);
> > +	else
> > +		val |= DPLL_CTRL1_LINK_RATE(DPLL_CTRL1_LINK_RATE_810, 0);
> 
> Hmm. These new pll registers are very confusing. But looks correct
> based on my understanding.

BTW replacing the magic numbers with some kind of enum for the DPLLs
might make this stuff less confusing.

-- 
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-05-06 11:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 15:39 [PATCH 0/8] SKL suspend/resume Damien Lespiau
2015-04-30 15:39 ` [PATCH 1/8] drm/i915/skl: Add the INIT power domain to the MISC I/O power well Damien Lespiau
2015-05-05 18:54   ` Ville Syrjälä
2015-04-30 15:39 ` [PATCH 2/8] drm/i915/skl: Fix the CTRL typo in the DPLL_CRTL1 defines Damien Lespiau
2015-04-30 15:39 ` [PATCH 3/8] drm/i915: Re-order the PCU opcodes Damien Lespiau
2015-04-30 15:39 ` [PATCH 4/8] drm/i915: Merge the GEN9 memory latency PCU opcode with its friends Damien Lespiau
2015-05-05 18:54   ` Ville Syrjälä
2015-04-30 15:39 ` [PATCH 5/8] drm/i915/skl: Make the Misc I/O power well part of the PLLS domain Damien Lespiau
2015-05-05 18:55   ` Ville Syrjälä
2015-04-30 15:39 ` [PATCH 6/8] drm/i915/skl: Deinit/init the display at suspend/resume Damien Lespiau
2015-05-05 18:56   ` Ville Syrjälä
2015-05-06 11:10     ` Ville Syrjälä [this message]
2015-05-06 10:52   ` Daniel Vetter
2015-04-30 15:39 ` [PATCH 7/8] drm/i915/skl: Change CDCLK behind PCU's back Damien Lespiau
2015-05-06 10:53   ` Daniel Vetter
2015-05-06 10:58     ` Damien Lespiau
2015-04-30 15:39 ` [PATCH 8/8] drm/i915/skl: gen6+ platforms support runtime PM Damien Lespiau
2015-05-02  8:20   ` shuang.he
2015-05-05 18:56   ` Ville Syrjälä
2015-05-06 10:54   ` Daniel Vetter
2015-05-06 10:55     ` Damien Lespiau

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=20150506111036.GP18908@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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