[Intel-gfx] [RFC 3/4] drm/i915/pmu: Convert sampling to gt

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 1 10:29:31 UTC 2019


Quoting Tvrtko Ursulin (2019-08-01 11:18:24)
>  static void
> -frequency_sample(struct drm_i915_private *dev_priv, unsigned int period_ns)
> +frequency_sample(struct intel_gt *gt, unsigned int period_ns)
>  {
> -       if (dev_priv->pmu.enable &
> -           config_enabled_mask(I915_PMU_ACTUAL_FREQUENCY)) {
> +       struct drm_i915_private *i915 = gt->i915;
> +       struct intel_uncore *uncore = gt->uncore;
> +       struct i915_pmu *pmu = &i915->pmu;
> +
> +       if (pmu->enable & config_enabled_mask(I915_PMU_ACTUAL_FREQUENCY)) {
>                 u32 val;
>  
> -               val = dev_priv->gt_pm.rps.cur_freq;
> -               if (dev_priv->gt.awake) {
> +               val = i915->gt_pm.rps.cur_freq;
> +               if (gt->awake) {
>                         intel_wakeref_t wakeref;
>  
> -                       with_intel_runtime_pm_if_in_use(&dev_priv->runtime_pm,
> +                       with_intel_runtime_pm_if_in_use(&i915->runtime_pm,
>                                                         wakeref) {

We can replace this wakeref with
	if (intel_gt_pm_get_if_awake()) {
instead of if (gt->awake);

Which reminds me I had some patches to change the rc6 sampling over
runtime suspend -- from your last vacation! My timing is perfect.
-Chris


More information about the Intel-gfx mailing list