From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kenneth Graunke Subject: Re: [PATCH 2/3] drm/i915: read current freq from Punit on VLV Date: Wed, 01 May 2013 20:14:07 -0700 Message-ID: <5181D9FF.5020204@whitecape.org> References: <1367449762-2214-1-git-send-email-jbarnes@virtuousgeek.org> <1367449762-2214-2-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from homiemail-a10.g.dreamhost.com (caiajhbdcbhh.dreamhost.com [208.97.132.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 61F3AE5FD3 for ; Wed, 1 May 2013 20:12:49 -0700 (PDT) In-Reply-To: <1367449762-2214-2-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.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 > --- > 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 I'm not planning on reviewing patch 1; I have no idea about any of that stuff.