[Mesa-dev] [PATCH 5/7] winsys/amdgpu: use >= instead of > for VM address alignment

Marek Olšák maraeo at gmail.com
Fri Nov 23 23:40:50 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 36e2c4ec0dc..dd6c56600b7 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -453,21 +453,21 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws,
       fprintf(stderr, "amdgpu:    alignment : %u bytes\n", alignment);
       fprintf(stderr, "amdgpu:    domains   : %u\n", initial_domain);
       goto error_bo_alloc;
    }
 
    va_gap_size = ws->check_vm ? MAX2(4 * alignment, 64 * 1024) : 0;
 
    unsigned vm_alignment = alignment;
 
    /* Increase the VM alignment for faster address translation. */
-   if (size > ws->info.pte_fragment_size)
+   if (size >= ws->info.pte_fragment_size)
       vm_alignment = MAX2(vm_alignment, ws->info.pte_fragment_size);
 
    r = amdgpu_va_range_alloc(ws->dev, amdgpu_gpu_va_range_general,
                              size + va_gap_size, vm_alignment, 0, &va, &va_handle,
                              (flags & RADEON_FLAG_32BIT ? AMDGPU_VA_RANGE_32_BIT : 0) |
 			     AMDGPU_VA_RANGE_HIGH);
    if (r)
       goto error_va_alloc;
 
    unsigned vm_flags = AMDGPU_VM_PAGE_READABLE |
-- 
2.17.1



More information about the mesa-dev mailing list