From dbf72bdd3dda73384381a9ae8a94b522b7f786c2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 3 Feb 2009 09:48:27 +1000 Subject: [PATCH] radeon_bo: align size of bo to page size. This is really required for the VRAM allocator upload function. --- src/mesa/drivers/dri/radeon/radeon_bo_legacy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index f782d96900c..07af01fc402 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -260,6 +260,9 @@ static struct bo_legacy *bo_allocate(struct bo_manager_legacy *boml, uint32_t flags) { struct bo_legacy *bo_legacy; + uint32_t pgsize = getpagesize() - 1; + + size = (size + pgsize) & ~pgsize; bo_legacy = (struct bo_legacy*)calloc(1, sizeof(struct bo_legacy)); if (bo_legacy == NULL) { -- 2.30.2