[Intel-gfx] [PATCH 2/3] drm/i915: read current freq from Punit on VLV
Kenneth Graunke
kenneth at whitecape.org
Thu May 2 05:14:07 CEST 2013
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 at 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 at whitecape.org>
I'm not planning on reviewing patch 1; I have no idea about any of that
stuff.
More information about the Intel-gfx
mailing list