[PATCH 1/8] drm/i915/gtt: No need to zero the table for page dirs
Mika Kuoppala
mika.kuoppala at linux.intel.com
Mon Jun 10 12:08:58 UTC 2019
We set them to scratch right after allocation so prevent
useless zeroing before.
v2: zero in __pdp_init
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 2e15850bd987..6d0bc741e68f 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -685,7 +685,7 @@ static struct i915_page_directory *alloc_pd(struct i915_address_space *vm)
{
struct i915_page_directory *pd;
- pd = kzalloc(sizeof(*pd), I915_GFP_ALLOW_FAIL);
+ pd = kmalloc(sizeof(*pd), I915_GFP_ALLOW_FAIL);
if (unlikely(!pd))
return ERR_PTR(-ENOMEM);
@@ -724,6 +724,8 @@ static int __pdp_init(struct i915_address_space *vm,
if (unlikely(!pdp->page_directory))
return -ENOMEM;
+ pdp->used_pdpes = 0;
+
memset_p((void **)pdp->page_directory, vm->scratch_pd, pdpes);
atomic_set(&pdp->used_pdpes, 0);
@@ -745,7 +747,7 @@ alloc_pdp(struct i915_address_space *vm)
GEM_BUG_ON(!i915_vm_is_4lvl(vm));
- pdp = kzalloc(sizeof(*pdp), GFP_KERNEL);
+ pdp = kmalloc(sizeof(*pdp), GFP_KERNEL);
if (!pdp)
return ERR_PTR(-ENOMEM);
--
2.17.1
More information about the Intel-gfx-trybot
mailing list