Re: [PATCH 3/3] drm/i915: Move dev_priv->pm_i{m, e}r into intel_gt

Chris Wilson
2019-07-02T10:32:31Z

Quoting Tvrtko Ursulin (2019-07-02 11:23:13)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> PM interrupts belong to the GT so move the variables to be inside
> struct intel_gt.

I even had gt_pm patches kicking around :-p
Which are in desperate need of revival. :-(

> Co-authored-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Andi Shyti <andi.shyti@intel.com>

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/gt/intel_gt_types.h | 3 +
> drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 4 +-
> drivers/gpu/drm/i915/i915_drv.h | 2 -
> drivers/gpu/drm/i915/i915_irq.c | 121 +++++++++++----------
> drivers/gpu/drm/i915/i915_irq.h | 4 +-
> 5 files changed, 71 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> index c03e56628ee2..37da428bef62 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> @@ -55,6 +55,9 @@ struct intel_gt {
> ktime_t last_init_time;
>
> struct i915_vma *scratch;
> +
> + u32 pm_imr;
> + u32 pm_ier;

Fwiw, I do intend to bring back gt_pm and move all the rps/ips tracking
underneath it and extract it from i915_irq.c & intel_pm.c into gt/

We have a long standing bugs in race conditions between the pm
interrupts and the rps worker, plus overdue work to let userspace make
fine grained suggestions for frequency/power control.
-Chris