[Intel-gfx] [PATCH 09/21] drm/i915/gtt: Rename unmap_and_free_px to free_px

Michel Thierry michel.thierry at intel.com
Tue Jun 2 06:08:00 PDT 2015


On 5/22/2015 6:05 PM, Mika Kuoppala wrote:
> All the paging structures are now similar and mapped for
> dma. The unmapping is taken care of by common accessors, so
> don't overload the reader with such details.
>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem_gtt.c | 32 +++++++++++++++-----------------
>   1 file changed, 15 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 1e1a7a1..f58aa63 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -330,8 +330,7 @@ static void cleanup_page_dma(struct drm_device *dev, struct i915_page_dma *p)
>          memset(p, 0, sizeof(*p));
>   }
>
> -static void unmap_and_free_pt(struct i915_page_table *pt,
> -                              struct drm_device *dev)
> +static void free_pt(struct drm_device *dev, struct i915_page_table *pt)
>   {
>          cleanup_page_dma(dev, &pt->base);
>          kfree(pt->used_ptes);
> @@ -387,8 +386,7 @@ fail_bitmap:
>          return ERR_PTR(ret);
>   }
>
> -static void unmap_and_free_pd(struct i915_page_directory *pd,
> -                             struct drm_device *dev)
> +static void free_pd(struct drm_device *dev, struct i915_page_directory *pd)

alloc_pd has a goto label with this same name.
Can you change the labels from free_bitmap & free_pd to fail_page_m & 
fail_bitmap in this patch? (alloc_pt use these names)

@@ -407,17 +407,17 @@ static struct i915_page_directory *alloc_pd(struct 
drm_device *dev)
      pd->used_pdes = kcalloc(BITS_TO_LONGS(I915_PDES),
                  sizeof(*pd->used_pdes), GFP_KERNEL);
      if (!pd->used_pdes)
-        goto free_pd;
+        goto fail_bitmap;

      ret = setup_page_dma(dev, &pd->base);
      if (ret)
-        goto free_bitmap;
+        goto fail_page_m;

      return pd;

-free_bitmap:
+fail_page_m:
      kfree(pd->used_pdes);
-free_pd:
+fail_bitmap:
      kfree(pd);

      return ERR_PTR(ret);



More information about the Intel-gfx mailing list