summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-10-13 15:44:52 +1000
committerDave Airlie <airlied@redhat.com>2008-10-13 15:44:52 +1000
commit5184c412b17e5319aefbc61ccdfd060608d1d6bd (patch)
tree83f6e1688bf6f65dd1d21886ed3bd559e27ad9fe
parent1ca0e2ac03b4fd95ee9cd2dbe82bb7a0e9c1614d (diff)
radeon: align up the allocations for vramr300-bufmgr
The blits later on assume a 4k alignment without ever enforcing it. the kernel was producing wierd debug messages
-rw-r--r--src/mesa/drivers/dri/r300/r300_mem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_mem.c b/src/mesa/drivers/dri/r300/r300_mem.c
index cb5ca23f231..46dab3464e4 100644
--- a/src/mesa/drivers/dri/r300/r300_mem.c
+++ b/src/mesa/drivers/dri/r300/r300_mem.c
@@ -591,6 +591,9 @@ static dri_bo *vram_alloc(radeon_bufmgr_classic *bufmgr, const char *name,
unsigned long size, unsigned int alignment)
{
radeon_bo_vram* bo = (radeon_bo_vram*)calloc(1, sizeof(radeon_bo_vram));
+ uint32_t pgsize = getpagesize() - 1;
+
+ size = (size + pgsize) & ~pgsize;
bo->base.functions = &vram_bo_functions;
bo->base.base.virtual = malloc(size);