Quoting Matthew Auld (2017-11-24 21:29:27)
> v2: check range_overflow when writing to 32b registers (Chris)
>     pepper in some comments (Chris)
> 
> Signed-off-by: Matthew Auld <matthew.a...@intel.com>
> Cc: Joonas Lahtinen <joonas.lahti...@linux.intel.com>
> Cc: Chris Wilson <ch...@chris-wilson.co.uk>
> Cc: Paulo Zanoni <paulo.r.zan...@intel.com>
> ---
> @@ -352,11 +352,14 @@ int i915_gem_init_stolen(struct drm_i915_private 
> *dev_priv)
>         if (ggtt->stolen_size == 0)
>                 return 0;
>  
> -       dev_priv->mm.stolen_base = i915_stolen_to_dma(dev_priv);
> -       if (dev_priv->mm.stolen_base == 0)
> +       dev_priv->dsm.start = i915_stolen_to_dma(dev_priv);
> +       if (dev_priv->dsm.start == 0)
>                 return 0;
>  
> -       stolen_top = dev_priv->mm.stolen_base + ggtt->stolen_size;
> +       dev_priv->dsm.end = dev_priv->dsm.start + ggtt->stolen_size - 1;
> +       dev_priv->dsm.flags = IORESOURCE_MEM;

I'm confused. I thought we exported the stolen resource from x86/quirks
so that we could use it here? I wasn't expecting to keep a bunch of
intermediates.

> +
> +       stolen_top = dev_priv->dsm.end + 1;
>         reserved_base = 0;
>         reserved_size = 0;
>  

> @@ -460,7 +463,7 @@ i915_pages_create_for_stolen(struct drm_device *dev,
>         sg->offset = 0;
>         sg->length = size;

For safety sake we should have a GEM_BUG_ON(range_overflow(offset, size,
resource_size(dsm));
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to