[Intel-gfx] [PATCH 2/4] drm/i915: Add gt_act_freq_mhz sysfs file

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 26 12:42:56 PST 2015


On Mon, Jan 26, 2015 at 12:22:07PM -0800, O'Rourke, Tom wrote:
> On Sun, Jan 25, 2015 at 09:34:33AM +0000, Chris Wilson wrote:
> > On Fri, Jan 23, 2015 at 09:04:24PM +0200, ville.syrjala at linux.intel.com wrote:
> > > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > > 
> > > Currently the 'gt_cur_freq_mhz' file shows the actual GPU frequency on
> > > VLV/CHV, and the last requested frequency on other platforms. Change the
> > > meaning of the file on VLV/CHV to follow the the other platforms, and
> > > introduce a new file 'gt_act_freq_mhz' which shows the actual frequency
> > > on all platforms.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
> > 
> > >  drivers/gpu/drm/i915/i915_sysfs.c | 35 ++++++++++++++++++++++++++++++++++-
> > >  1 file changed, 34 insertions(+), 1 deletion(-)
> > > 
> > > +static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
> > > +				    struct device_attribute *attr, char *buf)
> > > +{
> > > +	struct drm_minor *minor = dev_to_drm_minor(kdev);
> > > +	struct drm_device *dev = minor->dev;
> > > +	struct drm_i915_private *dev_priv = dev->dev_private;
> > > +	int ret;
> > > +
> > > +	flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> > 
> > Is this required for querying the current value?
> > 
> > Though probably better to keep it similar to the others.
> > -Chris
> 
> [TOR:] flush_delayed_work is needed to make sure rps.cur_freq
> is valid for non VLV/CHV platforms.

It is reporting the actual hw frequency. I still fail to see how
flushing the pending work is important for reporting that instantaneous
value.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list