winsys/radeon: allow unaligned size for user-memory buffers
authorMarek Olšák <marek.olsak@amd.com>
Tue, 10 Feb 2015 21:27:21 +0000 (22:27 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 17 Feb 2015 16:31:48 +0000 (17:31 +0100)
This is not required, but being user-friendly doesn't hurt.

Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/winsys/radeon/drm/radeon_drm_bo.c

index 8f4b13576b935e9a8da4a0555311a74e1bbafdec..e3b2c228378ef90da74e8e776da4f7ec706eac22 100644 (file)
@@ -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;