aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Xie2017-01-28 13:50:36 -0600
committerAlex Deucher2017-02-02 14:22:45 -0600
commit067e9a1d47a8373b3145481a70fec84ce8e76441 (patch)
treec24672d4f6f1cdada5b54be01e249a004f962ea3 /amdgpu/amdgpu_vamgr.c
parent7a03cdf6a703911d2a8e8ab0781f1e6b88412329 (diff)
downloadexternal-libgbm-067e9a1d47a8373b3145481a70fec84ce8e76441.tar.gz
external-libgbm-067e9a1d47a8373b3145481a70fec84ce8e76441.tar.xz
external-libgbm-067e9a1d47a8373b3145481a70fec84ce8e76441.zip
amdgpu: vamgr_32 can be a struct instead of a pointer
vamgr_32 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 8a707cbc..4dc4253c 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -236,7 +236,7 @@ int amdgpu_va_range_alloc(amdgpu_device_handle dev,
236 struct amdgpu_bo_va_mgr *vamgr; 236 struct amdgpu_bo_va_mgr *vamgr;
237 237
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
@@ -249,7 +249,7 @@ int amdgpu_va_range_alloc(amdgpu_device_handle dev,
249 if (!(flags & AMDGPU_VA_RANGE_32_BIT) && 249 if (!(flags & AMDGPU_VA_RANGE_32_BIT) &&
250 (*va_base_allocated == AMDGPU_INVALID_VA_ADDRESS)) { 250 (*va_base_allocated == AMDGPU_INVALID_VA_ADDRESS)) {
251 /* fallback to 32bit address */ 251 /* fallback to 32bit address */
252 vamgr = dev->vamgr_32; 252 vamgr = &dev->vamgr_32;
253 *va_base_allocated = amdgpu_vamgr_find_va(vamgr, size, 253 *va_base_allocated = amdgpu_vamgr_find_va(vamgr, size,
254 va_base_alignment, va_base_required); 254 va_base_alignment, va_base_required);
255 } 255 }