Re: [RFC 26/28] drm/i915: Store ggtt pointer in intel_gt

Tvrtko Ursulin
2019-06-13T15:55:03Z

On 13/06/2019 16:42, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-06-13 16:19:02)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> This will become useful in the following patch.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@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?

Moving as removing? That looks like a huge job. I can try and asses
exactly how big but I was hoping that I don't have to do everything in
one go.

>> 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.

A bit yes. I think I can work around it with some refactoring.

Regards,

Tvrtko