Re: [RFC 01/28] drm/i915: Convert intel_vgt_(de)balloon to uncore

Chris Wilson
2019-06-13T13:42:08Z

Quoting Tvrtko Ursulin (2019-06-13 14:35:12)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> More removal of implicit dev_priv from using old mmio accessors.
>
> Furthermore these calls really operate on ggtt so it logically makes sense
> if they take it as parameter.

Yeah, I had expected them to take a vgpu, but these are functions that
steal from the global GTT.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++--
> drivers/gpu/drm/i915/i915_vgpu.c | 24 ++++++++++++++----------
> drivers/gpu/drm/i915/i915_vgpu.h | 4 ++--
> 3 files changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 7be72388b052..90d9669ff313 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -2859,7 +2859,7 @@ int i915_gem_init_ggtt(struct drm_i915_private *dev_priv)
> ggtt->pin_bias = max_t(u32, I915_GTT_PAGE_SIZE,
> intel_wopcm_guc_size(&dev_priv->wopcm));
>
> - ret = intel_vgt_balloon(dev_priv);
> + ret = intel_vgt_balloon(ggtt);
> if (ret)
> return ret;
>
> @@ -2930,7 +2930,7 @@ void i915_ggtt_cleanup_hw(struct drm_i915_private *dev_priv)
> ggtt_release_guc_top(ggtt);
>
> if (drm_mm_initialized(&ggtt->vm.mm)) {
> - intel_vgt_deballoon(dev_priv);
> + intel_vgt_deballoon(ggtt);

As noted elsewhere, the init/fini sequence here is skewiff.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris