[Intel-gfx] [PATCH 2/7] drm/i915: Add RP0/RP1/RPn render P state thresholds in VLV sysfs
From: Deepak S This is useful for userspace utilities to verify and micromanaging the increase/decrease frequncy. Signed-off-by: Deepak S --- drivers/gpu/drm/i915/i915_sysfs.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c index 86ce39a..b15c8ce 100644 --- a/drivers/gpu/drm/i915/i915_sysfs.c +++ b/drivers/gpu/drm/i915/i915_sysfs.c @@ -461,11 +461,20 @@ static ssize_t gt_rp_mhz_show(struct device *kdev, struct device_attribute *attr mutex_unlock(&dev->struct_mutex); if (attr == &dev_attr_gt_RP0_freq_mhz) { - val = ((rp_state_cap & 0xff) >> 0) * GT_FREQUENCY_MULTIPLIER; + if (IS_VALLEYVIEW(dev)) + val = vlv_gpu_freq(dev_priv, dev_priv->rps.rp0_freq); + else + val = ((rp_state_cap & 0xff) >> 0) * GT_FREQUENCY_MULTIPLIER; } else if (attr == &dev_attr_gt_RP1_freq_mhz) { - val = ((rp_state_cap & 0x00ff00) >> 8) * GT_FREQUENCY_MULTIPLIER; + if (IS_VALLEYVIEW(dev)) + val = vlv_gpu_freq(dev_priv, dev_priv->rps.rp1_freq); + else + val = ((rp_state_cap & 0x00ff00) >> 8) * GT_FREQUENCY_MULTIPLIER; } else if (attr == &dev_attr_gt_RPn_freq_mhz) { - val = ((rp_state_cap & 0xff) >> 16) * GT_FREQUENCY_MULTIPLIER; + if (IS_VALLEYVIEW(dev)) + val = vlv_gpu_freq(dev_priv, dev_priv->rps.min_freq); + else + val = ((rp_state_cap & 0xff) >> 16) * GT_FREQUENCY_MULTIPLIER; } else { BUG(); } @@ -486,6 +495,9 @@ static const struct attribute *vlv_attrs[] = { &dev_attr_gt_cur_freq_mhz.attr, &dev_attr_gt_max_freq_mhz.attr, &dev_attr_gt_min_freq_mhz.attr, + &dev_attr_gt_RP0_freq_mhz.attr, + &dev_attr_gt_RP1_freq_mhz.attr, + &dev_attr_gt_RPn_freq_mhz.attr, &dev_attr_vlv_rpe_freq_mhz.attr, NULL, }; -- 1.9.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 2/7] drm/i915: Add RP0/RP1/RPn render P state thresholds in VLV sysfs
deepa...@linux.intel.com writes: > From: Deepak S > > This is useful for userspace utilities to verify and micromanaging the > increase/decrease frequncy. > > Signed-off-by: Deepak S Reviewed-by: Mika Kuoppala > --- > drivers/gpu/drm/i915/i915_sysfs.c | 18 +++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_sysfs.c > b/drivers/gpu/drm/i915/i915_sysfs.c > index 86ce39a..b15c8ce 100644 > --- a/drivers/gpu/drm/i915/i915_sysfs.c > +++ b/drivers/gpu/drm/i915/i915_sysfs.c > @@ -461,11 +461,20 @@ static ssize_t gt_rp_mhz_show(struct device *kdev, > struct device_attribute *attr > mutex_unlock(&dev->struct_mutex); > > if (attr == &dev_attr_gt_RP0_freq_mhz) { > - val = ((rp_state_cap & 0xff) >> 0) * > GT_FREQUENCY_MULTIPLIER; > + if (IS_VALLEYVIEW(dev)) > + val = vlv_gpu_freq(dev_priv, dev_priv->rps.rp0_freq); > + else > + val = ((rp_state_cap & 0xff) >> 0) * > GT_FREQUENCY_MULTIPLIER; > } else if (attr == &dev_attr_gt_RP1_freq_mhz) { > - val = ((rp_state_cap & 0x00ff00) >> 8) * > GT_FREQUENCY_MULTIPLIER; > + if (IS_VALLEYVIEW(dev)) > + val = vlv_gpu_freq(dev_priv, dev_priv->rps.rp1_freq); > + else > + val = ((rp_state_cap & 0x00ff00) >> 8) * > GT_FREQUENCY_MULTIPLIER; > } else if (attr == &dev_attr_gt_RPn_freq_mhz) { > - val = ((rp_state_cap & 0xff) >> 16) * > GT_FREQUENCY_MULTIPLIER; > + if (IS_VALLEYVIEW(dev)) > + val = vlv_gpu_freq(dev_priv, dev_priv->rps.min_freq); > + else > + val = ((rp_state_cap & 0xff) >> 16) * > GT_FREQUENCY_MULTIPLIER; > } else { > BUG(); > } > @@ -486,6 +495,9 @@ static const struct attribute *vlv_attrs[] = { > &dev_attr_gt_cur_freq_mhz.attr, > &dev_attr_gt_max_freq_mhz.attr, > &dev_attr_gt_min_freq_mhz.attr, > + &dev_attr_gt_RP0_freq_mhz.attr, > + &dev_attr_gt_RP1_freq_mhz.attr, > + &dev_attr_gt_RPn_freq_mhz.attr, > &dev_attr_vlv_rpe_freq_mhz.attr, > NULL, > }; > -- > 1.9.1 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 2/7] drm/i915: Add RP0/RP1/RPn render P state thresholds in VLV sysfs
On Thu, Jul 10, 2014 at 01:16:22PM +0530, deepa...@linux.intel.com wrote: > From: Deepak S > > This is useful for userspace utilities to verify and micromanaging the > increase/decrease frequncy. > > Signed-off-by: Deepak S > --- > drivers/gpu/drm/i915/i915_sysfs.c | 18 +++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_sysfs.c > b/drivers/gpu/drm/i915/i915_sysfs.c > index 86ce39a..b15c8ce 100644 > --- a/drivers/gpu/drm/i915/i915_sysfs.c > +++ b/drivers/gpu/drm/i915/i915_sysfs.c > @@ -461,11 +461,20 @@ static ssize_t gt_rp_mhz_show(struct device *kdev, > struct device_attribute *attr > mutex_unlock(&dev->struct_mutex); > > if (attr == &dev_attr_gt_RP0_freq_mhz) { > - val = ((rp_state_cap & 0xff) >> 0) * > GT_FREQUENCY_MULTIPLIER; > + if (IS_VALLEYVIEW(dev)) > + val = vlv_gpu_freq(dev_priv, dev_priv->rps.rp0_freq); > + else > + val = ((rp_state_cap & 0xff) >> 0) * > GT_FREQUENCY_MULTIPLIER; > } else if (attr == &dev_attr_gt_RP1_freq_mhz) { > - val = ((rp_state_cap & 0x00ff00) >> 8) * > GT_FREQUENCY_MULTIPLIER; > + if (IS_VALLEYVIEW(dev)) > + val = vlv_gpu_freq(dev_priv, dev_priv->rps.rp1_freq); > + else > + val = ((rp_state_cap & 0x00ff00) >> 8) * > GT_FREQUENCY_MULTIPLIER; > } else if (attr == &dev_attr_gt_RPn_freq_mhz) { > - val = ((rp_state_cap & 0xff) >> 16) * > GT_FREQUENCY_MULTIPLIER; > + if (IS_VALLEYVIEW(dev)) > + val = vlv_gpu_freq(dev_priv, dev_priv->rps.min_freq); > + else > + val = ((rp_state_cap & 0xff) >> 16) * > GT_FREQUENCY_MULTIPLIER; > } else { > BUG(); > } > @@ -486,6 +495,9 @@ static const struct attribute *vlv_attrs[] = { > &dev_attr_gt_cur_freq_mhz.attr, > &dev_attr_gt_max_freq_mhz.attr, > &dev_attr_gt_min_freq_mhz.attr, > + &dev_attr_gt_RP0_freq_mhz.attr, > + &dev_attr_gt_RP1_freq_mhz.attr, > + &dev_attr_gt_RPn_freq_mhz.attr, > &dev_attr_vlv_rpe_freq_mhz.attr, > NULL, > }; This now exactly matches gen6_attrs, so I've killed it while applying. -Daniel > -- > 1.9.1 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx