winsys/amdgpu: use optimal VM alignment for CPU allocations
authorMarek Olšák <marek.olsak@amd.com>
Mon, 26 Nov 2018 22:16:59 +0000 (17:16 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 29 Nov 2018 01:20:27 +0000 (20:20 -0500)
Acked-by: Christian König <christian.koenig@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_bo.c

index ce6ebb1ac6ff9aa2b2e54e23ff7c3c4f11d71edc..95fb7ef3e365c4969e872925b8f02992de1efe1e 100644 (file)
@@ -1585,8 +1585,10 @@ static struct pb_buffer *amdgpu_bo_from_ptr(struct radeon_winsys *rws,
         goto error;
 
     if (amdgpu_va_range_alloc(ws->dev, amdgpu_gpu_va_range_general,
-                              aligned_size, 1 << 12, 0, &va, &va_handle,
-                             AMDGPU_VA_RANGE_HIGH))
+                              aligned_size,
+                              amdgpu_get_optimal_vm_alignment(ws, aligned_size,
+                                                              ws->info.gart_page_size),
+                              0, &va, &va_handle, AMDGPU_VA_RANGE_HIGH))
         goto error_va_alloc;
 
     if (amdgpu_bo_va_op(buf_handle, 0, aligned_size, va, 0, AMDGPU_VA_OP_MAP))