[Intel-gfx] [PATCH 08/21] drm/i915: align the vma start to the largest gtt page size

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Mon Oct 2 12:16:34 UTC 2017


On Fri, 2017-09-29 at 17:10 +0100, Matthew Auld wrote:
> For the 48b PPGTT try to align the vma start address to the required
> page size boundary to guarantee we use said page size in the gtt. If we
> are dealing with multiple page sizes, we can't guarantee anything and
> just align to the largest. For soft pinning and objects which need to be
> tightly packed into the lower 32bits we don't force any alignment.
> 
> v2: various improvements suggested by Chris
> 
> v3: use set_pages and better placement of page_sizes
> 
> v4: prefer upper_32_bits()
> 
> 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>
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> @@ -238,6 +241,8 @@ static void clear_pages(struct i915_vma *vma)
>  		kfree(vma->pages);
>  	}
>  	vma->pages = NULL;
> +
> +	memset(&vma->page_sizes, 0, sizeof(struct i915_page_sizes));

sizeof(vma->page_sizes)

> @@ -2538,6 +2543,9 @@ static int ggtt_set_pages(struct i915_vma *vma)
>  	if (ret)
>  		return ret;
>  
> +	vma->page_sizes.phys = vma->obj->mm.page_sizes.phys;
> +	vma->page_sizes.sg = vma->obj->mm.page_sizes.sg;

Hmm, are we not able to assign vma->page_sizes =
vma->obj->mm.page_sizes?

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list