diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/allocator.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index 16fe2641..1bde290f 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/debugfs.h> | 20 | #include <linux/debugfs.h> |
21 | #include <linux/seq_file.h> | 21 | #include <linux/seq_file.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | |||
23 | #include <nvgpu/lock.h> | 24 | #include <nvgpu/lock.h> |
24 | 25 | ||
25 | /* #define ALLOCATOR_DEBUG */ | 26 | /* #define ALLOCATOR_DEBUG */ |
@@ -78,6 +79,8 @@ struct nvgpu_allocator_ops { | |||
78 | }; | 79 | }; |
79 | 80 | ||
80 | struct nvgpu_allocator { | 81 | struct nvgpu_allocator { |
82 | struct gk20a *g; | ||
83 | |||
81 | char name[32]; | 84 | char name[32]; |
82 | struct nvgpu_mutex lock; | 85 | struct nvgpu_mutex lock; |
83 | 86 | ||
@@ -238,13 +241,18 @@ void nvgpu_alloc_destroy(struct nvgpu_allocator *allocator); | |||
238 | void nvgpu_alloc_print_stats(struct nvgpu_allocator *a, | 241 | void nvgpu_alloc_print_stats(struct nvgpu_allocator *a, |
239 | struct seq_file *s, int lock); | 242 | struct seq_file *s, int lock); |
240 | 243 | ||
244 | static inline struct gk20a *nvgpu_alloc_to_gpu(struct nvgpu_allocator *a) | ||
245 | { | ||
246 | return a->g; | ||
247 | } | ||
248 | |||
241 | /* | 249 | /* |
242 | * Common functionality for the internals of the allocators. | 250 | * Common functionality for the internals of the allocators. |
243 | */ | 251 | */ |
244 | void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a); | 252 | void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a); |
245 | void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a); | 253 | void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a); |
246 | 254 | ||
247 | int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, | 255 | int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g, |
248 | const char *name, void *priv, bool dbg, | 256 | const char *name, void *priv, bool dbg, |
249 | const struct nvgpu_allocator_ops *ops); | 257 | const struct nvgpu_allocator_ops *ops); |
250 | 258 | ||