[Intel-gfx] [PATCH 18/18] drm/i915/gtt: Reorder page alloc/free/init functions

Daniel Vetter daniel at ffwll.ch
Fri Jun 26 02:11:41 PDT 2015


On Thu, Jun 25, 2015 at 06:35:20PM +0300, Mika Kuoppala wrote:
> Maintain base page handling functions in order of
> alloc, free, init. No functional changes.
> 
> v2: s/Introduce/Maintain (Michel)
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
> Reviewed-by: Michel Thierry <michel.thierry at intel.com>

Conflicts since I didn't apply the scratch merging. Same comment about
adding _scratch to these functions (where it makes sense ofc). I merged
all the other reviewed patches to dinq.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 54 ++++++++++++++++++-------------------
>  1 file changed, 27 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index dee25ad..b08f623 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -384,24 +384,6 @@ static void fill_page_dma_32(struct drm_device *dev, struct i915_page_dma *p,
>  	fill_page_dma(dev, p, v);
>  }
>  
> -static void free_pt(struct drm_device *dev, struct i915_page_table *pt)
> -{
> -	cleanup_px(dev, pt);
> -	kfree(pt->used_ptes);
> -	kfree(pt);
> -}
> -
> -static void gen8_initialize_pt(struct i915_address_space *vm,
> -			       struct i915_page_table *pt)
> -{
> -	gen8_pte_t scratch_pte;
> -
> -	scratch_pte = gen8_pte_encode(px_dma(vm->scratch_page),
> -				      I915_CACHE_LLC, true);
> -
> -	fill_px(vm->dev, pt, scratch_pte);
> -}
> -
>  static struct i915_page_table *alloc_pt(struct drm_device *dev)
>  {
>  	struct i915_page_table *pt;
> @@ -433,6 +415,24 @@ fail_bitmap:
>  	return ERR_PTR(ret);
>  }
>  
> +static void free_pt(struct drm_device *dev, struct i915_page_table *pt)
> +{
> +	cleanup_px(dev, pt);
> +	kfree(pt->used_ptes);
> +	kfree(pt);
> +}
> +
> +static void gen8_initialize_pt(struct i915_address_space *vm,
> +			       struct i915_page_table *pt)
> +{
> +	gen8_pte_t scratch_pte;
> +
> +	scratch_pte = gen8_pte_encode(px_dma(vm->scratch_page),
> +				      I915_CACHE_LLC, true);
> +
> +	fill_px(vm->dev, pt, scratch_pte);
> +}
> +
>  static void gen6_initialize_pt(struct i915_address_space *vm,
>  			       struct i915_page_table *pt)
>  {
> @@ -444,15 +444,6 @@ static void gen6_initialize_pt(struct i915_address_space *vm,
>  	fill32_px(vm->dev, pt, scratch_pte);
>  }
>  
> -static void free_pd(struct drm_device *dev, struct i915_page_directory *pd)
> -{
> -	if (px_page(pd)) {
> -		cleanup_px(dev, pd);
> -		kfree(pd->used_pdes);
> -		kfree(pd);
> -	}
> -}
> -
>  static struct i915_page_directory *alloc_pd(struct drm_device *dev)
>  {
>  	struct i915_page_directory *pd;
> @@ -481,6 +472,15 @@ fail_bitmap:
>  	return ERR_PTR(ret);
>  }
>  
> +static void free_pd(struct drm_device *dev, struct i915_page_directory *pd)
> +{
> +	if (px_page(pd)) {
> +		cleanup_px(dev, pd);
> +		kfree(pd->used_pdes);
> +		kfree(pd);
> +	}
> +}
> +
>  static void gen8_initialize_pd(struct i915_address_space *vm,
>  			       struct i915_page_directory *pd)
>  {
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list