From: Dave Airlie Date: Mon, 2 Feb 2009 23:48:27 +0000 (+1000) Subject: radeon_bo: align size of bo to page size. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dbf72bdd3dda73384381a9ae8a94b522b7f786c2;p=mesa.git radeon_bo: align size of bo to page size. This is really required for the VRAM allocator upload function. --- 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) {