From cb85630c02ddb46f168064befb2296d46b69f57a Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 30 Jan 2009 11:18:54 +1000 Subject: nouveau: bring in new mm api definitions, without the actual mm code Use of the new bits is guarded with a mm_enabled=0 hardcode. --- shared-core/nouveau_mem.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'shared-core/nouveau_mem.c') diff --git a/shared-core/nouveau_mem.c b/shared-core/nouveau_mem.c index d79c1a52..0d590276 100644 --- a/shared-core/nouveau_mem.c +++ b/shared-core/nouveau_mem.c @@ -587,18 +587,21 @@ nouveau_mem_alloc(struct drm_device *dev, int alignment, uint64_t size, * Make things easier on ourselves: all allocations are page-aligned. * We need that to map allocated regions into the user space */ - if (alignment < PAGE_SHIFT) - alignment = PAGE_SHIFT; + if (alignment < PAGE_SIZE) + alignment = PAGE_SIZE; /* Align allocation sizes to 64KiB blocks on G8x. We use a 64KiB * page size in the GPU VM. */ if (flags & NOUVEAU_MEM_FB && dev_priv->card_type >= NV_50) { size = (size + 65535) & ~65535; - if (alignment < 16) - alignment = 16; + if (alignment < 65536) + alignment = 65536; } + /* Further down wants alignment in pages, not bytes */ + alignment >>= PAGE_SHIFT; + /* * Warn about 0 sized allocations, but let it go through. It'll return 1 page */ -- cgit v1.2.3