From: Marek Olšák Date: Mon, 26 Nov 2018 22:16:59 +0000 (-0500) Subject: winsys/amdgpu: use optimal VM alignment for CPU allocations X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72b2b61d8cb57c0357c5e0ece5a818cf38b53fb5;p=mesa.git winsys/amdgpu: use optimal VM alignment for CPU allocations Acked-by: Christian König --- diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index ce6ebb1ac6f..95fb7ef3e36 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -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))