aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov2015-08-07 10:54:29 -0500
committerEmil Velikov2015-08-13 11:43:33 -0500
commitb47181897770520bb5afcebc2c2c3ffaf7729a36 (patch)
treeffb3ae70930afc5e3cc920f2edc219758005ffe8
parentc19fa2b1ca8baec6ac8bb8aed6c0693c87e1a6de (diff)
downloadexternal-libdrm-b47181897770520bb5afcebc2c2c3ffaf7729a36.tar.gz
external-libdrm-b47181897770520bb5afcebc2c2c3ffaf7729a36.tar.xz
external-libdrm-b47181897770520bb5afcebc2c2c3ffaf7729a36.zip
amdgpu/amdgpu_vamgr: hide private symbols from global namespace
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian K├Ânig <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
-rw-r--r--amdgpu/amdgpu_internal.h18
-rw-r--r--amdgpu/amdgpu_vamgr.c17
2 files changed, 22 insertions, 13 deletions
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index ab01bb52..7f86da93 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -31,6 +31,8 @@
31 31
32#include <assert.h> 32#include <assert.h>
33#include <pthread.h> 33#include <pthread.h>
34
35#include "libdrm_macros.h"
34#include "xf86atomic.h" 36#include "xf86atomic.h"
35#include "amdgpu.h" 37#include "amdgpu.h"
36#include "util_double_list.h" 38#include "util_double_list.h"
@@ -121,15 +123,19 @@ void amdgpu_device_free_internal(amdgpu_device_handle dev);
121 123
122void amdgpu_bo_free_internal(amdgpu_bo_handle bo); 124void amdgpu_bo_free_internal(amdgpu_bo_handle bo);
123 125
124struct amdgpu_bo_va_mgr* amdgpu_vamgr_get_global(struct amdgpu_device *dev); 126drm_private struct amdgpu_bo_va_mgr*
127amdgpu_vamgr_get_global(struct amdgpu_device *dev);
125 128
126void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, struct amdgpu_bo_va_mgr *src); 129drm_private void
130amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst,
131 struct amdgpu_bo_va_mgr *src);
127 132
128uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, 133drm_private uint64_t
129 uint64_t alignment, uint64_t base_required); 134amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
135 uint64_t alignment, uint64_t base_required);
130 136
131void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, 137drm_private void
132 uint64_t size); 138amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size);
133 139
134int amdgpu_query_gpu_info_init(amdgpu_device_handle dev); 140int amdgpu_query_gpu_info_init(amdgpu_device_handle dev);
135 141
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index e2a4c875..b5d330f6 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -66,7 +66,8 @@ static void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
66 pthread_mutex_destroy(&mgr->bo_va_mutex); 66 pthread_mutex_destroy(&mgr->bo_va_mutex);
67} 67}
68 68
69struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_device *dev) 69drm_private struct amdgpu_bo_va_mgr *
70amdgpu_vamgr_get_global(struct amdgpu_device *dev)
70{ 71{
71 int ref; 72 int ref;
72 ref = atomic_inc_return(&vamgr.refcount); 73 ref = atomic_inc_return(&vamgr.refcount);
@@ -76,16 +77,18 @@ struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_device *dev)
76 return &vamgr; 77 return &vamgr;
77} 78}
78 79
79void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, 80drm_private void
80 struct amdgpu_bo_va_mgr *src) 81amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst,
82 struct amdgpu_bo_va_mgr *src)
81{ 83{
82 if (update_references(&(*dst)->refcount, NULL)) 84 if (update_references(&(*dst)->refcount, NULL))
83 amdgpu_vamgr_deinit(*dst); 85 amdgpu_vamgr_deinit(*dst);
84 *dst = src; 86 *dst = src;
85} 87}
86 88
87uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, 89drm_private uint64_t
88 uint64_t alignment, uint64_t base_required) 90amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
91 uint64_t alignment, uint64_t base_required)
89{ 92{
90 struct amdgpu_bo_va_hole *hole, *n; 93 struct amdgpu_bo_va_hole *hole, *n;
91 uint64_t offset = 0, waste = 0; 94 uint64_t offset = 0, waste = 0;
@@ -170,8 +173,8 @@ uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
170 return offset; 173 return offset;
171} 174}
172 175
173void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, 176drm_private void
174 uint64_t va, uint64_t size) 177amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
175{ 178{
176 struct amdgpu_bo_va_hole *hole; 179 struct amdgpu_bo_va_hole *hole;
177 180