[Intel-gfx] [PATCH] drm/i915/rps: Add frequency translation helpers

Andi Shyti andi.shyti at intel.com
Wed Dec 4 11:06:19 UTC 2019


Hi Chris,

> > @@ -1633,21 +1633,11 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)
> >  {
> >         struct drm_i915_private *dev_priv = node_to_i915(m->private);
> >         struct intel_rps *rps = &dev_priv->gt.rps;
> > -       u32 act_freq = rps->cur_freq;
> > +       u32 act_freq;
> >         intel_wakeref_t wakeref;
> >  
> > -       with_intel_runtime_pm_if_in_use(&dev_priv->runtime_pm, wakeref) {
> > -               if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
> > -                       vlv_punit_get(dev_priv);
> > -                       act_freq = vlv_punit_read(dev_priv,
> > -                                                 PUNIT_REG_GPU_FREQ_STS);
> > -                       vlv_punit_put(dev_priv);
> > -                       act_freq = (act_freq >> 8) & 0xff;
> > -               } else {
> > -                       act_freq = intel_get_cagf(rps,
> > -                                                 I915_READ(GEN6_RPSTAT1));
> > -               }
> > -       }
> > +       with_intel_runtime_pm_if_in_use(&dev_priv->runtime_pm, wakeref)
> > +               act_freq = intel_cagf_freq_read(rps);
> >  
> >         seq_printf(m, "RPS enabled? %d\n", rps->enabled);
> >         seq_printf(m, "GPU busy? %s\n", yesno(dev_priv->gt.awake));
> > @@ -1655,8 +1645,7 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)
> >                    atomic_read(&rps->num_waiters));
> >         seq_printf(m, "Interactive? %d\n", READ_ONCE(rps->power.interactive));
> >         seq_printf(m, "Frequency requested %d, actual %d\n",
> > -                  intel_gpu_freq(rps, rps->cur_freq),
> > -                  intel_gpu_freq(rps, act_freq));
> > +                  intel_gpu_freq(rps, rps->cur_freq), act_freq);
> >         seq_printf(m, "  min hard:%d, soft:%d; max soft:%d, hard:%d\n",
> >                    intel_gpu_freq(rps, rps->min_freq),
> >                    intel_gpu_freq(rps, rps->min_freq_softlimit),
> 
> Good start, but this needs to be rps-centric, please could you pull it
> under intel_rps.c as intel_rps_show (or _dump, or _print), taking a
> struct drm_printer to direct the output.

yes, of course! There are still few rps leftovers around :)

Thanks,
Andi


More information about the Intel-gfx mailing list