aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Xie2017-01-28 13:50:44 -0600
committerAlex Deucher2017-02-02 14:22:53 -0600
commitfe7cb34eda1855ac9770bc9f3e582897000e41b0 (patch)
tree1f9b794b15dc3a73ad9e1092ed1c4992ea8572cd /amdgpu/amdgpu_vamgr.c
parent067e9a1d47a8373b3145481a70fec84ce8e76441 (diff)
downloadexternal-libgbm-fe7cb34eda1855ac9770bc9f3e582897000e41b0.tar.gz
external-libgbm-fe7cb34eda1855ac9770bc9f3e582897000e41b0.tar.xz
external-libgbm-fe7cb34eda1855ac9770bc9f3e582897000e41b0.zip
amdgpu: vamgr can be a struct instead of a pointer
vamgr is an integral part of amdgpu_device. We don't need to calloc and free it. This can save CPU time, reduce heap fragmentation. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian K├Ânig <christian.koenig@amd.com> [Grazvydas Ignotas: rebase, correct a typo in commit message] Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_vamgr.c')
-rw-r--r--amdgpu/amdgpu_vamgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 4dc4253c..2b1388ed 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -238,7 +238,7 @@ int amdgpu_va_range_alloc(amdgpu_device_handle dev,
238 if (flags & AMDGPU_VA_RANGE_32_BIT) 238 if (flags & AMDGPU_VA_RANGE_32_BIT)
239 vamgr = &dev->vamgr_32; 239 vamgr = &dev->vamgr_32;
240 else 240 else
241 vamgr = dev->vamgr; 241 vamgr = &dev->vamgr;
242 242
243 va_base_alignment = MAX2(va_base_alignment, vamgr->va_alignment); 243 va_base_alignment = MAX2(va_base_alignment, vamgr->va_alignment);
244 size = ALIGN(size, vamgr->va_alignment); 244 size = ALIGN(size, vamgr->va_alignment);