Skip to content

Commit

Permalink
drm/nouveau/mmu: swap out round for ALIGN
Browse files Browse the repository at this point in the history
Rounding value is guaranteed to be power-of-two, so this is better
anyway.

Fixes build on 32-bit.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Nov 2, 2017
1 parent 46bda4f commit 6497c2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,12 +1349,12 @@ nvkm_vmm_get_locked(struct nvkm_vmm *vmm, bool getref, bool mapref, bool sparse,

addr = this->addr;
if (vmm->func->page_block && prev && prev->page != p)
addr = roundup(addr, vmm->func->page_block);
addr = ALIGN(addr, vmm->func->page_block);
addr = ALIGN(addr, 1ULL << align);

tail = this->addr + this->size;
if (vmm->func->page_block && next && next->page != p)
tail = rounddown(tail, vmm->func->page_block);
tail = ALIGN_DOWN(addr, vmm->func->page_block);

if (addr <= tail && tail - addr >= size) {
rb_erase(&this->tree, &vmm->free);
Expand Down

0 comments on commit 6497c2b

Please sign in to comment.