[Intel-gfx] [PATCH 2/6] drm/i915/gt: Move rps.enabled/active to flags

Chris Wilson chris at chris-wilson.co.uk
Mon Apr 27 08:22:29 UTC 2020


Quoting Andi Shyti (2020-04-27 00:15:56)
> Hi Chris,
> 
> >       intel_uncore_forcewake_get(uncore, FORCEWAKE_ALL);
> >       if (IS_CHERRYVIEW(i915))
> > -             rps->enabled = chv_rps_enable(rps);
> > +             enabled = chv_rps_enable(rps);
> >       else if (IS_VALLEYVIEW(i915))
> > -             rps->enabled = vlv_rps_enable(rps);
> > +             enabled = vlv_rps_enable(rps);
> >       else if (INTEL_GEN(i915) >= 9)
> > -             rps->enabled = gen9_rps_enable(rps);
> > +             enabled = gen9_rps_enable(rps);
> >       else if (INTEL_GEN(i915) >= 8)
> > -             rps->enabled = gen8_rps_enable(rps);
> > +             enabled = gen8_rps_enable(rps);
> >       else if (INTEL_GEN(i915) >= 6)
> > -             rps->enabled = gen6_rps_enable(rps);
> > +             enabled = gen6_rps_enable(rps);
> >       else if (IS_IRONLAKE_M(i915))
> > -             rps->enabled = gen5_rps_enable(rps);
> > +             enabled = gen5_rps_enable(rps);
> >       intel_uncore_forcewake_put(uncore, FORCEWAKE_ALL);
> > -     if (!rps->enabled)
> > +     if (!enabled || rps->max_freq <= rps->min_freq)
> 
> isn't this a bit out of context? I don't think the above
> functions have any effect on max_freq and min freq.

The question is whether or not we want to enable dynamic reclocking if
the range is 0. The answer to that, is definitely no -- just look at all
the selftests that do not work (because the frequency cannot be changed)!

An alternative would be to

if (rps->max_freq <= rpq->min_freq)
	/* leave disabled, no room for dynamic reclocking */
else if ...
else
	MISSING_CASE(INTEL_GEN(i915));
-Chris


More information about the Intel-gfx mailing list