Re: [PATCH 6/9] drm/i915: make dsm struct resource centric

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.auld@xxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
> ---
> @@ -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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux