[Intel-gfx] [RFC 26/28] drm/i915: Store ggtt pointer in intel_gt

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 13 15:42:18 UTC 2019


Quoting Tvrtko Ursulin (2019-06-13 16:19:02)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> This will become useful in the following patch.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt_types.h | 2 ++
>  drivers/gpu/drm/i915/i915_gem_gtt.c      | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> index 99e30f8cfbe0..c909aae6e4b3 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
> @@ -18,11 +18,13 @@
>  #include "intel_wakeref.h"
>  
>  struct drm_i915_private;
> +struct i915_ggtt;
>  struct intel_uncore;
>  
>  struct intel_gt {
>         struct drm_i915_private *i915;
>         struct intel_uncore *uncore;
> +       struct i915_ggtt *ggtt;

But not moving i915->ggtt itself?

>         struct i915_gt_timelines {
>                 struct mutex mutex; /* protects list, tainted by GPU */
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index ea276ed9021a..9aa25770081c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3618,6 +3618,7 @@ static int ggtt_init_hw(struct i915_ggtt *ggtt)
>         i915_address_space_init(vm, VM_CLASS_GGTT);
>  
>         vm->is_ggtt = true;
> +       vm->gt->ggtt = ggtt;

This looks very much to be a layer violation.
-Chris


More information about the Intel-gfx mailing list