From: Marek Olšák Date: Tue, 10 Feb 2015 21:27:21 +0000 (+0100) Subject: winsys/radeon: allow unaligned size for user-memory buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=064847122a4c6dae6fdee41a4862948352cd929f;p=mesa.git winsys/radeon: allow unaligned size for user-memory buffers This is not required, but being user-friendly doesn't hurt. Reviewed-by: Christian König --- diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 8f4b13576b9..e3b2c228378 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -883,7 +883,7 @@ static struct pb_buffer *radeon_winsys_bo_from_ptr(struct radeon_winsys *rws, memset(&args, 0, sizeof(args)); args.addr = (uintptr_t)pointer; - args.size = size; + args.size = align(size, sysconf(_SC_PAGE_SIZE)); args.flags = RADEON_GEM_USERPTR_ANONONLY | RADEON_GEM_USERPTR_VALIDATE | RADEON_GEM_USERPTR_REGISTER;