[Intel-gfx] [PATCH 9/9] drm/i915: prefer resource_size_t for everything stolen

Chris Wilson chris at chris-wilson.co.uk
Fri Nov 24 22:25:07 UTC 2017


Quoting Matthew Auld (2017-11-24 21:29:30)
> Keeps things consistent now that we make use of struct resource. This
> should keep us covered in case we ever get huge amounts of stolen
> memory.
> 
> v2: bunch of missing conversions (Chris)
> 
> 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>
> ---
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index 2b7af60dfce0..fca56ec9913d 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -76,10 +76,10 @@ void i915_gem_stolen_remove_node(struct drm_i915_private *dev_priv,
>         mutex_unlock(&dev_priv->mm.stolen_lock);
>  }
>  
> -static dma_addr_t i915_stolen_to_dma(struct drm_i915_private *dev_priv)
> +static resource_size_t i915_stolen_to_dma(struct drm_i915_private *dev_priv)
>  {
>         struct i915_ggtt *ggtt = &dev_priv->ggtt;
> -       dma_addr_t base = intel_graphics_stolen_res.start;
> +       resource_size_t base = intel_graphics_stolen_res.start;
>         struct resource *r;
>  
>         if (base == 0 || add_overflows(base, ggtt->stolen_size))

It's no longer to_dma anymore. The point of the function was to pretend
phys_addr_t was magically transformed into dma_addr_t.

We should now be at the point where this is just
	return intel_graphics_stolen_res;
-Chris


More information about the Intel-gfx mailing list