Commit 72230b87 authored by Mika Kuoppala's avatar Mika Kuoppala Committed by Chris Wilson

drm/i915/gtt: Tear down setup and cleanup macros for page dma

We don't use common codepaths to setup and cleanup page
directories vs page tables. So their setup and cleanup macros
are of no use and can be removed.
Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190705215204.4559-2-chris@chris-wilson.co.uk
parent f20f272f
...@@ -594,8 +594,6 @@ static void cleanup_page_dma(struct i915_address_space *vm, ...@@ -594,8 +594,6 @@ static void cleanup_page_dma(struct i915_address_space *vm,
#define kmap_atomic_px(px) kmap_atomic(px_base(px)->page) #define kmap_atomic_px(px) kmap_atomic(px_base(px)->page)
#define setup_px(vm, px) setup_page_dma((vm), px_base(px))
#define cleanup_px(vm, px) cleanup_page_dma((vm), px_base(px))
#define fill_px(vm, px, v) fill_page_dma((vm), px_base(px), (v)) #define fill_px(vm, px, v) fill_page_dma((vm), px_base(px), (v))
#define fill32_px(vm, px, v) fill_page_dma_32((vm), px_base(px), (v)) #define fill32_px(vm, px, v) fill_page_dma_32((vm), px_base(px), (v))
...@@ -697,7 +695,7 @@ static struct i915_page_table *alloc_pt(struct i915_address_space *vm) ...@@ -697,7 +695,7 @@ static struct i915_page_table *alloc_pt(struct i915_address_space *vm)
if (unlikely(!pt)) if (unlikely(!pt))
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
if (unlikely(setup_px(vm, pt))) { if (unlikely(setup_page_dma(vm, &pt->base))) {
kfree(pt); kfree(pt);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
...@@ -709,7 +707,7 @@ static struct i915_page_table *alloc_pt(struct i915_address_space *vm) ...@@ -709,7 +707,7 @@ static struct i915_page_table *alloc_pt(struct i915_address_space *vm)
static void free_pt(struct i915_address_space *vm, struct i915_page_table *pt) static void free_pt(struct i915_address_space *vm, struct i915_page_table *pt)
{ {
cleanup_px(vm, pt); cleanup_page_dma(vm, &pt->base);
kfree(pt); kfree(pt);
} }
...@@ -752,7 +750,7 @@ static struct i915_page_directory *alloc_pd(struct i915_address_space *vm) ...@@ -752,7 +750,7 @@ static struct i915_page_directory *alloc_pd(struct i915_address_space *vm)
if (unlikely(!pd)) if (unlikely(!pd))
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
if (unlikely(setup_px(vm, pd))) { if (unlikely(setup_page_dma(vm, &pd->base))) {
kfree(pd); kfree(pd);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
...@@ -769,7 +767,7 @@ static void free_pd(struct i915_address_space *vm, ...@@ -769,7 +767,7 @@ static void free_pd(struct i915_address_space *vm,
struct i915_page_directory *pd) struct i915_page_directory *pd)
{ {
if (likely(pd_has_phys_page(pd))) if (likely(pd_has_phys_page(pd)))
cleanup_px(vm, pd); cleanup_page_dma(vm, &pd->base);
kfree(pd); kfree(pd);
} }
...@@ -1649,7 +1647,7 @@ static struct i915_ppgtt *gen8_ppgtt_create(struct drm_i915_private *i915) ...@@ -1649,7 +1647,7 @@ static struct i915_ppgtt *gen8_ppgtt_create(struct drm_i915_private *i915)
} }
if (i915_vm_is_4lvl(&ppgtt->vm)) { if (i915_vm_is_4lvl(&ppgtt->vm)) {
err = setup_px(&ppgtt->vm, ppgtt->pd); err = setup_page_dma(&ppgtt->vm, &ppgtt->pd->base);
if (err) if (err)
goto err_free_pdp; goto err_free_pdp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment