aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'amdgpu/amdgpu_vamgr.c')
-rw-r--r--amdgpu/amdgpu_vamgr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index b5d330f6..eef8a71a 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -46,11 +46,12 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
46 return -EINVAL; 46 return -EINVAL;
47} 47}
48 48
49static void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, struct amdgpu_device *dev) 49static void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
50 uint64_t max, uint64_t alignment)
50{ 51{
51 mgr->va_offset = dev->dev_info.virtual_address_offset; 52 mgr->va_offset = start;
52 mgr->va_max = dev->dev_info.virtual_address_max; 53 mgr->va_max = max;
53 mgr->va_alignment = dev->dev_info.virtual_address_alignment; 54 mgr->va_alignment = alignment;
54 55
55 list_inithead(&mgr->va_holes); 56 list_inithead(&mgr->va_holes);
56 pthread_mutex_init(&mgr->bo_va_mutex, NULL); 57 pthread_mutex_init(&mgr->bo_va_mutex, NULL);
@@ -73,7 +74,9 @@ amdgpu_vamgr_get_global(struct amdgpu_device *dev)
73 ref = atomic_inc_return(&vamgr.refcount); 74 ref = atomic_inc_return(&vamgr.refcount);
74 75
75 if (ref == 1) 76 if (ref == 1)
76 amdgpu_vamgr_init(&vamgr, dev); 77 amdgpu_vamgr_init(&vamgr, dev->dev_info.virtual_address_offset,
78 dev->dev_info.virtual_address_max,
79 dev->dev_info.virtual_address_alignment);
77 return &vamgr; 80 return &vamgr;
78} 81}
79 82