public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Purushothaman, Vijay A" <vijay.a.purushothaman@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Fix chv cdclk support
Date: Mon, 09 Mar 2015 14:29:45 +0530	[thread overview]
Message-ID: <54FD6101.9030308@linux.intel.com> (raw)
In-Reply-To: <1425319637-25733-2-git-send-email-ville.syrjala@linux.intel.com>

On 3/2/2015 11:37 PM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The specs seem to be full of misinformation wrt. the Punit register
> 0x36. Some versions still show the old VLV bit layout, some the new
> layout, and all of them seem to tell us nonsense about the cdclk
> value encoding.
>
> Testing on actual hardware has shown that we simply need to program
> the desired CCK divider into the Punit register using the new layout of
> the bits. Doing that, the status bit change to indicate the same value,
> and the CCK 0x6b register also changes accordingly to indicate that CCK
> is now using the new divider.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Vijay Purushothaman <vijay.a.purushothaman@linux.intel.com>

Thanks,
Vijay


> ---
>   drivers/gpu/drm/i915/intel_display.c | 23 +++++++----------------
>   1 file changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 94ff310..ca49b6f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -4889,24 +4889,23 @@ static void cherryview_set_cdclk(struct drm_device *dev, int cdclk)
>   	WARN_ON(dev_priv->display.get_display_clock_speed(dev) != dev_priv->vlv_cdclk_freq);
>   
>   	switch (cdclk) {
> -	case 400000:
> -		cmd = 3;
> -		break;
>   	case 333333:
>   	case 320000:
> -		cmd = 2;
> -		break;
>   	case 266667:
> -		cmd = 1;
> -		break;
>   	case 200000:
> -		cmd = 0;
>   		break;
>   	default:
>   		MISSING_CASE(cdclk);
>   		return;
>   	}
>   
> +	/*
> +	 * Specs are full of misinformation, but testing on actual
> +	 * hardware has shown that we just need to write the desired
> +	 * CCK divider into the Punit register.
> +	 */
> +	cmd = DIV_ROUND_CLOSEST(dev_priv->hpll_freq << 1, cdclk) - 1;
> +
>   	mutex_lock(&dev_priv->rps.hw_lock);
>   	val = vlv_punit_read(dev_priv, PUNIT_REG_DSPFREQ);
>   	val &= ~DSPFREQGUAR_MASK_CHV;
> @@ -4928,10 +4927,6 @@ static int valleyview_calc_cdclk(struct drm_i915_private *dev_priv,
>   	int freq_320 = (dev_priv->hpll_freq <<  1) % 320000 != 0 ? 333333 : 320000;
>   	int limit = IS_CHERRYVIEW(dev_priv) ? 95 : 90;
>   
> -	/* FIXME: Punit isn't quite ready yet */
> -	if (IS_CHERRYVIEW(dev_priv->dev))
> -		return 400000;
> -
>   	/*
>   	 * Really only a few cases to deal with, as only 4 CDclks are supported:
>   	 *   200MHz
> @@ -5606,10 +5601,6 @@ static int valleyview_get_display_clock_speed(struct drm_device *dev)
>   	u32 val;
>   	int divider;
>   
> -	/* FIXME: Punit isn't quite ready yet */
> -	if (IS_CHERRYVIEW(dev))
> -		return 400000;
> -
>   	if (dev_priv->hpll_freq == 0)
>   		dev_priv->hpll_freq = valleyview_get_vco(dev_priv);
>   

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

  parent reply	other threads:[~2015-03-09  8:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 18:07 [PATCH 1/2] drm/i915: Allow pixel clock up to 95% of cdclk on CHV ville.syrjala
2015-03-02 18:07 ` [PATCH 2/2] drm/i915: Fix chv cdclk support ville.syrjala
2015-03-03 20:55   ` shuang.he
2015-03-09  8:59   ` Purushothaman, Vijay A [this message]
2015-03-09  9:24     ` Mohan Marimuthu, Yogesh
2015-03-09 15:40       ` Daniel Vetter
2015-03-09  8:58 ` [PATCH 1/2] drm/i915: Allow pixel clock up to 95% of cdclk on CHV Purushothaman, Vijay A
2015-03-09  9:23   ` Mohan Marimuthu, Yogesh

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=54FD6101.9030308@linux.intel.com \
    --to=vijay.a.purushothaman@linux.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