aboutsummaryrefslogtreecommitdiffstats
path: root/amdgpu
diff options
context:
space:
mode:
authorAndrey Grodzovsky2018-02-19 01:18:36 -0600
committerAndrey Grodzovsky2018-02-19 08:32:17 -0600
commit33a2851ab9bc3cd8a68bedf4cf0fdc549b0f3596 (patch)
tree36d5376e1715efb020a4761d6a9782580a0d5f82 /amdgpu
parentab5aaf6c8eb93462c15007e9b54f4447c1ea8148 (diff)
downloadexternal-libdrm-33a2851ab9bc3cd8a68bedf4cf0fdc549b0f3596.tar.gz
external-libdrm-33a2851ab9bc3cd8a68bedf4cf0fdc549b0f3596.tar.xz
external-libdrm-33a2851ab9bc3cd8a68bedf4cf0fdc549b0f3596.zip
amdgpu: Fix mistake in initial hole size calculation.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Acked-by: Christian K├Ânig <christian.koenig@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu_vamgr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 722067f3..58400428 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -57,7 +57,7 @@ drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
57 pthread_mutex_init(&mgr->bo_va_mutex, NULL); 57 pthread_mutex_init(&mgr->bo_va_mutex, NULL);
58 pthread_mutex_lock(&mgr->bo_va_mutex); 58 pthread_mutex_lock(&mgr->bo_va_mutex);
59 n = calloc(1, sizeof(struct amdgpu_bo_va_hole)); 59 n = calloc(1, sizeof(struct amdgpu_bo_va_hole));
60 n->size = mgr->va_max; 60 n->size = mgr->va_max - start;
61 n->offset = start; 61 n->offset = start;
62 list_add(&n->list, &mgr->va_holes); 62 list_add(&n->list, &mgr->va_holes);
63 pthread_mutex_unlock(&mgr->bo_va_mutex); 63 pthread_mutex_unlock(&mgr->bo_va_mutex);
@@ -80,6 +80,7 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
80 struct amdgpu_bo_va_hole *hole, *n; 80 struct amdgpu_bo_va_hole *hole, *n;
81 uint64_t offset = 0, waste = 0; 81 uint64_t offset = 0, waste = 0;
82 82
83
83 alignment = MAX2(alignment, mgr->va_alignment); 84 alignment = MAX2(alignment, mgr->va_alignment);
84 size = ALIGN(size, mgr->va_alignment); 85 size = ALIGN(size, mgr->va_alignment);
85 86