[Intel-gfx] [PATCH 2/7] drm/i915: do not map aperture if it is not available.

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 29 10:04:17 UTC 2019


Quoting Matthew Auld (2019-10-29 09:58:51)
> From: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> 
> Skip both setup and cleanup of the aperture mapping if the HW doesn't
> have an aperture bar.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 31 ++++++++++++++++++-----------
>  1 file changed, 19 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index eebc7fee81e2..73dad8c6acc2 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -2770,7 +2770,9 @@ static void ggtt_cleanup_hw(struct i915_ggtt *ggtt)
>         i915_address_space_fini(&ggtt->vm);
>  
>         arch_phys_wc_del(ggtt->mtrr);
> -       io_mapping_fini(&ggtt->iomap);
> +
> +       if (ggtt->iomap.size)
> +               io_mapping_fini(&ggtt->iomap);

Marginally annoying we had not made io_mapping_fini() nop-proof.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list