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

Michel Thierry michel.thierry at intel.com
Wed Jun 3 10:14:25 PDT 2015


On 5/22/2015 6:05 PM, Mika Kuoppala wrote:
> Introduce base page handling functions in order of
> alloc, free, init. No functional changes.

Can you change this sentence like this?

   _Keep/Maintain_ base page handling functions in order of
   alloc, free and init. No functional changes.

_Introduce_ made me think there was something new in this patch.


>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>

Reviewed-by: Michel Thierry <michel.thierry at intel.com>

> ---
>   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 95c39e5..24f31ad 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -381,24 +381,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;
> @@ -430,6 +412,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)
>   {
> @@ -441,15 +441,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;
> @@ -478,6 +469,15 @@ free_pd:
>          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
>


More information about the Intel-gfx mailing list