Skip to content

Commit

Permalink
drm/nouveau: use vmalloc for pgt allocation
Browse files Browse the repository at this point in the history
Page tables on nv50 take 48kB, which can be hard to allocate in one piece.
Let's use vmalloc.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: stable@vger.kernel.org [3.7+]
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Marcin Slusarz authored and Ben Skeggs committed Jul 5, 2013
1 parent 5c5ae71 commit d005f51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/nouveau/core/subdev/vm/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ nouveau_vm_create(struct nouveau_vmmgr *vmm, u64 offset, u64 length,
vm->fpde = offset >> (vmm->pgt_bits + 12);
vm->lpde = (offset + length - 1) >> (vmm->pgt_bits + 12);

vm->pgt = kcalloc(vm->lpde - vm->fpde + 1, sizeof(*vm->pgt), GFP_KERNEL);
vm->pgt = vzalloc((vm->lpde - vm->fpde + 1) * sizeof(*vm->pgt));
if (!vm->pgt) {
kfree(vm);
return -ENOMEM;
Expand All @@ -374,7 +374,7 @@ nouveau_vm_create(struct nouveau_vmmgr *vmm, u64 offset, u64 length,
ret = nouveau_mm_init(&vm->mm, mm_offset >> 12, mm_length >> 12,
block >> 12);
if (ret) {
kfree(vm->pgt);
vfree(vm->pgt);
kfree(vm);
return ret;
}
Expand Down Expand Up @@ -450,7 +450,7 @@ nouveau_vm_del(struct nouveau_vm *vm)
}

nouveau_mm_fini(&vm->mm);
kfree(vm->pgt);
vfree(vm->pgt);
kfree(vm);
}

Expand Down

0 comments on commit d005f51

Please sign in to comment.