All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kenneth Graunke <kenneth@whitecape.org>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915: read current freq from Punit on VLV
Date: Wed, 01 May 2013 20:14:07 -0700	[thread overview]
Message-ID: <5181D9FF.5020204@whitecape.org> (raw)
In-Reply-To: <1367449762-2214-2-git-send-email-jbarnes@virtuousgeek.org>

On 05/01/2013 04:09 PM, Jesse Barnes wrote:
> Instead of returning the cached value, which is just what the kernel
> requested.
>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>   drivers/gpu/drm/i915/i915_sysfs.c |    9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index ca00df2..c0d7875 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -212,10 +212,13 @@ static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
>   	int ret;
>
>   	mutex_lock(&dev_priv->rps.hw_lock);
> -	if (IS_VALLEYVIEW(dev_priv->dev))
> -		ret = vlv_gpu_freq(dev_priv->mem_freq, dev_priv->rps.cur_delay);
> -	else
> +	if (IS_VALLEYVIEW(dev_priv->dev)) {
> +		u32 freq;
> +		valleyview_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS, &freq);
> +		ret = vlv_gpu_freq(dev_priv->mem_freq, (freq >> 8) & 0xff);
> +	} else {
>   		ret = dev_priv->rps.cur_delay * GT_FREQUENCY_MULTIPLIER;
> +	}
>   	mutex_unlock(&dev_priv->rps.hw_lock);
>
>   	return snprintf(buf, PAGE_SIZE, "%d\n", ret);

I'd really like to see this for the rest of the platforms as well. 
Knowing what the kernel requested isn't nearly as interesting as knowing 
the real value.

But this VLV patch looks great, so:
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

I'm not planning on reviewing patch 1; I have no idea about any of that 
stuff.

  reply	other threads:[~2013-05-02  3:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 23:09 [PATCH 1/3] drm/i915: don't use stolen space on VLV Jesse Barnes
2013-05-01 23:09 ` [PATCH 2/3] drm/i915: read current freq from Punit " Jesse Barnes
2013-05-02  3:14   ` Kenneth Graunke [this message]
2013-05-01 23:09 ` [PATCH 3/3] drm/i915: go back to switch for VLV mem freq detection Jesse Barnes
2013-05-02  1:26   ` Ben Widawsky
2013-05-02  1:38     ` Kenneth Graunke
2013-05-02  1:45       ` Ben Widawsky
2013-05-02  3:16         ` Kenneth Graunke
2013-05-02  1:40     ` Ben Widawsky
2013-05-02  1:00 ` [PATCH 1/3] drm/i915: don't use stolen space on VLV Ben Widawsky

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=5181D9FF.5020204@whitecape.org \
    --to=kenneth@whitecape.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.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 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.