[Intel-gfx] [PATCH 2/3] drm/i915/gt: Rename i915_gem_restore_ggtt_mappings() for its new placement

Matthew Auld matthew.william.auld at gmail.com
Thu Jan 30 18:50:21 UTC 2020


On Thu, 30 Jan 2020 at 18:17, Chris Wilson <chris at chris-wilson.co.uk> wrote:
>
> The i915_ggtt now sits beneath gt/ outside of the auspices of gem/ and
> should be given a fresh name to reflect that. We also want to give it a
> name that reflects its role in the system suspend/resume, with the
> intention of pulling together all the GGTT operations (e.g. restoring
> the fence registers once they are pulled under gt/intel_ggtt_detiler.c)
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld at intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_ggtt.c      | 34 +++--------------------
>  drivers/gpu/drm/i915/gt/intel_gtt.h       |  4 +--
>  drivers/gpu/drm/i915/i915_drv.c           |  4 +--
>  drivers/gpu/drm/i915/i915_gem.c           |  2 +-
>  drivers/gpu/drm/i915/selftests/i915_gem.c |  6 ++--
>  5 files changed, 12 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> index f83070b5e6ed..91ec175c38ec 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> @@ -104,27 +104,12 @@ static bool needs_idle_maps(struct drm_i915_private *i915)
>         return IS_GEN(i915, 5) && IS_MOBILE(i915) && intel_vtd_active();
>  }
>
> -static void ggtt_suspend_mappings(struct i915_ggtt *ggtt)
> +void i915_ggtt_suspend(struct i915_ggtt *ggtt)
>  {
> -       struct drm_i915_private *i915 = ggtt->vm.i915;
> -
> -       /*
> -        * Don't bother messing with faults pre GEN6 as we have little
> -        * documentation supporting that it's a good idea.
> -        */
> -       if (INTEL_GEN(i915) < 6)
> -               return;
> -
> -       intel_gt_check_and_clear_faults(ggtt->vm.gt);
> -
>         ggtt->vm.clear_range(&ggtt->vm, 0, ggtt->vm.total);
> -
>         ggtt->invalidate(ggtt);
> -}
>
> -void i915_gem_suspend_gtt_mappings(struct drm_i915_private *i915)
> -{
> -       ggtt_suspend_mappings(&i915->ggtt);
> +       intel_gt_check_and_clear_faults(ggtt->vm.gt);
>  }
>
>  void gen6_ggtt_invalidate(struct i915_ggtt *ggtt)
> @@ -1155,7 +1140,7 @@ void i915_ggtt_disable_guc(struct i915_ggtt *ggtt)
>         ggtt->invalidate(ggtt);
>  }
>
> -static void ggtt_restore_mappings(struct i915_ggtt *ggtt)
> +void i915_ggtt_resume(struct i915_ggtt *ggtt)
>  {
>         struct i915_vma *vma;
>         bool flush = false;
> @@ -1163,8 +1148,6 @@ static void ggtt_restore_mappings(struct i915_ggtt *ggtt)
>
>         intel_gt_check_and_clear_faults(ggtt->vm.gt);
>
> -       mutex_lock(&ggtt->vm.mutex);
> -
>         /* First fill our portion of the GTT with scratch pages */
>         ggtt->vm.clear_range(&ggtt->vm, 0, ggtt->vm.total);
>
> @@ -1191,19 +1174,10 @@ static void ggtt_restore_mappings(struct i915_ggtt *ggtt)
>         atomic_set(&ggtt->vm.open, open);

Wait, why are we playing tricks with vm.open here, I thought that was
only for vma unbind to skip touching the ptes, or is there something
else going on here?


More information about the Intel-gfx mailing list