summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/allocator.h33
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h
index 2d9b3d32..2bff0efd 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h
@@ -129,11 +129,11 @@ nvgpu_alloc_carveout_from_co_entry(struct nvgpu_list_node *node)
129 ((uintptr_t)node - offsetof(struct nvgpu_alloc_carveout, co_entry)); 129 ((uintptr_t)node - offsetof(struct nvgpu_alloc_carveout, co_entry));
130}; 130};
131 131
132#define NVGPU_CARVEOUT(__name, __base, __length) \ 132#define NVGPU_CARVEOUT(local_name, local_base, local_length) \
133 { \ 133 { \
134 .name = (__name), \ 134 .name = (local_name), \
135 .base = (__base), \ 135 .base = (local_base), \
136 .length = (__length) \ 136 .length = (local_length) \
137 } 137 }
138 138
139/* 139/*
@@ -207,13 +207,10 @@ static inline void alloc_unlock(struct nvgpu_allocator *a)
207/* 207/*
208 * Buddy allocator specific initializers. 208 * Buddy allocator specific initializers.
209 */ 209 */
210int __nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *na, 210int nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
211 struct vm_gk20a *vm, const char *name, 211 struct vm_gk20a *vm, const char *name,
212 u64 base, u64 size, u64 blk_size, 212 u64 base, u64 size, u64 blk_size,
213 u64 max_order, u64 flags); 213 u64 max_order, u64 flags);
214int nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
215 const char *name, u64 base, u64 size,
216 u64 blk_size, u64 flags);
217 214
218/* 215/*
219 * Bitmap initializers. 216 * Bitmap initializers.
@@ -282,9 +279,9 @@ void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a);
282void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a); 279void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a);
283#endif 280#endif
284 281
285int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g, 282int nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g,
286 const char *name, void *priv, bool dbg, 283 const char *name, void *priv, bool dbg,
287 const struct nvgpu_allocator_ops *ops); 284 const struct nvgpu_allocator_ops *ops);
288 285
289static inline void nvgpu_alloc_enable_dbg(struct nvgpu_allocator *a) 286static inline void nvgpu_alloc_enable_dbg(struct nvgpu_allocator *a)
290{ 287{
@@ -309,7 +306,7 @@ static inline void nvgpu_alloc_disable_dbg(struct nvgpu_allocator *a)
309 } while (0) 306 } while (0)
310#endif 307#endif
311 308
312#define __alloc_dbg(a, fmt, arg...) \ 309#define do_alloc_dbg(a, fmt, arg...) \
313 nvgpu_log((a)->g, gpu_dbg_alloc, "%25s " fmt, (a)->name, ##arg) 310 nvgpu_log((a)->g, gpu_dbg_alloc, "%25s " fmt, (a)->name, ##arg)
314 311
315/* 312/*
@@ -325,10 +322,10 @@ static inline void nvgpu_alloc_disable_dbg(struct nvgpu_allocator *a)
325#define alloc_dbg(a, fmt, arg...) \ 322#define alloc_dbg(a, fmt, arg...) \
326 do { \ 323 do { \
327 if ((a)->debug) \ 324 if ((a)->debug) \
328 __alloc_dbg((a), fmt, ##arg); \ 325 do_alloc_dbg((a), fmt, ##arg); \
329 } while (0) 326 } while (0)
330#else 327#else
331#define alloc_dbg(a, fmt, arg...) __alloc_dbg(a, fmt, ##arg) 328#define alloc_dbg(a, fmt, arg...) do_alloc_dbg(a, fmt, ##arg)
332#endif 329#endif
333 330
334#endif /* NVGPU_ALLOCATOR_H */ 331#endif /* NVGPU_ALLOCATOR_H */