[Intel-gfx] [PATCH 5/6] drm/i915: make mappable struct resource centric

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 23 13:06:16 UTC 2017


Quoting Matthew Auld (2017-11-22 21:19:19)
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/gvt.h                |  2 +-
>  drivers/gpu/drm/i915/i915_drv.c               |  2 +-
>  drivers/gpu/drm/i915/i915_gem.c               |  8 ++++----
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c    |  2 +-
>  drivers/gpu/drm/i915/i915_gem_gtt.c           | 28 ++++++++++++++++-----------
>  drivers/gpu/drm/i915/i915_gem_gtt.h           |  4 ++--
>  drivers/gpu/drm/i915/i915_gpu_error.c         |  2 +-
>  drivers/gpu/drm/i915/i915_vma.c               |  2 +-
>  drivers/gpu/drm/i915/intel_display.c          |  2 +-
>  drivers/gpu/drm/i915/intel_overlay.c          |  4 ++--
>  drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |  4 ++--
>  drivers/gpu/drm/i915/selftests/mock_gtt.c     |  3 ++-
>  12 files changed, 35 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
> index 028d00e61bad..601e5fee8957 100644
> --- a/drivers/gpu/drm/i915/gvt/gvt.h
> +++ b/drivers/gpu/drm/i915/gvt/gvt.h
> @@ -336,7 +336,7 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt);
>  
>  /* Aperture/GM space definitions for GVT device */
>  #define gvt_aperture_sz(gvt)     (gvt->dev_priv->ggtt.mappable_size)
> -#define gvt_aperture_pa_base(gvt) (gvt->dev_priv->ggtt.mappable_base)
> +#define gvt_aperture_pa_base(gvt) (gvt->dev_priv->ggtt.mappable.start)
>  
>  #define gvt_ggtt_gm_sz(gvt)      (gvt->dev_priv->ggtt.base.total)
>  #define gvt_ggtt_sz(gvt) \
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index e1bb0c8822aa..be29895a56f6 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -728,7 +728,7 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>         if (!ap)
>                 return -ENOMEM;
>  
> -       ap->ranges[0].base = ggtt->mappable_base;
> +       ap->ranges[0].base = ggtt->mappable.start;
>         ap->ranges[0].size = ggtt->mappable_size;

Do we need a type overflow check here? Probably.
-Chris


More information about the Intel-gfx mailing list